godot
godot copied to clipboard
AnimationPlayer RootNode null crash
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
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)
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:
- Create a scene
- Add a root node and an AnimationPlayer to that node
- Add a track to the AnimationPlayer and chose the root node to animate
- Add a node as a child of the root node
- Make the new node the root node of the scene
- Make both the original root node and AnimationPlayer direct children (siblings) of the root node
- 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.
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:
- Create a scene
- Add a root node and an AnimationPlayer to that node
- Add a track to the AnimationPlayer and chose the root node to animate
- Add a node as a child of the root node
- Make the new node the root node of the scene
- Make both the original root node and AnimationPlayer direct children (siblings) of the root node
- 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
@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?
Here is a video showing the crash in the current master branch [61598c5c88d95b96811d386cb20d714c35f4c6d7]. I did the exact steps described by @Dannode36 in the comments of the issue.
Here is the video that shows this PR's behaviour when the same steps are performed.
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.