Jump to content

OTL best practice


Recommended Posts

I have been working on an OTL that is intended for company wide usage and requires multiple textures and geometry to function. Of course I would like to keep it tidy and hence my doubts on how to best approach it. 

Should I install the content in the same folder than the OTL? and if so what would be the best way to refer to it from within the OTL? I am using an environment variable now but I reel getting the OTL location could be a better option… 

Is this a matter of scripting it in the otl or there is a method associated? 

 

My ideal scenario would be to write expressions referencing the material like this

 

$THIS_OTL_PATH/maps/mytexture.jpg

thx

Link to comment
Share on other sites

I guess is an option but this otl contains a few HDR files, lots of 4K textures and quite a bit of geometry (not that heavy but…)

 

So I was thinking it would be wise to keep it separated, the textures are very unlikely to change, the otl is very likely to be upgraded on every job so I though it would be interesting to keep them separated.

 

Will certainly keep in mind, I think it may be a good approach against the env variable overload.

 

thx

 

Why don't you embed your files directly in the otl ?
To add your files :
Edit operator type properties -> extra files

Then refer to file with a opdef:/ syntax
like : opdef:/Object/MyOtl?mytexture.tga

Link to comment
Share on other sites

If you want to reference your otl path in your material, you could do something like this

 

change your expression language to Python and paste the following code in your parameter

 

import os 
otlPath = os.path.dirname(hou.pwd().type().definition().libraryFilePath())
fullPath = os.path.join(otlPath, 'maps', 'myTexture.jpg')
return fullPath

 

Hope this helps :)

 

 

Cheers

-J

Edited by magicknight
Link to comment
Share on other sites

  • 2 weeks later...

Thanks so much, quite close to what I was after…

 

If you want to reference your otl path in your material, you could do something like this

 

change your expression language to Python and paste the following code in your parameter

 

import os 
otlPath = os.path.dirname(hou.pwd().type().definition().libraryFilePath())
fullPath = os.path.join(otlPath, 'maps', 'myTexture.jpg')
return fullPath

 

Hope this helps :)

 

 

Cheers

-J

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...