Modify absolute Textures Path from USD file

Hi guys, quite new in the USD pipeline. We’re working on multiple workstations , and altough we’re working to uniform our work hierarchy. It does happen where shared USD files textures path aren’t the same between workstations.

I was wondering if there was a way in LOPs to Modify the absolute path of those textures to either, change it to the new one, or make it relative to the HIP file.

I’ve check the Modify Path node, USD Modify Path TOP node, but no success. I’m probably doing the wrong thing with those nodes.

Any idea on if that’s possible? I tried with ChatGPT and using Python, but no luck.

I can’t say what native tools in solaris there are for manipulating many attributes / paths so I would say that doing it in python is going to be the most flexible way to do this and then wrapping that in an subnet with some params.

If you are opening a stage you can probably just traverse the stage and find all shader prims with asset paths (or if you are using material interfaces with connections to the shaders then you can just modify the material prims). It should be fairly easy to just grab the stage from the python lop input and then create an editableLayer and set everything in one go with an Sdf.ChangeBlock.

Just noting that the ArDefaultResolver that ships with USD allows you to configure an ArResolverContext for your stage, which can hold a list of searchpaths for assets (including textures). So if there’s a known set of places where things may show up, and you can provide a ResolverContext for your stage in Solaris and other needed tools, then you may be able to authore “relative” paths that will resolve correctly on any workstation.

1 Like