kcoley / gltf2usd

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

A simple turn table animation does not work #50

Closed enzyme69 closed 5 years ago

enzyme69 commented 6 years ago

I am animating an object in Z-axis from 0 to 360 ° with 2 linear keyframe in Blender for 100 frames, exporting as GLTF, and I am not getting animation somewhat. Quite strange.

If I made keyframe so that the animation goes from 0 to 355 ° it seems to work (as GLTF, using online GLTF viewer) but very slow, and seems to be trimmed and --fps does not make any different.

The resulting USDZ does not spin either... :(

USDZ_icopoke.zip

kcoley commented 6 years ago

@enzyme69 ah, this looks like a bug on iOS in that it does not understand quaternion rotations. I tweaked your USD file to use Euler rotation angles instead. The catch is that every frame has to be "baked" because USD linearly interpolates the rotation which causes distortions in the mesh.

icopoke.usda.txt

I can report this to the Apple bug reporting tool, but in the meantime, file an issue to convert quaternion node animations to baked Euler rotations to support iOS.

kcoley commented 5 years ago

Should work with the "--use-euler-rotation" flag now: https://github.com/kcoley/gltf2usd/issues/52

enzyme69 commented 5 years ago

@kcoley Yes it works! Finally confirmed. Thanks for quaternion rotation thing.