I'm packaging up some files for remote render, and moving all of my USD references and textures to $HIP/USD and $HIP/USD/textures
But because I'm moving the locations, the USD files reference just fine, but the textures are all still linking back to their absolute paths.
My solution so far is to use the editmaterial lop. This is very manual and tedious, although it works. When, like I have, a scene with hundreds of references loaded from several local network locations, this will take me a long time to sort out via the manual method.
I have some ideas, but bear in mind I'm largely an idiot that knows enough Houdini to be a pain in the ass to actual power users.
So in the reference LOP there is an inputs:file parameter that contains the file path.
In this case, it is formatted like this:
@../../wrong_texture_directory/4k/basecolor.png
Is there a way to localize this on load?
Were I a python wizard I'd whip up something to go in the reference hda that does something along the lines of
filename = "whatever/python/uses/to/strip/out/everything/before/the/finalname.png"
texturePath="../correct_texture_path/4k/"
inputs:file = @texturePath+filename
I am useless with python unfortunately.
Can I edit the mtl.usdc file? I've opened one in a text editor and it looks like compiled code that I have no idea what to do with and / or business trying to mess with.
Localizing reference textures... there has to be a better way
1103 4 2- evanmathis
- Member
- 24 posts
- Joined: 10月 2018
- Offline
- Htogrom
- Member
- 31 posts
- Joined: 6月 2010
- Offline
evanmathis
I'm packaging up some files for remote render, and moving all of my USD references and textures to $HIP/USD and $HIP/USD/textures
But because I'm moving the locations, the USD files reference just fine, but the textures are all still linking back to their absolute paths.
My solution so far is to use the editmaterial lop. This is very manual and tedious, although it works. When, like I have, a scene with hundreds of references loaded from several local network locations, this will take me a long time to sort out via the manual method.
I have some ideas, but bear in mind I'm largely an idiot that knows enough Houdini to be a pain in the ass to actual power users.
So in the reference LOP there is an inputs:file parameter that contains the file path.
In this case, it is formatted like this:
@../../wrong_texture_directory/4k/basecolor.png
Is there a way to localize this on load?
Were I a python wizard I'd whip up something to go in the reference hda that does something along the lines of
filename = "whatever/python/uses/to/strip/out/everything/before/the/finalname.png"
texturePath="../correct_texture_path/4k/"
inputs:file = @texturePath+filename
I am useless with python unfortunately.
Can I edit the mtl.usdc file? I've opened one in a text editor and it looks like compiled code that I have no idea what to do with and / or business trying to mess with.
Which houdini version are you using?
Think in 20, on component output node it has option to copy textures to folder relative to the asset.
- evanmathis
- Member
- 24 posts
- Joined: 10月 2018
- Offline
- evanmathis
- Member
- 24 posts
- Joined: 10月 2018
- Offline
Hm. component output isn't working as well as I'd hoped.
But, there is a "modify paths" lop [www.sidefx.com]
It even has * almost * the solution i'm looking for on the manual page:
Change all UsdVolFieldAsset file paths to point inside a volumes subdirectory
And while I can make sense of what that does, I have no clue how to adapt it to my purposes.
But, there is a "modify paths" lop [www.sidefx.com]
It even has * almost * the solution i'm looking for on the manual page:
Change all UsdVolFieldAsset file paths to point inside a volumes subdirectory
if attributepath.endswith('.filePath'): parts = assetpath.split('/') return '/'.join(parts[0:-1]) + '/volumes/' + parts[-1] return None
And while I can make sense of what that does, I have no clue how to adapt it to my purposes.
- goldleaf
- スタッフ
- 4200 posts
- Joined: 9月 2007
- Offline
There is an Output Processor on the USD ROP, labeled "Copy All Assets to Referencing Layer Directory". It copies any non-USD paths (such as texture maps) so they are localized and portable with the USD output. This is what Component Output uses.
Modify Paths doesn't touch the files on disk, it just changes the data in USD to look for the files in a different location.
So the "Copy All Assets to Referencing Layer Directory" output processor should help you out. It would copy the files into the same location as your USD being exported, and updates the attributes so they point to the new location.
Modify Paths doesn't touch the files on disk, it just changes the data in USD to look for the files in a different location.
So the "Copy All Assets to Referencing Layer Directory" output processor should help you out. It would copy the files into the same location as your USD being exported, and updates the attributes so they point to the new location.
I'm o.d.d.
-
- Quick Links