gltf2usd icon indicating copy to clipboard operation
gltf2usd copied to clipboard

Bug in some animation models

Open kcoley opened this issue 5 years ago • 9 comments

Some models do not export and animate as expected. Here are two samples: https://sketchfab.com/models/710bbaccf8a442ea9b900354361f6d5a

https://sketchfab.com/models/8d06874aac5246c59edb4adbe3606e0e

kcoley avatar Sep 04 '18 04:09 kcoley

@kcoley what is interesting about the first model https://sketchfab.com/models/710bbaccf8a442ea9b900354361f6d5a

Its actually animating correctly in xcode beta 6. I've attached a mov file showing the animation working (unzip to run) spiderman_animation_xcode10_beta6.zip

Attached is the resulting usdz (non-animating t-pose). spiderman.usdz.zip

It may be a bug with an Apple usdz displaying in Safari?

wave-electron avatar Sep 04 '18 05:09 wave-electron

@wave-electron that is interesting. Based on some of the weird distortions on certain frames, this leads me to believe it is because some key frame animation data may be missing. I'll check the logic there. Thanks for the reference!

kcoley avatar Sep 04 '18 05:09 kcoley

I just had a look at the animation again in xcode. I also noticed some flashing black disortions on the keyframes. Maybe it is that!

wave-electron avatar Sep 04 '18 06:09 wave-electron

@kcoley

Did you notice this comment by Spiff today in the usd-interest group?

Spiff - From a strictly USD perspective, there are no layering problems. However, (and I know ModelIO doesn't currently care, but we hope it will in the future) there is a problem with your construct. Valid skeletal animation and geometry must be located under a "SkelRoot" prim. So, in your file, either /root/node0 or /root/node0/node2 should be a "SkelRoot" prim rather than "Xform". Also, we try to put the skel:animationSource and skel:skeleton bindings on the SkelRoot, when possible.

I've noticed we use Xform rather than SkelRoot in the bone animations I've been building.

UsdSkel

wave-electron avatar Sep 05 '18 09:09 wave-electron

Spiff comments were in respect to this 01.usda file inside this CesiumMan.zip..... 01.usda animates in xcode10 beta 6, but only previews with no animation in IOS 12 beta 12.

CesiumMan.zip

wave-electron avatar Sep 05 '18 10:09 wave-electron

@kcoley what is interesting about the first model https://sketchfab.com/models/710bbaccf8a442ea9b900354361f6d5a

Its actually animating correctly in xcode beta 6. I've attached a mov file showing the animation working (unzip to run) spiderman_animation_xcode10_beta6.zip

@ox @kcoley The problem with the spiderman not animating in IOS 12 was fixed by ensuring the first jointname is by itself and not part of the jointname path as suggested in closed issue 22. However, the animation of spiderman jumping is not scaling correctly in IOS 12.

Sample usda and usdz of spiderman at least working in IOS12 now! spiderman_working.usdz.zip

wave-electron avatar Sep 05 '18 22:09 wave-electron

@wave-electron thanks for the note on the SkelRoot. I can look into that. Also cool that the model at least works on iOS! Looking at the usda file, I see the problem with the popping animation due to some missing values for some of the joints at certain frames. I thought I had resolved this, but I must have missed some cases. I'll work on fixing that.

kcoley avatar Sep 06 '18 02:09 kcoley

ahh interesting. I create a SkelRoot with a Skeleton + SkelAnimation inside it in #36. However I have a feeling that my changes to support blend shapes will probably break normal rigging animations. Do you have any models that have blendshapes + animations?

ox avatar Sep 06 '18 16:09 ox

After several hours of trying today. I built up my own bone animation from scratch using a 3dwarehouse model of hand

I built the joint structure & created different poses in Cheetah 3D. Then exported as Collada Model. I imported into Blender in order to use the GLTF 2 exporter. After using the gltf2GLTF command tool , I edited the usda file fixing the Joint name manually to overcome that bug relating to #22. The result is the model in my gallery at fusionar.app. Finally found a way to create these bone animations from scratch!

wave-electron avatar Sep 07 '18 04:09 wave-electron