From 4af2ddaf49902050faee13ed4e5b5653a0e48782 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 7 Aug 2023 17:22:50 +0200 Subject: [PATCH] nuke: nicer error communication to users. --- openpype/hosts/nuke/api/lib.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/openpype/hosts/nuke/api/lib.py b/openpype/hosts/nuke/api/lib.py index 21036e5b11..5ea6752579 100644 --- a/openpype/hosts/nuke/api/lib.py +++ b/openpype/hosts/nuke/api/lib.py @@ -2379,25 +2379,24 @@ Reopening Nuke should synchronize these paths and resolve any discrepancies. knobs["to"])) def set_colorspace(self): - ''' Setting colorpace following presets + ''' Setting colorspace following presets ''' # get imageio nuke_colorspace = get_nuke_imageio_settings() log.info("Setting colorspace to workfile...") - # try: - self.set_root_colorspace(nuke_colorspace) - # except AttributeError: - # msg = "set_colorspace(): missing `workfile` settings in template" - # nuke.message(msg) + try: + self.set_root_colorspace(nuke_colorspace) + except AttributeError as _error: + msg = "Set Colorspace to workfile error: {}".format(_error) + nuke.message(msg) log.info("Setting colorspace to viewers...") try: self.set_viewers_colorspace(nuke_colorspace["viewer"]) - except AttributeError: - msg = "set_colorspace(): missing `viewer` settings in template" + except AttributeError as _error: + msg = "Set Colorspace to viewer error: {}".format(_error) nuke.message(msg) - log.error(msg) log.info("Setting colorspace to write nodes...") try: