USDZ File Not Loading on iPhone 7

1.4k Views Asked by At

Our USDZ file won't load on iPhone 7 with iOS 12. It works fine on my iPhone X and iPad Pro, both running iOS 12 Beta.

We've tried creating this using the terminal commands and get the following warning although we don't believe this is the issue.

Warning: in CreateMaterialBindings at line 59 of /BuildRoot/Library/Caches/com.apple.xbs/Sources/3DAssetTools/3DAssetTools-14207.2/external/ModelKit/extern/usd/pxr/usd/usdObj/translator.cpp -- OBJ mtl usemtl name has invalid name '15___Default', using default usemtl name: 'defaultShadeGroup0' 

The screen on the iPhone 7 looks as such:

enter image description here

You can download the raw files here.

1

There are 1 best solutions below

0
On

You can't see your 3D model because you're using very bad naming convention for file model2_$$usd_converter$$_.usdc inside usdz container. In macOS and iOS you have to avoid using $ in file names, because dollar sign is a special character.

Follow these two steps to unzip, rename and rezip your usdz file.

First Step (unzip mmtest.usdz file)

To unzip a usdz file in macOS Mojave use the following method:

  • In Finder change the extension of .usdz file to .zip.
  • Uncompress .zip file using Archive_Utility.app or RAR_Extractor.app.
  • Open unzipped directory and change files' names.
  • Make sure all textures are in JPG and/or PNG format.
  • Make sure 3D normals of your USDC model ain't inverted.

enter image description here

enter image description here

enter image description here

Second Step (recreate usdz again)

Make sure that Xcode 10.2 is installed.

To convert a content of unzipped folder (binary usdc file and its textures) to usdz file format again, use the following command in Terminal.app:

cd ~/Desktop/mmtest/


xcrun usdz_converter Model.usdc Model.usdz 
-g SofaMesh
-color_map Diffuse.jpg
-roughness_map Roughness.png
-normal_map Normal.jpg

And here are a full list of options (type xcrun usdz_converter -h in Terminal):

-g groupName [groupNames ...]        Apply subsequent material properties to the named group(s).
-m materialName [materialNames ...]  Apply subsequent material properties to the named material(s).
-h                                   Display help.
-a                                   Generate a .usda intermediate file.  Default is .usdc.
-l                                   Leave the intermediate .usd file in the source folder.
-v                                   Verbose output.
-f                    filePath       Read commands from a file.
-texCoordSet          set            The name of the texturemap coordinate set to use if multiple exist (no quotes).
-opacity              o              Floating point value 0.0...1.0

-color_default        r g b a        Floating point values 0.0...1.0
-normal_default       r g b a        Floating point values 0.0...1.0
-emissive_default     r g b a        Floating point values 0.0...1.0
-metallic_default     r g b a        Floating point values 0.0...1.0
-roughness_default    r g b a        Floating point values 0.0...1.0
-ao_default           r g b a        Floating point values 0.0...1.0

-color_map            filePath
-normal_map           filePath
-emissive_map         filePath
-metallic_map         filePath
-roughness_map        filePath
-ao_map               filePath

Now model works perfectly.

enter image description here