Closed KnightNine closed 8 months ago
Looking at the GIF, it seems rotation keyframes wrap around if they reach 360 degrees (which means a keyframe can't go above 360 degrees).
@Calinou the bottom parent bone (which controls the outermost layer) rotates exactly 360 degrees, and in Godot, it rotates 180 degrees and then turns back. If I make the animation rotate to just under 360 degrees it works fine so you're almost right, you just cant reach 360 degrees. I also haven't tested if negative rotations also breaks the imported animations tough I would assume that you just can't reach -360 since it would be hard to overlook.
So if you want to create an animation which goes past 360 degrees, say a steering wheel, you'd need to keep in mind whenever the rotation is about to reach 360 and reset the wheel every time it's about to reach that value.
Anyways this would be finnicky as all hell for more complex animations.
so at least it can be done through importing by making sure the rotation never reaches 360 or -360, though if I decide to ever change the animation frame rate I'd probably encounter some issues where I added the "rotation resets".
looking back at 3.5 these "rotation resets" seem to have been added automatically so this is a regression.
Perhaps the Optimizer is removing too many keys.
Animations from glTF need to be baked, not imported with their keyframes in their entirety. At this time, if the Optimizer is enabled, some keys that rotate at constant velocity will be omitted depending on the threshold value.
I remember that I made it so that if a rotation of more than 180 degrees occurs, no omitting is done to prevent this from happening, but it may not be working properly.
For now, can you confirm that disabling the Optimizer will not cause this problem?
@TokageItLab How do I disable the Optimizer? Is it a setting, or something I need to change in the engine files?
@KnightNine Open importer scene by double click on 3d model resource in file dock.
@TokageItLab yes it fixes the issue!
I will see if I can improve Optimizer when I have time.
@TokageItLab I'm guessing you'd need to create some sorta exception flag for the optimizer to not delete the "rotation reset" keyframe pairs that are generated.
Godot version
4.0
System information
Windows 10
Issue description
I have this spinning animation in blender:
Importing it to Godot directly from the
.blend
file results in the animation oscillating between the lowest and highest rotation values instead of spinning. (exporting toglTF 2.0
has the same issue.)As a test i tried importing it using
.dae
hoping that maybe it would work fine like in 3.5 but it's the same issue and the bones are warped as well:This also means that importing a backflip animation, a spinning propeller, or a plane doing a barrel roll, would be impossible. Probably the only workaround would be to recreate the animations in the engine itself.
Steps to reproduce
after setting up blender support in godot drag and drop the blender file below into a project: Spinny Beam.zip
Right click it and create a "new inherited scene" to test the animations in the scene's animation player.
Minimal reproduction project
N/A