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.46k stars 308 forks source link

GLTF - Morph Target Animation - import bug #724

Closed Bug-Reaper closed 4 years ago

Bug-Reaper commented 4 years ago

the bug Trying to import .gltf file with a complicated shape key lip sync animation.

The .gltf file imports the animation with keyframe data, but rather than importing the animation once on the parent node, the animation is duplicated several times and imported on each child mesh containing shape keys used in that animation.

TLDR: Complex shape key animations with multiple mesh targets seem to import improperly on from a .gltf file

To Reproduce Import the .gltf files attached in the zip to this post.

Expected behavior There should be one animation on the parent node which targets multiple meshes for shape key transformations.

.blend file/ .gltf goodGLTFSample.zip

Version

julienduroure commented 4 years ago

Well ... Both your files have a huge number of errors ... I don't know what exporter you used, but seems data you are trying to import in Blender are maybe not what you are thinking.

Please provide some more valid files if you still have errors with correct files.

Waiting these files, closing this ticket.

gltf file : 44 errors image

glb file: 224 errors image

Bug-Reaper commented 4 years ago

Hey there, I was using the threejs GLTFExporter. I've been fixing some related bugs over in that repo.

Anyway, I was able to generate a .gltf file which produces no errors. goodGLTFSample.zip

There is a single animation on the root parent node. However when imported to blender, that animation is duplicated across the many child meshes targeted in that shape key animation.

I believe that blender should import this as a single animation, considering that is how it is stored in the .gltf file.

@julienduroure Thank you! let me know if I should open a new issue or if it would be better to re-open this one?

Also, if anyone knows offhand which files process importing shape key animations, let me know and I'll be happy to start investigating further.

Screenshot_2019-10-10_00-00-01

julienduroure commented 4 years ago

Hello,

I can't see any bugs here. Animation target all mesh nodes, not only the root parent, because this is morph animation. In blender, each mesh objet must have its own animation, this is how blender works. In blender 2.81 (alpha) NLA, you can this that all these animations are owned by the same glTF animation, based on the track name "Animation1"

image