Caching sequences on Maya

   814   1   0
User Avatar
2 posts
Joined: Feb. 2017
Hi everyone.

I am finishing working on a HDA for Maya that I am going to be using multiple times, I have a cache node that creates a single rest position but it is being replaced every time I use it. The directory file goes like this: “$HIP/geo/$” Where $HIP is the folder where the hda is being saved.

Is there a variable that lets access the folder where my Maya project is? So that every time I work on a diferent project it creates its own cache ?

Thank you all in advance for your help!
User Avatar
146 posts
Joined: Oct. 2017
Maya doesn't have specific environment variable for that, nor does houdini have maya specific envvars. You can use the workspace command to get the current project and construct your cache path. You can use the workspace command to query project information, set up file rules, etc.

string $cacheDir = `workspace -fn` + “/cache/houdiniCache”
// Result: /home/juliap/maya/projects/default/cache/houdiniCache //

Then you could set a new environment variable that you could access in your hda - as long as you autostart engine out of Maya it will inherit Maya's environment.

Although if you're going to do that you could just export a parm for the project path or construct the cache directory path and pass that in directly. Then you aren't limited to using autostart either.
  • Quick Links