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: Call Method track, unable to select Object type in Args of AnimationTrackKeyEdit inspector #91289

Open
krazzei opened this issue Apr 28, 2024 · 0 comments · May be fixed by #90134

Comments

@krazzei
Copy link

krazzei commented Apr 28, 2024

Tested versions

  • Reproducible in: 4.3.dev (4a01602), 4.2.1

System information

Godot v4.3.dev (4a01602) - Windows 10.0.22631 - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XTX (Advanced Micro Devices, Inc.; 31.0.24027.1012) - AMD Ryzen 9 7950X3D 16-Core Processor (32 Threads)

Issue description

When adding arguments to a method call on an AnimationPlayer track, you are unable to select Object from Nil. You can select other types from Nil and it works as expected. And converting from a non-Nil types to Object works.

I've found in editor/animation_track_editor.cpp on about line 217 is the start of the problem, we seem to be copying the original Variant (which is type Nil) in the code above. See the d_new variable. Then we pass the old variant (still Nil type) into the Variant::construct as a parameter. The crux of the problem is that Variant::construct doesn't set the type to Object in this case. Other cases seem to use the case below (line 219) with a nullptr argument, which calls a different construct that ends up calling a VariantDefaultInitializer for the desired type.

Steps to reproduce

extract the attached test.zip and open it with godot (4.3 dev)

  • Open the scene "node_3d.tscn" if it isn't already
  • Click on the AnimationPlayer in the scene
  • Navigate to the Animation Editor (if it isn't already opened)
  • Select the "new_animation" animation in the animation drop down (if not already selected)
  • click on one of the spawnObject key frames (or create a new one and select it)
  • In the Key Frame inspector increase arg count if it is 0
  • Drop down the Args until you find an arg with with a nil type
  • Try to select the Object type and notice that it remains Nil.

Minimal reproduction project (MRP)

test.zip

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