Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable to update AnimationAction._effectiveWeight by mixer even if its .enabled is false #11033

Merged
merged 3 commits into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/animation/AnimationAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ function AnimationAction( mixer, clip, localRoot ) {

this.repetitions = Infinity; // no. of repetitions when looping

this.paused = false; // false -> zero effective time scale
this.enabled = true; // true -> zero effective weight
this.paused = false; // true -> zero effective time scale
this.enabled = true; // false -> zero effective weight

this.clampWhenFinished = false; // keep feeding the last frame?

Expand Down Expand Up @@ -220,7 +220,7 @@ Object.assign( AnimationAction.prototype, {

// Time Scale Control

// set the weight stopping any scheduled warping
// set the time scale stopping any scheduled warping
// although .paused = true yields an effective time scale of zero, this
// method does *not* change .paused, because it would be confusing
setEffectiveTimeScale: function( timeScale ) {
Expand Down Expand Up @@ -327,8 +327,18 @@ Object.assign( AnimationAction.prototype, {
// Interna

_update: function( time, deltaTime, timeDirection, accuIndex ) {

// called by the mixer

if ( ! this.enabled ) {

// call ._updateWeight() to update ._effectiveWeight

this._updateWeight( time );
return;

}

var startTime = this._startTime;

if ( startTime !== null ) {
Expand Down
6 changes: 1 addition & 5 deletions src/animation/AnimationMixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,7 @@ Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {

var action = actions[ i ];

if ( action.enabled ) {

action._update( time, deltaTime, timeDirection, accuIndex );

}
action._update( time, deltaTime, timeDirection, accuIndex );

}

Expand Down