Editor crashes when a new AnimationTree is added to the scene and the blend mode is changed to discrete. This happens if the scene tree is not saved after adding the AnimationTree (having a different scene with an animation tree working may alter behavior). On saving the scene tree or adding a point on the blend space, the issue resolves itself, for that particular scene.
Steps to reproduce
Create Node2D root node (you may save the scene).
Create AnimationTree child node (do not save the scene)
Create new BlendSpace2D in the AnimationTree.
Change the blend mode to discrete.
Note: Saving at different stages alters behavior. If a different scene has AnimationTree working, then this might not reproduce the crash.
Tested versions
System information
Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 (NVIDIA; 31.0.15.3623) - Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz (4 Threads)
Issue description
Editor crashes when a new AnimationTree is added to the scene and the blend mode is changed to discrete. This happens if the scene tree is not saved after adding the AnimationTree (having a different scene with an animation tree working may alter behavior). On saving the scene tree or adding a point on the blend space, the issue resolves itself, for that particular scene.![crash](https://github.com/godotengine/godot/assets/68583762/a7bb97f8-e672-4726-a4b0-7900bb256916)
Steps to reproduce
Note: Saving at different stages alters behavior. If a different scene has AnimationTree working, then this might not reproduce the crash.
Minimal reproduction project (MRP)
N/A (Project Independent)