Maya asset as relative path to library

   5522   2   1
User Avatar
Member
7 posts
Joined: Sept. 2014
Offline
We use perforce and want to store our assets in a perforce workspace for various reasons, and our workspaces are setup with a base name as the user for naming, so that means that my path to the otl would be “c:\jonas.borgman\perforce\houdiniassets\myAsset.otl”, and on my collegues machine to be “c:\other.user\perforce\houdiniassets\myAsset.otl”.
Is it possible to define libraries where to search for the asset so that we can use relative paths like “..\myAsset.otl” and specify the libraries on a per machine basis, rather than specifying the full path since that would break the asset for the next guy, when he tries to open the maya file?
User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
Maybe you could set HOUDINI_OTLSCAN_PATH to the asset directory. For example:
HOUDINI_OTLSCAN_PATH=c:\jonas.borgman\perforce\houdiniassets:&
The & in the end is for including Houdini's default search path.

All the OTLs from HOUDINI_OTLSCAN_PATH are read automatically. Then when the Maya plugin tries to instantiate an asset, those OTLs would be taken into account. The asset would be able to load even if the OTL path on the asset node itself is invalid. However, you'd get warnings like:
// Warning: Could not load OTL file: c:\jonas.borgman\perforce\houdiniassets\asset.hda
Attempting to instantiate asset anyway. //
// Warning: The file “c:\jonas.borgman\perforce\houdiniassets\asset.hda” could not load.
Function: HAPI_AssetLibrary::HAPI_AssetLibrary(const char*)
File: HAPI_AssetLibrary.C (39) //
// Warning: The asset: Object/asset
was instantiated from: c:\other.user\perforce\houdiniassets\asset.hda
but the expected path was: c:\jonas.borgman\perforce\houdiniassets\asset.hda //
The warning is just saying that the saved asset path points to one place, but the loaded one is from another place. You can ignore it in this case.
Andrew / アンドリュー
User Avatar
Member
7 posts
Joined: Sept. 2014
Offline
Ah, it works like a charm! thanks a bunch!
  • Quick Links