Quick way to switch to OCIO?

   1842   5   2
User Avatar
Member
447 posts
Joined: 4月 2018
Offline
Is there a way to enable/disable OCIO from within Houdini without editing houdini.env and restarting the app? Nuke and Maya let you just turn it on and off at will.

UPDATE: Figured it out. Used hou.setenv and hou.unsetenv to create shelf tools to load and unload OCIO. Easy!
Edited by BrianHanke - 2021年1月8日 19:42:12
Subscribe to my Patreon for the best CG tips, tricks and tutorials! https://patreon.com/bhgc [patreon.com]

Twitter: https://twitter.com/brianhanke [twitter.com]
Behance: https://www.behance.net/brianhanke/projects [www.behance.net]
User Avatar
Member
8041 posts
Joined: 9月 2011
Offline
Can you just disable it in the viewer you need it disabled for with the color correction bar?
User Avatar
Member
447 posts
Joined: 4月 2018
Offline
jsmack
Can you just disable it in the viewer you need it disabled for with the color correction bar?

Yeah, but it still leaves the 75,000 menu items related to OCIO in any plugins and viewers. At least my quasi-solution removes them from viewers. Sadly, any loaded plugins will behave as if OCIO is still active. In Maya if you untick color management it removes all OCIO stuff from Arnold menus, etc.
Subscribe to my Patreon for the best CG tips, tricks and tutorials! https://patreon.com/bhgc [patreon.com]

Twitter: https://twitter.com/brianhanke [twitter.com]
Behance: https://www.behance.net/brianhanke/projects [www.behance.net]
User Avatar
Member
1 posts
Joined: 10月 2018
Online
BrianHanke
UPDATE: Figured it out. Used hou.setenv and hou.unsetenv to create shelf tools to load and unload OCIO. Easy!

Came across this post while using both Redshift and Karma XPU. I am interested in switching between Redshift's and Houdini's OCIO configurations without having to restart Houdini. Would you be willing to share a script for loading and unloading OCIO? 🙏
User Avatar
Member
447 posts
Joined: 4月 2018
Offline
Oh man, I don't even remember making this post. You could create a shelf tool with some Python:

hou.putenv("OCIO", "/path/to/config.ocio")

That might work... But I don't know if Houdini supports "hot" loading of an OCIO config like that. No harm in trying it out though.
Edited by BrianHanke - 2024年9月9日 11:21:44
Subscribe to my Patreon for the best CG tips, tricks and tutorials! https://patreon.com/bhgc [patreon.com]

Twitter: https://twitter.com/brianhanke [twitter.com]
Behance: https://www.behance.net/brianhanke/projects [www.behance.net]
User Avatar
Member
41 posts
Joined: 10月 2022
Offline
I don’t know why, but the Redshift OCIO config doesn’t work with Karma.
The MaterialX image node seems to ignore the color rules.
Here’s how to hot-reload custom OCIO configs:

hou.putenv("OCIO", hou.expandString("$HOUDINI_USER_PREF_DIR") + "/ocio/rs_config.ocio")
hou.Color.reloadOCIO()
  • Quick Links