PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.12k stars 1.22k forks source link

There is no object on USDZ file #2782

Closed michsiu closed 1 year ago

michsiu commented 1 year ago

Description of Issue

I successfully converted a .glb file to a usdz file, and it passed the ARKitChecker with the message: [Pass] C:/Users/download/3dtest/BabyElephant_GLB.usdz =====. However, upon opening the file, I encountered an issue where nothing is being displayed.

Steps to Reproduce

  1. download glb file
  2. run python script "2.py" to start convert
  3. get the result file and open it
  4. This is zip file for relative files including: 2.py, python convert script, please update gltfPath and usdPath to your local path before you run the script on your computer BabyElephant_GLB.glb, original glb file BabyElephant_GLB.usdz, result usdz file python glb convert.zip

System Information (OS, Hardware)

windows10

Package Versions

python 3.8

Build FlagsN/A

spiffmon commented 1 year ago

Hi @michsiu - I'm not sure whose software you're using to convert glb to USD, but Pixar doesn't provide any, and it seems like the issue must be there. Can you please report a bug to the appropriate software provider?

michsiu commented 1 year ago

Hello @spiffmon
Thanks for your reply, I have resolved the issue just now In fact, all my software used is pxr python lib and the convert tool I used is usdzconvert I spending a lot of time and energy in finding out the issue and I got it now on the process of jointWeights of usdStageWithGITF module, the author convert the weight information to 0, this is the original code newData = Vt.FloatArray(len(list(map(float, accessor.data)))) I have updated it to newData = list(map(float, accessor.data)) and it works now Although I don't know why the author do it in this way, in fact the same tool webui version works with the same script but now, I corrected it and it works

spiffmon commented 1 year ago

Ah, great to hear you found the problem! You might want to post an Issue with this information on the Apple devloper forums; I suspect @dgovil will be keenly interested!

dgovil commented 12 months ago

I suspect that you might have accidentally grabbed an older version of our conversion code? Out of curiosity did you get it from our official release or one of the unofficial mirrors that people have made online?

The version in the current official release (and dating back to ~2020) has this instead:

newData = Vt.FloatArray(list(map(float, accessor.data)))

Which is pretty much what you ended up with, minus the explicit wrapping in a VtArray.

michsiu commented 12 months ago

@dgovil Glad to received your reply I got the usdzconvert tool from https://github.com/tappi287/usdzconvert_windows/tree/master, and kindly ask if there is implicit usdzconvert tool OpenUSD like usdstitch, usdzip, usdcat...

Regarding to newData = Vt.FloatArray(list(map(float, accessor.data))), I'm not sure what happened, the result I got after running it is a lot of 0 without joint weight information and the usdz file did not show up the model when I open it on iPhone with QuickLook.

After updating it to newData = list(map(float, accessor.data)) (that is to say I removed Vt.FloatArray),I got the correct result of joint weight information and the model shows up

Thanks

michsiu commented 12 months ago

@dgovil I'm sorry, I read your code again and notice the difference, yes, you are right, the issue is that I should remove the len() method Thanks

dgovil commented 12 months ago

No worries! Thanks for the link to the fork as well. It does look like they're hosting a much older version of the scripts.

It might be worth copying them directly from the official distribution, though that would require a Mac to at least unpack it.