Skip to content

Commit

Permalink
Merge pull request #95 from MoonShineVFX/ple-2102
Browse files Browse the repository at this point in the history
fix nuke open file issue in ocio
  • Loading branch information
rebeccaLinx authored Jul 20, 2023
2 parents e18b52e + 8666e3d commit 35c6e7d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions avalon/nuke/workio.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ def has_unsaved_changes():

def save_file(filepath):
path = filepath.replace("\\", "/")
if os.getenv("OCIO"):
nuke.knob("root.colorManagement", "OCIO")
nuke.knob("root.customOCIOConfigPath", os.environ['OCIO'].replace('\\', '/'))

viewer = nuke.activeViewer()
if viewer:
v_node = viewer.node()
if 'sRGB (ACES)' in v_node['viewerProcess'].values():
v_node['viewerProcess'].setValue('sRGB')

nuke.scriptSaveAs(path)
nuke.Root()["name"].setValue(path)
nuke.Root()["project_directory"].setValue(os.path.dirname(path))
nuke.Root().setModified(False)

_set_color_management()


def open_file(filepath):
from reveries.common import get_frame_range
Expand Down

0 comments on commit 35c6e7d

Please sign in to comment.