Houdini 20.5 ignore ocio system variable?

   748   4   2
User Avatar
Member
71 posts
Joined: March 2016
Offline
Hi all,

So I want to have the system variable (ocio - C:\****\aces_1.2\config.ocio") to still exist, but have Houdini ignore this system variable, since it already comes with acescg.

I want to keep this system variable for the other software to also be in acescg.

Is there any command or line for the houdini.env to be set that ignores this specific system variable?

Cheers,
Chris
https://www.youtube.com/@Klonkel
User Avatar
Member
38 posts
Joined: Feb. 2017
Online
You can override the environment variable by specifying a different config in the houdini.env. In my case I had to override it for houdini because my older vray for max doesn't support newer configs. You could try just setting an empty string I suppose?

OCIO = "C:/Users/YOURUSER/Documents/houdini20.5/ocio/houdini-config-v2.1.0_aces-v1.3_ocio-v2.3.ocio"
User Avatar
Member
274 posts
Joined: July 2013
Offline
While putting it houdini.env will probably work, better put it in a json package file. That is the more modern replacement for the error prone houdini.env

It gives much more control and can even contain some of basic if/then logic.

https://www.sidefx.com/docs/houdini/ref/plugins.html [www.sidefx.com]

Ideally the houdini.env is just an empty file.
More code, less clicks.
User Avatar
Member
1 posts
Joined: Sept. 2019
Offline
I've created a small .bat file to switch the OCIO variable on and off depending on your needs without going into the houdini.env all the time.

You can save the code below to a .bat file and double click it to switch between enabled and disabled states. I suppose you can tweak it a bit to do the same for a json package if that's how you've set up your OCIO.

Hope it is of some use


@echo off
setlocal

REM Below you can set the path to the houdini.env file if it's not in the standard location
set "FILE_PATH=C:\Users\%USERNAME%\Documents\houdini19.5\houdini.env"

REM Using PowerShell to find the line starting with "OCIO =" or "#OCIO =", then toggle it on or off
powershell -Command ^
    "$content = Get-Content '%FILE_PATH%';" ^
    "$modified = $false;" ^
    "$commentToggled = 'none';" ^
    "for ($i = 0; $i -lt $content.Length; $i++) {" ^
    "    if ($content[$i] -match '^#?OCIO =') {" ^
    "        if ($content[$i] -match '^#OCIO =') {" ^
    "            $content[$i] = $content[$i] -replace '^#', '';" ^
    "            $commentToggled = 'removed';" ^
    "        } else {" ^
    "            $content[$i] = '#' + $content[$i];" ^
    "            $commentToggled = 'added';" ^
    "        }" ^
    "        $modified = $true;" ^
    "        break;" ^
    "    }" ^
    "};" ^
    "if ($modified) {" ^
    "    $content | Set-Content '%FILE_PATH%';" ^
    "    if ($commentToggled -eq 'added') { Write-Host 'OCIO disabled' }" ^
    "    elseif ($commentToggled -eq 'removed') { Write-Host 'OCIO enabled' }" ^
    "} else {" ^
    "    Write-Host 'Line starting with \"OCIO =\" not found.' }"

echo Done.
User Avatar
Staff
441 posts
Joined: Feb. 2018
Offline
The OCIO dialog uses the user package ocio.json to load and save the user OCIO settings, a new ocio.json package is created if one doesn't exist already. So the next time you open Houdini, the settings will be applied from ocio.json.
NOTE: houdini.env is not supported with the OCIO dialog.
Edited by mabelzile - Sept. 8, 2024 07:40:04
  • Quick Links