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

Make AnimationTree reference AnimationPlayer instead of AnimationMixer #84583

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented Nov 7, 2023

Fixes #83927

The animation_player property is set to only allow AnimationPlayer. But set_animation_player() did not do any checks about it. Internally, AnimationTree only checks if it points to an AnimationMixer before using the path. So when set to point to the AnimationTree itself, an infinite loop occurs eventually.

It's confirmed on RocketChat that set_animation_player() should only allow AnimationPlayer instead of AnimationMixer currently.

@timothyqiu timothyqiu added this to the 4.2 milestone Nov 7, 2023
@timothyqiu timothyqiu requested a review from a team as a code owner November 7, 2023 15:43
@YuriSizov
Copy link
Contributor

What if this value is set before the tree is available?

@YuriSizov YuriSizov modified the milestones: 4.2, 4.3 Nov 7, 2023
@YuriSizov YuriSizov added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Nov 7, 2023
@timothyqiu timothyqiu changed the title Validate path param for AnimationTree.set_animation_player() Make AnimationTree reference AnimationPlayer instead of AnimationMixer Nov 7, 2023
@timothyqiu
Copy link
Member Author

To makes things easier, I changed the internal reference from AnimationMixer to AnimationPlayer instead.

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments needs adjusting, but seems fine otherwise.

@YuriSizov YuriSizov merged commit 486e3a8 into godotengine:master Dec 16, 2023
15 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@timothyqiu timothyqiu deleted the path-to-ap branch December 17, 2023 05:29
@YuriSizov YuriSizov removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Jan 25, 2024
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.2.2.

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

Successfully merging this pull request may close these issues.

Executing AnimationTree.set_animation_player function crashes Godot (inifinite recursion?)
3 participants