KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.49k stars 317 forks source link

Animations Only Playing At Half Effect When Played Together #1944

Closed dizziless closed 1 year ago

dizziless commented 1 year ago

Similar to this issue I was having with shape keys: (https://github.com/KhronosGroup/glTF-Blender-IO/issues/1932)

I am experiencing an issue with skeletal animations where when I play them one at a time, they all play as they should, but I recently added a set of emotes (Yes, No, and IDK/I don't know) which are meant to be played in combination with other animations like Idle and Seated Idle.

The problem is that when they are played in combination, each animation only plays half of its effect.

The emotes only have keyframes on the bones that contribute to the animation, so there is no direct interference of any bones making movements which might cancel each other out.

I decided to try recreate the issue using the simplest possible setup, a cube and a single bone, and the issue persists.

In addition to the video, I've also attached the cube. Since the model and "rig" are so simple, I didn't think it would be necessary to include a blend file, but I will if you need it. It's only the character that I'm not allowed to share.

Bonus issue: the Yes emote seems to take on the pose of the first frame of the Walk animation for some reason. I suspect it has something to do with the position of the NLA track in the stack, but I'm not 100% sure.

Simple Cube Animation.zip

https://github.com/KhronosGroup/glTF-Blender-IO/assets/130783670/9319cff6-d091-4ab7-b15a-860ee7bfc128

julienduroure commented 1 year ago

Hello, Please always provide a test case file, even if you think it is not necessary. Whithout it, I can really understand what you say

dizziless commented 1 year ago

Error_Example.zip

julienduroure commented 1 year ago

Hello, No issue here. By default, every channel of bones are exporting during sampling, even if there is no changing property. Then, in the viewer, interpolation is done between an action with full hop, and an action with all value at initial value: Visually, we see the height at half the value.

You have to uncheck the option "Force keeping channel for bones", and you will see what you want. image

dizziless commented 1 year ago

I'm seeing this issue in the viewer using exports from 3.2.1 and 3.5.

What version of blender should I be using to export to be able to have two animations play at the same time with both at full values?

donmccurdy commented 1 year ago

If both animations affect the same bones, then the issue is outside the control of the exporter. Some 3D engines or viewers support "additive animation" which would allow one animation to play on top of another, but that is a viewer feature, not inherent in the glTF file itself.

dizziless commented 1 year ago

I see. In the case of the character, only the bones that contribute to the emote animations are keyframed, so there should be no source for conflict.

Yes! Additive animation is what I was thinking of. I know it's a feature inside blender, but the game engine we're using is custom made, so my programming partner will have to add that in himself, I think.

Don, while I have you, is there any specific order that should be followed to with regards to stacking the NLA tracks in preparation for export?

In blender the No and IDK emotes were at the top of the stack above the Idle animation, and the Yes emote was at the bottom, underneath the Walk animation and seemed to take on the first frame of the Walk cycle when playing the Yes emote in the viewer.

donmccurdy commented 1 year ago

Don, while I have you, is there any specific order that should be followed to with regards to stacking the NLA tracks in preparation for export?

Afraid I don't know the answer on that one, sorry!