SOS help needed USD geometry update

   523   4   1
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
Heya

I need help SOS from you guys.

I need to process a number of USDZ files (scan data and textures)
I need to update the geometry in USDZ, like scale, orient and transform.
I need to save back (or create) a new USDZ file.
However, when in Houdini I couldn`t update the original USDZ, I created a new one. But all material texture file references from the USDZ are still referring to the same USDZ, and the new USDZ contains the original USDZ file also.
I managed to create a baker from USDZ, and it would work with the original USDZ, but apparently the multiple nesting doesn't work.

So what I need to solve is to update the geometry in the original USDZ file...

Could you help me?

Thanks in advance!
User Avatar
Member
273 posts
Joined: Nov. 2013
Offline
Lops doesn't really let you modify input files as you would only be able to cook the lop network a single time. You probably want to sublayer the root layer of the original usdz file and add your transform data in a new (stronger) layer that would become the new root layer.

Because usdz files are just regular zip files I think I'd be inclined to unzip, add a new root layer as described above and then create a new archive. Reading the usdzip documentation [openusd.org] it seems that usdzip --asset <your_layer> should take care of copying any referenced files (including png, jpeg and exr texture files) into the archive and update all occurrences or the corresponding asset paths. Kind of all theory though as I don't have an any experience with usdz!
Edited by antc - March 3, 2024 18:47:57
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
It's soooooo hard...

My next attempt was to overwrite the material texture inputs:file attribute, but no filepath was accepted, there was always the Cannot be resolved message...

I'm getting really really tired of this...

How can I set a relative filepath in a wrangle?
User Avatar
Member
273 posts
Joined: Nov. 2013
Offline
szmatefy
How can I set a relative filepath in a wrangle?
this works for me.

s@inputs:file = "some/relative/path/texture.png";

Note that the path is relative to the layer, not the current working directory.

I downloaded this model [developer.apple.com] and after unzipping, the relative texture paths were correct and needed no adjustment. Maybe try that model and see if it works for you. It seems that usdzip always packs dependent assets into a directory named '0', and the root layer is in that directly as well. Therefore a relative path like '0/texture.png' should resolve ok.
Edited by antc - March 4, 2024 21:52:03
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
Ok, só after sleepless nights I solved the issue.

I had accented characters in the folder name. As I process scan data of persons and being Hungarian, accents are frequent.
Karma and Solaris handled them well, but in baking, mantra threw a tantrum.
  • Quick Links