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

Fix AnimationPlayer crash when it's made the scene root #94945

Merged

Conversation

ArshPanesar
Copy link
Contributor

@ArshPanesar ArshPanesar commented Jul 30, 2024

When an AnimationPlayer node is made the root of a scene, the node links on the Animation Track can become broken and clicking on them will crash Godot 4.2.2-stable. The current master branch also breaks the node links when AnimationPlayer is made scene root, and can also crash the engine if another node was made the scene root prior to the AnimationPlayer (See Issue #91043)

This happens because when made root, the editor loses track of AnimationPlayer's root_node. By keeping a cached pointer to the root_node, the track links can remain functional.

Fixes Crash in 4.2.2-stable and Fixes Broken Node Links and Potential Crash in current master branch.

@AThousandShips AThousandShips changed the title Fixed AnimationPlayer crashing godot when its made the scene root Fix AnimationPlayer crashing godot when it's made the scene root Jul 30, 2024
@AThousandShips AThousandShips requested a review from a team July 30, 2024 09:46
@AThousandShips AThousandShips added bug crash topic:animation cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Jul 30, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Jul 30, 2024
@TokageItLab
Copy link
Member

As I wrote in #91043 (comment), I can't actually reproduce the crash of issue #91043. Can you raise a video or something that reproduces the occurrence of the crash?

As the this PR change is understandable, so for approving, we need to actually see the crash reproduced and if this PR fix it.

@akien-mga akien-mga changed the title Fix AnimationPlayer crashing godot when it's made the scene root Fix AnimationPlayer crashing when it's made the scene root Sep 4, 2024
@akien-mga akien-mga changed the title Fix AnimationPlayer crashing when it's made the scene root Fix AnimationPlayer crash when it's made the scene root Sep 4, 2024
When an AnimationPlayer is made root of a scene,
the track links may become broken and clicking on
them will crash.

Current master branch also breaks node links when
AnimationPlayer is made scene root, and can also
crash the engine if another node was made scene
root prior to the AnimationPlayer.

This happens because when made root, the editor
loses track of AnimPlayer's root node. By keeping
a copy of the AnimPlayer's root_node, the track
links remain functional.

Fixes godotengine#91043.
@akien-mga akien-mga force-pushed the fix-anim-player-root-crash branch from 0e53572 to e905be8 Compare September 4, 2024 08:45
@akien-mga
Copy link
Member

I updated the PR branch to squash the commits and tweaked the commit message a bit. Should be ready to merge once CI passes.

@fire fire requested a review from a team September 4, 2024 08:56
@akien-mga akien-mga merged commit 7881dc2 into godotengine:master Sep 4, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 4.3.1.

@akien-mga akien-mga removed the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Sep 16, 2024
@akien-mga akien-mga removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Mar 19, 2025
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.

AnimationPlayer RootNode null crash
4 participants