jordibares Posted December 16, 2013 Share Posted December 16, 2013 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 Quote Link to comment Share on other sites More sharing options...
ben Posted December 16, 2013 Share Posted December 16, 2013 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:/ syntaxlike : opdef:/Object/MyOtl?mytexture.tga Quote Link to comment Share on other sites More sharing options...
jordibares Posted December 17, 2013 Author Share Posted December 17, 2013 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:/ syntaxlike : opdef:/Object/MyOtl?mytexture.tga Quote Link to comment Share on other sites More sharing options...
animknight Posted December 18, 2013 Share Posted December 18, 2013 (edited) 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 December 18, 2013 by magicknight Quote Link to comment Share on other sites More sharing options...
jordibares Posted December 29, 2013 Author Share Posted December 29, 2013 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.