|
@@ -502,13 +502,13 @@ THREE.SEA3D.Animator.prototype.updateAnimations = function( mixer ) {
|
|
|
this.animations = [];
|
|
|
this.animationsData = {};
|
|
|
|
|
|
- var animations = this instanceof THREE.SEA3D.Animator ? this.clips : this.geometry.animations;
|
|
|
+ this.clips = this instanceof THREE.SEA3D.Animator ? this.clips : this.geometry.animations;
|
|
|
|
|
|
- for ( var i = 0; i < animations.length; i ++ ) {
|
|
|
+ for ( var i = 0, clips = this.clips; i < clips.length; i ++ ) {
|
|
|
|
|
|
- var name = animations[ i ].name;
|
|
|
+ var name = clips[ i ].name;
|
|
|
|
|
|
- this.animations[ name ] = this.animations[ i ] = animations[ i ];
|
|
|
+ this.animations[ name ] = this.animations[ i ] = clips[ i ];
|
|
|
this.animationsData[ name ] = this.animationsData[ i ] = {};
|
|
|
|
|
|
}
|
|
@@ -579,7 +579,9 @@ THREE.SEA3D.Animator.prototype.play = function( name, crossfade, offset, weight
|
|
|
|
|
|
if ( animation == this.currentAnimation ) {
|
|
|
|
|
|
- if ( offset !== undefined || ! animation.loop ) this.currentAnimationAction.time = offset !== undefined ? offset : 0;
|
|
|
+ if ( offset !== undefined || ! animation.loop ) this.currentAnimationAction.time = offset !== undefined ? offset :
|
|
|
+ ( this.currentAnimationAction.timeScale >= 0 ? 0 : this.currentAnimation.duration );
|
|
|
+
|
|
|
this.currentAnimationAction.setEffectiveWeight( weight !== undefined ? weight : 1 );
|
|
|
this.currentAnimationAction.paused = false;
|
|
|
|
|
@@ -594,7 +596,7 @@ THREE.SEA3D.Animator.prototype.play = function( name, crossfade, offset, weight
|
|
|
|
|
|
this.previousAnimationAction = this.currentAnimationAction;
|
|
|
this.currentAnimationAction = this.mixer.clipAction( animation ).setLoop( animation.loop ? THREE.LoopRepeat : THREE.LoopOnce, Infinity ).reset();
|
|
|
- this.currentAnimationAction.clampWhenFinished = true;
|
|
|
+ this.currentAnimationAction.clampWhenFinished = ! animation.loop;
|
|
|
this.currentAnimationAction.paused = false;
|
|
|
|
|
|
this.previousAnimationData = this.currentAnimationData;
|
|
@@ -602,7 +604,9 @@ THREE.SEA3D.Animator.prototype.play = function( name, crossfade, offset, weight
|
|
|
|
|
|
this.updateTimeScale();
|
|
|
|
|
|
- if ( offset !== undefined || ! animation.loop ) this.currentAnimationAction.time = offset !== undefined ? offset : 0;
|
|
|
+ if ( offset !== undefined || ! animation.loop ) this.currentAnimationAction.time = offset !== undefined ? offset :
|
|
|
+ ( this.currentAnimationAction.timeScale >= 0 ? 0 : this.currentAnimation.duration );
|
|
|
+
|
|
|
this.currentAnimationAction.setEffectiveWeight( weight !== undefined ? weight : 1 );
|
|
|
|
|
|
this.currentAnimationAction.play();
|
|
@@ -857,7 +861,7 @@ THREE.SEA3D.Dummy.prototype.copy = function( source ) {
|
|
|
this.props = source.props;
|
|
|
this.scripts = source.scripts;
|
|
|
|
|
|
- if ( this.animation ) this.animation = source.animation.clone( this );
|
|
|
+ if ( this.animator ) this.animator = source.animator.clone( this );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -903,7 +907,7 @@ THREE.SEA3D.Mesh.prototype.copy = function( source ) {
|
|
|
this.props = source.props;
|
|
|
this.scripts = source.scripts;
|
|
|
|
|
|
- if ( this.animation ) this.animation = source.animation.clone( this );
|
|
|
+ if ( this.animator ) this.animator = source.animator.clone( this );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -948,7 +952,7 @@ THREE.SEA3D.SkinnedMesh.prototype.copy = function( source ) {
|
|
|
this.props = source.props;
|
|
|
this.scripts = source.scripts;
|
|
|
|
|
|
- if ( this.animation ) this.animation = source.animation.clone( this );
|
|
|
+ if ( this.animator ) this.animator = source.animator.clone( this );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -982,7 +986,7 @@ THREE.SEA3D.VertexAnimationMesh.prototype.copy = function( source ) {
|
|
|
this.props = source.props;
|
|
|
this.scripts = source.scripts;
|
|
|
|
|
|
- if ( this.animation ) this.animation = source.animation.clone( this );
|
|
|
+ if ( this.animator ) this.animator = source.animator.clone( this );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -1010,7 +1014,7 @@ THREE.SEA3D.Camera.prototype.copy = function( source ) {
|
|
|
this.props = source.props;
|
|
|
this.scripts = source.scripts;
|
|
|
|
|
|
- if ( this.animation ) this.animation = source.animation.clone( this );
|
|
|
+ if ( this.animator ) this.animator = source.animator.clone( this );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -1038,7 +1042,7 @@ THREE.SEA3D.OrthographicCamera.prototype.copy = function( source ) {
|
|
|
this.props = source.props;
|
|
|
this.scripts = source.scripts;
|
|
|
|
|
|
- if ( this.animation ) this.animation = source.animation.clone( this );
|
|
|
+ if ( this.animator ) this.animator = source.animator.clone( this );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -1066,7 +1070,7 @@ THREE.SEA3D.PointLight.prototype.copy = function( source ) {
|
|
|
this.props = source.props;
|
|
|
this.scripts = source.scripts;
|
|
|
|
|
|
- if ( this.animation ) this.animation = source.animation.clone( this );
|
|
|
+ if ( this.animator ) this.animator = source.animator.clone( this );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -1339,16 +1343,16 @@ THREE.SEA3D.prototype.applyDefaultAnimation = function( sea, animatorClass ) {
|
|
|
|
|
|
switch ( anm.tag.type ) {
|
|
|
case SEA3D.Animation.prototype.type:
|
|
|
- obj.animation = new animatorClass( anm.tag.tag, obj );
|
|
|
- obj.animation.setRelative( anm.relative );
|
|
|
+ obj.animator = new animatorClass( anm.tag.tag, obj );
|
|
|
+ obj.animator.setRelative( anm.relative );
|
|
|
|
|
|
if ( this.config.autoPlay ) {
|
|
|
|
|
|
- obj.animation.play( 0 );
|
|
|
+ obj.animator.play( 0 );
|
|
|
|
|
|
}
|
|
|
|
|
|
- return obj.animation;
|
|
|
+ return obj.animator;
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -2371,7 +2375,7 @@ THREE.SEA3D.PointSound.prototype.copy = function( source ) {
|
|
|
this.props = source.props;
|
|
|
this.scripts = source.scripts;
|
|
|
|
|
|
- if ( this.animation ) this.animation = source.animation.clone( this );
|
|
|
+ if ( this.animator ) this.animator = source.animator.clone( this );
|
|
|
|
|
|
return this;
|
|
|
|