TimvanScherpenzeel / gltf-to-usdz-research

Research and proof of concept of converting glTF to USDZ for AR Quick Look (iOS 12+).
MIT License
188 stars 18 forks source link

Tips on converting GLTF + BIN + Textures? #4

Closed enzyme69 closed 5 years ago

enzyme69 commented 5 years ago

I am testing some GLTF model from Sketchfab, so far I have no luck...

For example: https://sketchfab.com/models/1a9db900738d44298b0bc59f68123393

The Skull model has GLTF file + BIN + textures.

When converting, I can't seem to get the proper result, the USDA and USDZ generated has no mesh...

192-168-1-4:gltf-to-usdz-master jimmygunawan$ node ./bin/gltf-to-usdz.js -i ./assets/skull/scene.gltf -o ./assets/skull.usda -s 10.0 && xcrun usdz_converter ./assets/skull.usda ./assets/skull-`date +"%H-%M-%S"`.usdz
componentType is unknown
Written file to ./assets/scene_baseColorTexture.jpg
Written file to ./assets/scene_normalTexture.jpg
Written file to ./assets/skull.usda
Written file to ./assets/scene.obj
usd_converter converting file: ./assets/skull.usda
converted usdz file: ./assets/skull-22-55-38.usdz
Warning (secondary thread): in UsdObjTranslateObjToUsd at line 235 of /BuildRoot/Library/Caches/com.apple.xbs/Sources/3DAssetTools/3DAssetTools-14207.5/external/ModelKit/extern/usd/pxr/usd/usdObj/translator.cpp -- No valid groups were found, no mesh translation will occur.
Warning: in _ReportErrors at line 2601 of /BuildRoot/Library/Caches/com.apple.xbs/Sources/3DAssetTools/3DAssetTools-14207.5/external/ModelKit/extern/usd/pxr/usd/usd/stage.cpp -- Instantiating stage:
    Unresolved  path </model> on prim @assets/skull.usda@,@anon:0x7fbcb744b0f0:skull-session.usda@</Mesh_0>.

Warning: in UsdObjTranslateObjToUsd at line 235 of /Library/Caches/com.apple.xbs/Sources/ModelKit/ModelKit-1.94.23/ModelKit/extern/usd/pxr/usd/usdObj/translator.cpp -- No valid groups were found, no mesh translation will occur.
Warning: in _ReportErrors at line 2601 of /Library/Caches/com.apple.xbs/Sources/ModelKit/ModelKit-1.94.23/ModelKit/extern/usd/pxr/usd/usd/stage.cpp -- Instantiating stage:
    Unresolved  path </model> on prim @/Users/jimmygunawan/gltf-to-usdz-master/assets/skull_$$usd_converter$$_.usdc@,@anon:0x7fbcb8b4d4b0:skull_$$usd_converter$$_-session.usda@</Mesh_0>.
enzyme69 commented 5 years ago

The OBJ extracted seems invalid:

screen shot 2018-08-16 at 11 14 46 pm

So... I imported the OBJ, manually renaming the USDA and getting the correct result.

Wondering what have changed...

enzyme69 commented 5 years ago

Error: Component Type is Unknown.

enzyme69 commented 5 years ago

My feeling saying that: GLTF auto converted inside Sketchfab is all different. There seems to be no proper standard...

TimvanScherpenzeel commented 5 years ago

Did you solve your problem in the end?

TimvanScherpenzeel commented 5 years ago

Closing this due to a lack of a response.