Let's discuss USDZ Converter in details...

I found that there is still lacking of documentation of "USDZ Converter", so I might start some kind of thread talking about this. So far I found developer 'Ash' out there has been really helpful 😎 and we are still discovering USDZ feature, gotchas and limitations along the way. There is this USD Interest group at Google Groups that is more specifically talk about USD.


A bit of information about me:

I am an independent developer, mostly using Blender 3D and XCode only. I have not touched Unity or Unreal. I have old Maya and Houdini, but installing USD plugins seems like not trivial. I did manage to have some USD tools on my Mac, but it is not optimal since I do not have NVidia graphic cards. However, USDZ Converter and the intermediate USDA file generated is pretty helpful.


A couple of interesting things:

  • Make sure your 3D mesh has UV layout, without UV the PBR will simply display black on iOS devices, although it might shows okey on MacOS when using 3D or AR Quick Look.
  • USDZ makes PBR materials and shaders linking quite easy
  • When mesh is too complex or USDZ is too big, or animation has too many objects, USDZ will not display on iOS device. Might work ok on the MacOS. There is no warning about RAM exceeding iOS.
  • Watch out for Mapping, do not use 8K image texture for now.
  • Animation seems to be supported via Alembic export, works for Transform only. No vertex, no bones, no blendshapes yet.
  • USDZ can be easily imported into XCode for 3D SceneKit. I tested it using basic AR app.
  • There is this ModelIO inside XCode that can be used to unpack USDZ, it seems, but I have not gone that far.
  • Procedural animation can be embeded into USDZ, check USD example of Spinning Top animation. It's pretty cool for turntable.


I am currently investigating:

- Materials that is not PBR, but able to display color, is this possible? Because often time I just need Material with simple Color

- Can we have Lights inside USDZ?

Answered by DTS Engineer in 364982022

The usdz Tools found at https://developer.apple.com/augmented-reality/quick-look/, currently support .obj and .gltf

Also I am wondering whether we can:

- Make Double Sided per Mesh

- Make Subdivision per mesh

- Combining USDZ via USDA

First of all, to use "USDZ Converter" ensure you have latest XCode 10, and Command Line Tools installed so you can run this inside Terminal:


xcrun usdz_converter <obj, alembic, usda you want to convert> <usdz file>


USAGE:

<inFilePath> <outFilePath> [options...]

Options:

-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

-specularColor r g b Floating point values 0.0 ... 1.0

-useSpecularWorkflow i 0 for false, non-zero for true

-color_map filePath

-normal_map filePath

-emissive_map filePath

-metallic_map filePath

-roughness_map filePath

-ao_map filePath

-color_default r g b a Floating point values 0.0 ... 1.0

-normal_default r g b a

-emissive_default r g b a

-metallic_default r g b a

-roughness_default r g b a

-ao_default r g b a


(*) Specify infield only with -v (Verbose) to display group information.

(*) '#' in the first character position of a line in a command file interprets the line as a comment.

usdz_converter has interesting feature like:

-f filePath Read commands from a file.


I am new to this hypen tagging command and using it to "override" Materials and assigning Shader Maps. But really handy after all.


We can apparently supply multi lines commands like this (I am using Sublime Text), we don't even need to worry about using forward slash to separate lines. This is cleaner and easier to work with.


PBR Shader Map texture can have "Alpha" I tested it works.


But not sure how to enable "Double Sided". Also I wonder what these below is for because they do not have effect: (all this color_default, normal_default, emissive_default, etc)


I am using XCode 10 Beta 5 and waiting for Beta 6.

Thanks, nice info, Im following this thread.

Some more stuff from Stackoverflow in case its needed.

https://stackoverflow.com/questions/51009105/how-to-create-a-usdz-animation#_=_

Hi guys, I'm struggling to get the converter working. Whenever I start to convert for example an obj file, the converter tells me that it succeeded. But actually the created usdz file is not showing up, what am I missing?

Has the converter changed in Xcode 10? I can't add textures anymore. It says the converter is now version 1.008.


xcrun usdz_converter obj_path usdz_path -g Mesh -color_map texture_path -roughness_map roughness_path

Hi Yojimbo,

We are having an issue with a USDZ file displaying on older devices. You can view the file here: https://www.noplacelike.co. It's the "Michael Murphy" sofa. It's 33k poly with 2k textures yet still doesn't display on older devices. It was made using Maya and substance painter.

Does anyone know why this will not work?

Thanks,

Allen

Great to find some discussion on USDZ!


I've found AR Quicklook to be fantastic, I've been testing it out in Safari using the rel="ar" command.


It feels a bit unstable still... about 5% of the time it won't load the object and displays this message "Preview Universal Scene Description (Mobile)". If you cancel out and reload, works fine. Have tried with different complexities, doesn't seem to make much difference. At first I thought maybe the webserver was causing issues, but have replicated this using local files on the device.


Anyone else had this issue? I'd be keen to know if it is something I can fix.


Other bits of information I've discovered through testing that people might find interesting:


  • AR Quicklook has a draw distance, so if you move an object too far away or make it huge, it will clip.
  • It also automatically 'grounds' the object, so if you want something to float, you need to add a small object below to hack this feature.

Wixted, could you post more specifics of the problem you're having? (And/or file a bug)

Which devices? Which OS version? What happens?

FWIW, the Michael Murphy sofa loaded ok for me on an iPhone 7 with iOS 12.

Wondering about Multi UV support, this is the main issue for me currently with USDZ, I have a SCN pipeline now with an OSX tool I created that allows for 8 UV Maps per mesh.... for realtime optimal assets this is essential, wondered if you had attempted it yet?

Hi Guys,

USDZ format supported by apple is really cool. For quicklook we need to provide only the file and the work is done. I got success in showing the model with animation in usdz format. Only the greatest drawback that is the size of the file is too heavy. Could some one help me in reducing the size of the usdz file. as the fbx or dae file format size is too small (i.e in 2-3 MB) while the usdz file is (60-100 MB).

Please help me bagoria2011@gmail.com.

Hey Yojimbno,


I was wondering if you could shed more light on the results regarding using materials other than the standard PBR one.

I only have an ambient texture (applied through the -color_map command), but once converted to USDZ, all objects look way too dark.


You mentioned you use the -f feature to access a file and "override" the materials.

Maybe that solved the issue for you, but I could not find any information on this anywhere..


Best regards,


André

I`m trying to set the materials through -m <nameOfTheColor> <path> but is not working , my line of code is like this

xcrun usdz_converter /Users/mac013dw/Desktop/*****\ cor/export/testeobj.obj /Users/mac013dw/Desktop/*****\ cor/export/testeobjtestecor.usdz -v -m /testeobj/Materials/Jeep_Cor_229_31_31_0 -color_map /Users/mac013dw/Desktop/*****\ cor/export/vermelho.jpg -m /testeobj/Materials/Jeep_Cor_221_124_15_0 -color_map /Users/mac013dw/Desktop/*****\ cor/export/verde.jpg -m /testeobj/Materials/Jeep_Cor_115_148_64_0 -color_map /Users/mac013dw/Desktop/*****\ cor/export/laranja.jpg


can someone help me with that?

Something that I found out : using that code i posted above, when I preview the usdz file in the PC it appear without the colors I assigned to each material, but on the iphone it shows correctly.

Let's discuss USDZ Converter in details...
 
 
Q