I'm working between my two workstations, and I was wondering if there was a way to modify each textures absolute paths from my imported USD file.
Say on computer 1 my textures are on D:/work/projectFile/HoudiniProject/Tex
And on my computer 2 my textures are on G:/work/HoudiniProject/Tex
Is there a way to find and replace those paths? I've tried the USD Modify Path TOP node, the Modify Path LOP node, all without any success.. I'm probably not doing the right thing, still new in USD and learning the pipeline.
I'm slowly working on making all my projects files having the same hierachy between my worksatsions, but in a case where it's not possible, it'd be great to have a workaround for that.
Thank you!
USD Modify Textures Path
411 3 1-
- Willbel2001
- Member
- 33 posts
- Joined: Feb. 2019
- Online
-
- ajz3d
- Member
- 633 posts
- Joined: Aug. 2014
- Offline
Willbel2001If on both computers your textures are in project's directory (D:/work/projectFile/HoudiniProject/Tex
G:/work/HoudiniProject/Tex
$HIP
or $JOB
), then you should be using relative paths to access them. This would save you from having to deal with the problem that you're currently experiencing.Regarding Modify Path LOP, see the attached example in which I changed path prefix from
/tmp/
to /dev/shm/
.
Edited by ajz3d - May 7, 2025 11:08:38
-
- stheo
- Member
- 19 posts
- Joined: July 2014
- Offline
-
- jparker
- Member
- 319 posts
- Joined:
- Offline
In a LOP network you can use an Attribute Wrangle node to replace strings in your texture paths.
Assuming you are using MaterialX image prims as your texture inputs, on the wrangle you can set your "Primitives" parm to:
and the VEX code like this:
Assuming you are using MaterialX image prims as your texture inputs, on the wrangle you can set your "Primitives" parm to:
%descendants(%type(Material), strict=false)
and the VEX code like this:
if (usd_isattrib(0, s@primpath, "inputs:file")) { string path = usd_attrib(0, s@primpath, "inputs:file"); path = replace(path, "D:/work/projectFile/HoudiniProject/Tex", "G:/work/HoudiniProject/Tex"); s@inputs:file = path; }
-
- Quick Links