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

fixed conflict between tracks have same name different type in the AnimationTree cache #49411

Closed

Conversation

TokageItLab
Copy link
Member

@TokageItLab TokageItLab commented Jun 7, 2021

Fixed #48526.
Fixed #43848.

An animation will no longer be stuck implicitly as long as the single animation is played in the animation.

However, when some tracks conflict in the one animation, or when blending animations of different track types that will set the same value, only the track with the later iteration order will be played, regardless of the blend value. For example, the blending of ValueTrack and BezierTrack is not yet working correctly (so it's been like that for a while). This may need to be fixed in the future. See #49431. ValueTrack and BezierTrack are can be blended by latest commit. Fixed #49431. (But BlendShape Track and TRS Track are not so.)

@TokageItLab TokageItLab requested a review from a team as a code owner June 7, 2021 23:39
@TokageItLab TokageItLab changed the title fixed a conflict in the AnimationTree cache between tracks with the s… fixed conflict between tracks have same name different type in the AnimationTree cache Jun 8, 2021
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch from c86f978 to 6362ed9 Compare June 8, 2021 07:31
@Calinou Calinou added this to the 4.0 milestone Jun 8, 2021
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch from 6362ed9 to 3820709 Compare June 8, 2021 18:27
@TokageItLab TokageItLab marked this pull request as draft June 8, 2021 20:07
@TokageItLab TokageItLab marked this pull request as ready for review June 8, 2021 20:16
@TokageItLab
Copy link
Member Author

TokageItLab commented Jun 8, 2021

Self considering. I thought it was fine to cache MethodTrack and AudioTrack separately.

However, currently, for Transform3D, Value, and Bezier, the changes are stored in the TrackCache in each TrackType without blending. To solve #49431, we need a way to convert, blend and combine them into one in the cache.

@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch 3 times, most recently from f02fb9e to 60ef0c6 Compare June 9, 2021 22:17
@TokageItLab
Copy link
Member Author

TokageItLab commented Jun 9, 2021

BezierTrack and ValueTrack can now be blended together. However, the subpath must match.

For example,

[BezierTrack]
Node2D:position:x
Node2D:position:y

and

[ValueTrack]
Node2D:position:x
Node2D:position:y

will be blended, but

[ValueTrack]
Node2D:position

will not be blended.

The above case can be seen in the demo project.

track_blends_2.zip

If you want to solve the matching problem, we will need to do a huge refactoring.

Currently, we can't tell from the subpath name "x" whether it is a Vector2 or Vector3, so we need to do a search every frame, every ValueTrack with a subpath, by tracing the parent of the NodePath and actually getting the value of the path and checking the type.

@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch from 60ef0c6 to 4f63e96 Compare August 27, 2021 17:04
@TokageItLab TokageItLab requested review from lyuma and removed request for a team August 28, 2021 07:06
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch from a420bd4 to 0eb1f6b Compare September 1, 2021 22:39
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch from 0eb1f6b to d1e1f1d Compare September 21, 2021 11:04
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch 3 times, most recently from 081b6df to 6a55f46 Compare November 20, 2021 01:07
@TokageItLab TokageItLab marked this pull request as draft November 20, 2021 01:17
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch 5 times, most recently from ea2cf87 to e58a8a7 Compare November 20, 2021 22:05
@TokageItLab
Copy link
Member Author

TokageItLab commented Jan 19, 2022

Some methods has been outdated; superseded by #56902.

@TokageItLab
Copy link
Member Author

TokageItLab commented Mar 8, 2022

I managed this in #56902, but reduz is not that positive about retargeting at least for 4.0, so I don't know if it will be merged by 4.0 or not.
In the meantime, I will salvage these for bug fixes separately from that.

@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch 2 times, most recently from 562278a to 7ccee00 Compare March 8, 2022 23:30
@TokageItLab TokageItLab requested a review from reduz March 9, 2022 00:00
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch from 7ccee00 to ccf0bbb Compare March 9, 2022 00:12
@TokageItLab
Copy link
Member Author

Salvaged and rebased.

@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch from ccf0bbb to 63d603d Compare March 9, 2022 20:02
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch 2 times, most recently from d1ccf7d to 7018215 Compare March 17, 2022 20:13
@TokageItLab TokageItLab force-pushed the fix-trackcache-conflict branch from 7018215 to 34f3641 Compare March 17, 2022 22:18
@TokageItLab
Copy link
Member Author

Closing this once since it is out of date. The inability to blend BezierTrack and ValueTrack can be made a documentation issue, but I think it needs to be taken care of in cases of path conflicts such as AudioTrack and MethodTrack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants