Additional Export/Render Locations as Houdini Variables
Quote from joshuazt on 22. February 2021, 2:01Hi Richard
Amazing work on Prism, my studio is beginning to shift towards using it and I am working out how to set it up this week. I do not have a whole lot of experience setting up pipelines. I was wondering if there way a way of getting the Additional Export/Rendering Location we set in the 'Prism Project Settings' into Houdini as a variable?
Thanks for your time
JoshT
Hi Richard
Amazing work on Prism, my studio is beginning to shift towards using it and I am working out how to set it up this week. I do not have a whole lot of experience setting up pipelines. I was wondering if there way a way of getting the Additional Export/Rendering Location we set in the 'Prism Project Settings' into Houdini as a variable?
Thanks for your time
JoshT
Quote from RichardF on 22. February 2021, 13:37Hey Josh,
happy to hear that you are starting to use Prism. It shouldn't be too complicated to set it up in your studio, but just ask in case of any problems.
To create the location variables I would create a new custom Prism plugin in the Prism Settings. In the onProjectChanged function you can use this to get all export locations:
self.core.paths.getExportProductBasePaths()
Using the Houdini python API you can create Houdini variables for each of these paths.
Cheers,
Richard
Hey Josh,
happy to hear that you are starting to use Prism. It shouldn't be too complicated to set it up in your studio, but just ask in case of any problems.
To create the location variables I would create a new custom Prism plugin in the Prism Settings. In the onProjectChanged function you can use this to get all export locations:
self.core.paths.getExportProductBasePaths()
Using the Houdini python API you can create Houdini variables for each of these paths.
Cheers,
Richard
Quote from joshuazt on 23. February 2021, 6:25Hi Richard
Thanks for the help. I am having some issues getting it working, I think I am messing up some syntax on Linux. If its not to much trouble would you be able to give me a example of how to get it into the Houdini API.
thanks
Josh
Hi Richard
Thanks for the help. I am having some issues getting it working, I think I am messing up some syntax on Linux. If its not to much trouble would you be able to give me a example of how to get it into the Houdini API.
thanks
Josh
Quote from RichardF on 23. February 2021, 11:59You have to use two hscript commands: setvar and varchange. You can take a look at how Prism sets some variables in Houdini:
https://github.com/RichardFrangenberg/Prism/blob/f9e16818075b234f69ce8dec934b70b511ddb905/Prism/Plugins/Apps/Houdini/Scripts/Prism_Houdini_Functions.py#L161
You have to use two hscript commands: setvar and varchange. You can take a look at how Prism sets some variables in Houdini:
Quote from joshuazt on 24. February 2021, 7:38Got it working!
Thanks for your patience Richard, this was my first time playing with Python! haha
My probably pretty janky solution if anyone has a similar issue:
ExportPaths = self.core.paths.getExportProductBasePaths()
HCACHE = ExportPaths.items()[1]
HCACHE_Path = HCACHE[1]
HCACHE_String = str(HCACHE_Path)hou.hscript("setenv HCACHE=" + HCACHE_String)
hou.hscript("varchange HCACHE")
Got it working!
Thanks for your patience Richard, this was my first time playing with Python! haha
My probably pretty janky solution if anyone has a similar issue:
ExportPaths = self.core.paths.getExportProductBasePaths()
HCACHE = ExportPaths.items()[1]
HCACHE_Path = HCACHE[1]
HCACHE_String = str(HCACHE_Path)
hou.hscript("setenv HCACHE=" + HCACHE_String)
hou.hscript("varchange HCACHE")