kcoley / gltf2usd

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

Valid glft file - results curious - would be grateful for any help #146

Closed BinaryChunk closed 5 years ago

BinaryChunk commented 5 years ago

Having success moving my animation assets from FBX to USDZ for use in iOS apps. Thanks for all your bright posts on the subject.

Pipeline: C4D > gltf2 > gltf2usd > Xcode > USDZ

This one little dino animation has me stumped. Seems to be a valid gltf2 asset. After conversion, it is not previewing correctly in finder OSX or iOS. Source Files are here - https://bit.ly/2WTIC2y

Shown with 100, 10, and 1cm Cubes on 200cm surface

screen shot 2019-02-13 at 1 32 25 pm

Successful previews when viewed from SketchFab's AR Viewer: img_1112 img_1110

kcoley commented 5 years ago

Hi @BinaryChunk. glTF defaults to units of meters. With initial testing, I found that usdz on iOS assumed centimeters. By default, a scale of 100 is applied to convert from meters to centimeters, but this can be overwritten by setting the --scale (or -s) command line flag.

Btw, previewing the glTF file in the Babylon.js sandbox (https://sandbox.babylonjs.com/) looks like this:

screen shot 2019-02-13 at 5 43 48 pm

Is this what you are expecting visually?

kcoley commented 5 years ago

Btw, you can also directly export to usdz from gltf2usd if that helps your workflow :)

BinaryChunk commented 5 years ago

Thanks Kacey

Yes gltf file is fine - it the conversion I am referring to - would be grateful if you would try and convert it using gltf2usd and see if you get similar results. - thanks

Source Files are here - https://bit.ly/2WTIC2y

img_1106

kcoley commented 5 years ago

@BinaryChunk I just tried this, and looks like it may be a bug in iOS. It displays properly within XCode and Preview on Mac OS:

screen shot 2019-02-14 at 10 41 40 pm screen shot 2019-02-14 at 10 42 58 pm

I believe @wave-electron came up with a workaround for this scenario: https://github.com/kcoley/gltf2usd/issues/49#issuecomment-422679613

Does this help?

BinaryChunk commented 5 years ago

@kcoley Thanks! I will rework animation per @wave-electron comments - grateful for your help!

kcoley commented 5 years ago

@BinaryChunk no problem!