From b94b7ff5de4af8b27a171bfae5c88c0ea46d4d70 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 20 Jun 2023 16:50:49 +0200 Subject: [PATCH 1/3] backward compatibility fix studio could have set host config paths but those were not resolving to custom config OCIO environment path. Instead it was always falling back to global ocio config paths settings --- openpype/pipeline/colorspace.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 1999ad3bed..13846e9f5c 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -377,6 +377,10 @@ def get_imageio_config( activate_host_color_management = imageio_host.get( "activate_host_color_management", True) + # TODO: remove this in future - backward compatibility + if activate_host_color_management is None: + activate_host_color_management = host_ocio_config.get("enabled", False) + if not activate_host_color_management: # if host settings are disabled return False because # it is expected that no colorspace management is needed From 6f8d47d36bfb948a09bd79891c739d7179579cc3 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 20 Jun 2023 16:52:03 +0200 Subject: [PATCH 2/3] nuke: user prompt if config path changes environment variable cannot be changed dynamically and user should now that settings had been changed and the nuke should be reopened. --- openpype/hosts/nuke/api/lib.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index c05182ce97..e3b34222d4 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -2069,6 +2069,35 @@ class WorkfileSettings(object): log.debug("nuke.root()['{}'] changed to: {}".format( knob, value_)) + # set ocio config path + if config_data: + current_ocio_path = os.getenv("OCIO") + if current_ocio_path != config_data["path"]: + message = """ +It seems like there's a mismatch between the OCIO config path set in your Nuke +settings and the actual path set in your OCIO environment. + +To resolve this, please follow these steps: +1. Close Nuke if it's currently open. +2. Reopen Nuke. + +Please note the paths for your reference: + +- The OCIO environment path currently set: + `{env_path}` + +- The path in your current Nuke settings: + `{settings_path}` + +Reopening Nuke should synchronize these paths and resolve any discrepancies. +""" + nuke.message( + message.format( + env_path=current_ocio_path, + settings_path=config_data["path"] + ) + ) + def set_writes_colorspace(self): ''' Adds correct colorspace to write node dict From 2d1fc8e72857a63510fb9e6e27fe2ddea85527e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Wed, 21 Jun 2023 14:09:29 +0200 Subject: [PATCH 3/3] Update openpype/pipeline/colorspace.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 13846e9f5c..269825f85f 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -375,7 +375,7 @@ def get_imageio_config( # This is for backward compatibility. # TODO: in future rewrite this to be more explicit activate_host_color_management = imageio_host.get( - "activate_host_color_management", True) + "activate_host_color_management") # TODO: remove this in future - backward compatibility if activate_host_color_management is None: