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

AnimationPlayer RootNode null crash #91043

Closed
NotRabug50 opened this issue Apr 23, 2024 · 4 comments · Fixed by #94945
Closed

AnimationPlayer RootNode null crash #91043

NotRabug50 opened this issue Apr 23, 2024 · 4 comments · Fixed by #94945

Comments

@NotRabug50
Copy link

Tested versions

-4.2.2.stable

System information

Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Mobile) - dedicated NVIDIA GeForce GT 1030 (NVIDIA; 31.0.15.5161) - AMD Ryzen 3 1300X Quad-Core Processor (4 Threads)

Issue description

If you add a property track or idk any track and change the root node of scene and click this thing
image
godot will crash.
(sorry for bad english lol)

Steps to reproduce

-Create a scene
-Add a node and a animationplayer
-Add a key to animationplayer that is on root node
-Change the root node and click that thing on the image in description

Minimal reproduction project (MRP)

project.zip

@Dannode36
Copy link

Although the above MRP works, I couldn't reproduce the crash using those exact steps but was able reproduce it in a4fbe4c (4.3) by:

  1. Create a scene
  2. Add a root node and an AnimationPlayer to that node
  3. Add a track to the AnimationPlayer and chose the root node to animate
  4. Add a node as a child of the root node
  5. Make the new node the root node of the scene
  6. Make both the original root node and AnimationPlayer direct children (siblings) of the root node
  7. Set the AnimationPlayer to be the root node

This results in that text that crashes the engine on click (as described in the original issue) to display "." (It's path in the scene) and also crash Godot when clicked. The inspector will display the AnimationMixer root node as being "../Node3D".

The stack trace when running in console mode is also seemingly useless, only displaying "couldn't map PC to fn name" 15 times in a row.

@NotRabug50
Copy link
Author

Although the above MRP works, I couldn't reproduce the crash using those exact steps but was able reproduce it in a4fbe4c (4.3) by:

  1. Create a scene
  2. Add a root node and an AnimationPlayer to that node
  3. Add a track to the AnimationPlayer and chose the root node to animate
  4. Add a node as a child of the root node
  5. Make the new node the root node of the scene
  6. Make both the original root node and AnimationPlayer direct children (siblings) of the root node
  7. Set the AnimationPlayer to be the root node

This results in that text that crashes the engine on click (as described in the original issue) to display "." (It's path in the scene) and also crash Godot when clicked. The inspector will display the AnimationMixer root node as being "../Node3D".

The stack trace when running in console mode is also seemingly useless, only displaying "couldn't map PC to fn name" 15 times in a row.

oh maybe it is changed in 4.3

ArshPanesar added a commit to ArshPanesar/godot that referenced this issue Jul 28, 2024
When an AnimationPlayer is made root of a scene,
the track links are broken and clicking on them
will crash Godot. 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 Issue godotengine#91043
Version 4.2.2.stable
ArshPanesar added a commit to ArshPanesar/godot that referenced this issue Jul 29, 2024
When an AnimationPlayer is made root of a scene,
the track links may become broken and clicking on
them will crash Godot 4.2.2-stable

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 (See Issue godotengine#91043)

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 Crash in 4.2.2-stable and Fixes Broken Node
Links and Potential Crash in current master branch
@TokageItLab
Copy link
Member

@NotRabug50 @Dannode36 I can't reproduce the crash of the issue even after doing as described in the comments, can you put up a video that shows the steps that cause the crash?

@ArshPanesar
Copy link
Contributor

ArshPanesar commented Sep 1, 2024

Here is a video showing the crash in the current master branch [61598c5]. I did the exact steps described by @Dannode36 in the comments of the issue.

AnimPlayer.Master.Crash.webm

Here is the video that shows this PR's behaviour when the same steps are performed.

AnimPlayer.Master.Fixed.webm

The PR also fixes the issue for 4.2.2 where the reproduction steps are to simply make the AnimationPlayer node the scene root. I can add a video for this as well if you'd like.

@akien-mga akien-mga added this to the 4.4 milestone Sep 4, 2024
addmix pushed a commit to addmix/godot that referenced this issue Sep 6, 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.
maidopi-usagi pushed a commit to maidopi-usagi/godot that referenced this issue Sep 11, 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 pushed a commit to akien-mga/godot that referenced this issue Sep 16, 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.

(cherry picked from commit e905be8)
akien-mga pushed a commit to akien-mga/godot that referenced this issue Sep 17, 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.

(cherry picked from commit e905be8)
RadiantUwU pushed a commit to RadiantUwU/godot that referenced this issue Sep 30, 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.

(cherry picked from commit e905be8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants