Kupoman / blendergltf

A glTF exporter for Blender
Apache License 2.0
319 stars 49 forks source link

Only Exporting keyframes set for certain objects/channel #141

Closed shrekshao closed 6 years ago

shrekshao commented 6 years ago

Hi Kupoman

It seems to me that currently the exporter export the animation of the whole thing, including those objects that don't have key-frames set for the current track. It uses the current pose shown in the blender view for those objects without key-frames set. Can you confirm this?

A feature(or option) I want is that for each track (action in the action editor), export only the objects/channels that actually has key-frames set. An example of glTF with this kind of animation layout is BrainStem, where each track only animate a subset of the objects (The unmerged history version is here: https://github.com/KhronosGroup/glTF-Sample-Models/blob/79891f1bf08b8ddee531a8d82926d5f24d390e51/2.0/BrainStem/glTF-Binary/BrainStem.glb). You can load this with https://gltf-viewer.donmccurdy.com/. image As you see each animation corresponds to the movement of a part of the body.

With this, we can blend these animations at run time.

Thanks, Shuai

Kupoman commented 6 years ago

Empty channels have been excluded from exporting since f21506f35941ead900e1e17f05def543386f23a5. If you have an example where this is not working, could you please share a .blend file.

shrekshao commented 6 years ago

saber-animations-clarinet-model-attach-animation.zip

image

For example, the Clarinet-Body-Swing animation doesn't contain keyframe on fingers. But seems like in the exported gltf, there are still channels for finger joints.

No sure if this feature is easy to support.

Kupoman commented 6 years ago

When I export the model using the head of master, I only see one channel for the Clarinet-Body-Swing animation. I do not see any channels for fingers in that animation.

shrekshao commented 6 years ago

Hmm am I using an older version? I remember I delete these channels manually in the gltf json file. Let me retest it and I will close this if anything works fine. Thank you!

Kupoman commented 6 years ago

@shrekshao, have you had a chance to retest this yet?

shrekshao commented 6 years ago

Sorry for the late reply. Using 1.2.0, you are right. It is only exporting certain channels. My bad.... image