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

4.0 Alpha 5 regression: Color blending with alpha channel by AnimationTree is broken #59474

Closed
jcarlosrc opened this issue Mar 24, 2022 · 11 comments · Fixed by #60093
Closed

Comments

@jcarlosrc
Copy link

Godot version

4.0 Alpha 5

System information

Windows 10

Issue description

When using an Animation Tree it changes properties to default values after an animation is ended. As an example, in the minimal project attached:

  • If we use the AnimationPlayer directly, it works as expected (transparency to 0) (first video).
  • If we use the AnimationTree, it resets ColorRect to a default white (1,1,1,1) color value (second video).

This occurs for any property on any node. The problem is new, Alpha 4 did not preset it. Imported animations from Blender seems not to be affected.

BugReport02_4alpha5.DEBUG.2022-03-24.12-50-59.mp4
BugReport02_4alpha5.DEBUG.2022-03-24.12-51-21.mp4

Steps to reproduce

In the attached minimal project, enable or disable "Use animation tree" option and run the project to see the behavior as in the videos.

Minimal reproduction project

BugReport02_4alpha5.zip

@Calinou
Copy link
Member

Calinou commented Mar 24, 2022

cc @TokageItLab

@Calinou Calinou added this to the 4.0 milestone Mar 24, 2022
@nonunknown
Copy link
Contributor

just a question, the animationplayer in question was made local?

@jcarlosrc
Copy link
Author

just a question, the animationplayer in question was made local?

Yes, animations were made inside Godot. Those are which have the problem.

@jcarlosrc
Copy link
Author

It is a simple animatio

just a question, the animationplayer in question was made local?

Yes, animations were made inside Godot. Those are which have the problem.

It is a simple Animation Player node in main scene which changes the color of a child node, the color rectangle.

@TokageItLab
Copy link
Member

TokageItLab commented Mar 24, 2022

I think this is a bug caused by Variant::zero() actually using an initial value instead of zero: we want Color(0,0,0,0) but it return Color(0,0,0,1), maybe we should create separate functions like Variant::zero() and Variant::init().

@TokageItLab
Copy link
Member

TokageItLab commented Mar 24, 2022

For now, this seems to be a special case bug for the alpha value of Color. I have sent a fix so that Variant::zero() explicitly returns Color(0,0,0,0) for blending as #59490.

@jcarlosrc
Copy link
Author

This is not exclusive of color. Animated collision shapes also go back to its default (0,0,0) position in a similar behavior.

For now, this seems to be a special case bug for the alpha value of Color. I have sent a fix so that Variant::zero() explicitly returns Color(0,0,0,0) for blending as #59490.

@TokageItLab
Copy link
Member

@jcarlosrc Can you test #59490?

@TokageItLab
Copy link
Member

TokageItLab commented Mar 25, 2022

Note: Maybe it should be noted in the documentation, if one of the two animations to be blended is lacking a track, it will be blended with the zero value. As we said #46038 (comment).

In other words, the incorrect color blending is a bug. The change in the behavior for blending lacking tracks is an ideal behavior.

@jcarlosrc
Copy link
Author

If a track is missing in the other animation it should not be blended. This is the behavior of all versions previous to 4.0 alpha 5. Otherwise, we will need to insert a track for every property ever keyframed in any animation to avoid a bad mixing. This does not make sense.

@TokageItLab
Copy link
Member

It creates an incongruity that the blended result will not always be the same, and we decided in discussions with reduz that it is an edge case.

@TokageItLab TokageItLab changed the title 4.0 Alpha 5 regression: AnimationTree does not respect AnimationPlayer values. It resets properties values to default. 4.0 Alpha 5 regression: Color blending with alpha channel by AnimationTree is broken Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment