Problem summary
The OCIO file knob is receiving issues due to Python String Literals on Windows.
Calling an environment variable containing a String Literal (e.g \n, \t, etc ), Nuke attempts to evaluate the String.
For example, if an Environment Variable's value is "C:\temp", Nuke would read it as C: emp within the OCIO file knob.
Project Settings example:
This issue does not occur when adding the file path manually, using Python knob defaults or using Linux/Mac as their file paths use '/'.
Customer reported version
nuke.11.3v2
Customer reported platform
windows10
Steps to reproduce
1) Create a text file and folder path to C:\temp\config.OCIO
2) Run Windows Command Prompt, execute the following command line: set TESTOCIO=C:\temp
3) Launch Nuke from the same Command Prompt
4) Open your Project Settings ( S in Node Graph ), navigate to the Color tab,
5) Set the OCIO config to "custom" and add the following path: $env(TESTOCIO)/config.OCIO
6) Create and view an OCIO node ( e.g OCIOColorSpace )
Result: Nuke will throw an error, stating that it cannot find the OCIO file. The file path given will display a tabbed section, which is due to the String Literal present.
Expected behaviour
The OCIO File knob should evaluate the Environment Variable expression and return the path without any formatting.
Actual behaviour
Python String Literals within file paths are evaluated, causing pathing issues.
Workaround
TCL Workaround
The issue can be worked around by using forward slash '/' instead of backslash '\' when entering the path.
For example: C:/temp
Nuke automatically flips paths to use forward slashes in other File knob arguments.
Python Workaround
Adding the path on startup works with the following Python snippet in your init.py file: ( Replace environment variable path )
This will automatically set the OCIO configuration for new projects.
Reproduced by support
This bug has been reproduced in:
Nuke11.3v4- Windows 7
Nuke11.3v1- Windows 7
Nuke11.2v1 - Windows 7
Nuke11.1v1 - Windows 7
Nuke11.0v1 - Windows 7
Nuke10.5v8 - Windows 7
Nuke10.5v1 - Windows 7
Nuke10.0v1 - Windows 7
Nuke9.0v1 - Windows 7
Nuke8.0v1 - Windows 7
Unable to reproduce bug in:
Nuke11.3v4 - Mac10.14 - CentOS7
Earliest version tested
- This issue no longer appears in this version and has regressed