What's the best way to make USD references cross-platform?
I know 1 option is to just use relative paths, but if the reference is a very different path, you end up with a ton of "../" in the reference path. And if you are referencing across different drives on Windows, relative paths don't work.
There is also the Asset Resolver option, but this seems very complicated for basic string manipulations. This requires you to write C++ and compile with USD. I hate to say it, but I'm just not technical enough to pull this off.
Cross-platform reference paths
2081 4 3- erikcarlson
- Member
- 19 posts
- Joined: Dec. 2015
- Offline
- simon_o
- Member
- 112 posts
- Joined: Oct. 2011
- Offline
maybe search paths are an option:
you can define multiple paths in the PXR_AR_DEFAULT_SEARCH_PATH environment variable (needs to be set before launching houdini)
this could look like this
windows: C:/myassets;D:/myotherassets;E:/myshots
linux: /drive/myassets:/anotherdrive/myotherassets:/someotherdrive/myshots
when referencing the files in houdini you could link to a C:/myasset/treeA/treeA.usd by just using the searchpath: treeA/treeA.usd
which, if the PXR_AR_DEFAULT_SEARCH_PATH is set correctly should work on windows and linux
you can define multiple paths in the PXR_AR_DEFAULT_SEARCH_PATH environment variable (needs to be set before launching houdini)
this could look like this
windows: C:/myassets;D:/myotherassets;E:/myshots
linux: /drive/myassets:/anotherdrive/myotherassets:/someotherdrive/myshots
when referencing the files in houdini you could link to a C:/myasset/treeA/treeA.usd by just using the searchpath: treeA/treeA.usd
which, if the PXR_AR_DEFAULT_SEARCH_PATH is set correctly should work on windows and linux
Pipeline @ RISE Visual Effects Studios
- erikcarlson
- Member
- 19 posts
- Joined: Dec. 2015
- Offline
- mestela
- Member
- 1716 posts
- Joined: May 2006
- Offline
Or maybe this asset resolver from Rodeo? Never used it myself, but sounds like it could be handy for simple path mods:
https://github.com/rodeofx/rdo_replace_resolver [github.com]
https://github.com/rodeofx/rdo_replace_resolver [github.com]
- AhmedHindy
- Member
- 128 posts
- Joined: Oct. 2020
- Offline
-
- Quick Links