You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the AnimationTree with AnimationTreeStateMachine, and transitioning from an Animation that set a Canvas-Item's color via "self_modulate" to the next Animation, the "self_modulate" - parameter is set to black.
If the "self_modulate"-parameter has been explicitly set to any other color in the "RESET"-track, then this color is chosen instead.
This is not only true for "self_modulate", I have also observed this issue with e.g. "scale" (which is set to 0), but haven't tested all parameters.
In Godot 3, it was possible to simply not set this parameter in the following animation. That allowed me to have two animations setting an elements color to, say, red or blue, and have a follow-up animation play that is the same between both.
Now, it seems that the "RESET"-animation is played inbetween, but unlike before, it seems to set a default color (black) to the self_modulate-parameter if it is not explicitly set? (Or a default scale, etc.)
This may be intended behaviour, in which case I have not found anything suggesting this in the documentation, but I may have missed it. :) I certainly would be able to understand if any "RESET"-track setting is used before switching to the next animation, then the issue becomes how to handle parameters not specified in the "RESET"-track.
Also, if it is intended, then importing such AnimationTree's into Godot 4 from Godot 3 breaks the animation.
Steps to reproduce
I have attached a Minimal Reproduction Project below, which includes two scenes: One for "self_modulate", and one for "scale".
To use, open one of the scenes, select the AnimationTree and click "Play" on the first animation (called "ToYellow" or "Grow", respectively). You should see that once the animation changes to the "Move"-animation, any change in color or size is reset to black or zero.
Alternatively, you can setup the demo yourself:
Create any Canvas Item (I used "Label"), an AnimationPlayer and an AnimationTree
Add an Animation that changes "Scale" or "Self_modulate" from default to any other obvious parameter
Add a new Animation that changes something else, e.g. the Position
Connect the AnimationTree to your Animation Player, then add a StateMachine
Add your animations and connect your first to your second (I use Transition "At End" with "Auto"). Remember to connect Start and End
Play the Animation: Once you transition to your second animation, the change from your first is lost.
In the RESET-track, add a new default for your parameter, and try it again: At the transition point, the reset-value is chosen.
If you remove the newly added setting from your RESET-track, the old behaviour is observed.
Ah, you're absolutely right! I didn't think to check the Tutorial again. This change (resetting on node switching) does make sense to me after reading through #70207.
In that sense, I suppose this might be considered some kind of documentation issue?
Adding the info to AnimationNodeStateMachine and AnimationNodeStateMachinePlayback that a change during "travel" sets up the next animation via "RESET", and how unspecified parameters are handled. (And maybe link these two nodes somewhere on the AnimationTree-documentation!)
I might try my hand on creating a pull request for the documentation on that.
In any case, thanks for the links and the info!
How is the procedure now? Should I close this issue or should this be done by someone else? :)
Godot version
4.0rc2
System information
Windows 10
Issue description
When using the AnimationTree with AnimationTreeStateMachine, and transitioning from an Animation that set a Canvas-Item's color via "self_modulate" to the next Animation, the "self_modulate" - parameter is set to black.
If the "self_modulate"-parameter has been explicitly set to any other color in the "RESET"-track, then this color is chosen instead.
This is not only true for "self_modulate", I have also observed this issue with e.g. "scale" (which is set to 0), but haven't tested all parameters.
In Godot 3, it was possible to simply not set this parameter in the following animation. That allowed me to have two animations setting an elements color to, say, red or blue, and have a follow-up animation play that is the same between both.
Now, it seems that the "RESET"-animation is played inbetween, but unlike before, it seems to set a default color (black) to the self_modulate-parameter if it is not explicitly set? (Or a default scale, etc.)
This may be intended behaviour, in which case I have not found anything suggesting this in the documentation, but I may have missed it. :) I certainly would be able to understand if any "RESET"-track setting is used before switching to the next animation, then the issue becomes how to handle parameters not specified in the "RESET"-track.
Also, if it is intended, then importing such AnimationTree's into Godot 4 from Godot 3 breaks the animation.
Steps to reproduce
I have attached a Minimal Reproduction Project below, which includes two scenes: One for "self_modulate", and one for "scale".
To use, open one of the scenes, select the AnimationTree and click "Play" on the first animation (called "ToYellow" or "Grow", respectively). You should see that once the animation changes to the "Move"-animation, any change in color or size is reset to black or zero.
Alternatively, you can setup the demo yourself:
Minimal reproduction project
AnimationTreeReset.zip
The text was updated successfully, but these errors were encountered: