kcoley / gltf2usd

command-line utility for converting glTF 2.0 models to USD
MIT License
263 stars 39 forks source link

Simple Transform Animation(s) Does Not Work (Again) and Stuttering #111

Closed enzyme69 closed 5 years ago

enzyme69 commented 5 years ago

anim_test_005.blend.zip USDZ_NoAnim.zip

It's almost as if we are going back to zero, but maybe I did something wrong here.

So, in Blender I have 5 boxes, animated procedurally, just random wiggle translation XYZ, and all the animation is baked.

I exported using GLTF, with simple PBR material, and then I converted using USDZ like usual.

Suddenly there is no animation.

Is animation now required to be Bones animation only?

enzyme69 commented 5 years ago

The strange thing is GLTF 2.0 validation when I am using online GLTF Viewer:

Code Message Pointer
EMPTY_ENTITY Entity cannot be empty. /animations/0/channels
EMPTY_ENTITY Entity cannot be empty. /animations/0/samplers
enzyme69 commented 5 years ago

Oookk... I figured it out. I really need to bake every single frames and there should not be gap? I use Blender "Bake Action" and it's all good now!

Thanks!!

enzyme69 commented 5 years ago

However, now the animation is now stuttering and only 1 out of 5 boxes is animating.

😩

I checked using online GLTF anim viewer, and it seems ok, although I need to turn on the action manually.

USDZ_WeirdAnimStutter.zip

kcoley commented 5 years ago

Hi @enzyme69 . I experimented with the fps by setting it to a smaller value like 10, to get a less stuttery result (--fps 10 ). It might be related to sampling within the converter when converting to usdz and the animation interpolation on iOS/quicklook.

The converter currently only uses the first animation group in the glTF file. If you were to load in this glTF viewer, you can pick which animation group you wish to use:

https://gltfviewer.babylonjs.com/

screen shot 2018-11-28 at 11 51 06 pm

It is set up this way to avoid having two animation groups attempt to animate the same geometry. I could add a flag to specify which animation group you want to export to the file.

kcoley commented 5 years ago

@enzyme69 closing for now, but feel free to reopen if need be