From 935de8333f0b5d9744d21615f64cc07307188b9c Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 13 May 2020 17:13:16 +0200 Subject: [PATCH 1/6] fix(nks): fixing default project path to work with multi-root --- pype/nukestudio/lib.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pype/nukestudio/lib.py b/pype/nukestudio/lib.py index 774a9d45bf9..32cb41c01c6 100644 --- a/pype/nukestudio/lib.py +++ b/pype/nukestudio/lib.py @@ -6,7 +6,7 @@ import avalon.api as avalon from avalon.vendor.Qt import (QtWidgets, QtGui) import pype.api as pype -from pypeapp import Logger +from pypeapp import Logger, Anatomy log = Logger().get_logger(__name__, "nukestudio") @@ -31,11 +31,17 @@ def set_workfiles(): workfiles.show(workdir) def sync_avalon_data_to_workfile(): - # import session to get project dir S = avalon.Session + # import session to get project dir + anatomy = Anatomy(S['AVALON_PROJECT']) + + # generate multi root environment variables + anatomy.roots_obj.set_root_environments() + + # set active project root work directory active_project_root = os.path.normpath( - os.path.join(S['AVALON_PROJECTS'], S['AVALON_PROJECT']) - ) + os.path.join(os.getenv("PYPE_ROOT_WORK"), S['AVALON_PROJECT'])) + # getting project project = hiero.core.projects()[-1] From 4e4c68c2283edcbc2969a08001df04bf59b23312 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 13 May 2020 17:31:45 +0200 Subject: [PATCH 2/6] feat(nks): adding multi root into plugins --- pype/nukestudio/lib.py | 28 ++++++++++++++----- .../publish/collect_project_root.py | 5 +++- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pype/nukestudio/lib.py b/pype/nukestudio/lib.py index 32cb41c01c6..540f5e1c7d7 100644 --- a/pype/nukestudio/lib.py +++ b/pype/nukestudio/lib.py @@ -30,7 +30,9 @@ def set_workfiles(): # show workfile gui workfiles.show(workdir) -def sync_avalon_data_to_workfile(): +def set_multiroot_env(): + """ Will fill multi root related pype environment variables + """ S = avalon.Session # import session to get project dir anatomy = Anatomy(S['AVALON_PROJECT']) @@ -38,6 +40,15 @@ def sync_avalon_data_to_workfile(): # generate multi root environment variables anatomy.roots_obj.set_root_environments() + +def sync_avalon_data_to_workfile(): + """ Setting up all avalon data into hiero project + """ + S = avalon.Session + + if not os.getenv("PYPE_ROOT_WORK"): + set_multiroot_env() + # set active project root work directory active_project_root = os.path.normpath( os.path.join(os.getenv("PYPE_ROOT_WORK"), S['AVALON_PROJECT'])) @@ -356,17 +367,20 @@ def CreateNukeWorkfile(nodes=None, # create root node and save all metadata root_node = hiero.core.nuke.RootNode() - root_path = os.environ["AVALON_PROJECTS"] + if not os.getenv("PYPE_ROOT_WORK"): + set_multiroot_env() + + root_path = os.environ["PYPE_ROOT_WORK"] nuke_script.addNode(root_node) # here to call pype.nuke.lib.BuildWorkfile script_builder = nklib.BuildWorkfile( - root_node=root_node, - root_path=root_path, - nodes=nuke_script.getNodes(), - **kwargs - ) + root_node=root_node, + root_path=root_path, + nodes=nuke_script.getNodes(), + **kwargs + ) class ClipLoader: diff --git a/pype/plugins/nukestudio/publish/collect_project_root.py b/pype/plugins/nukestudio/publish/collect_project_root.py index 1b21a6b641c..bdeec3c9f47 100644 --- a/pype/plugins/nukestudio/publish/collect_project_root.py +++ b/pype/plugins/nukestudio/publish/collect_project_root.py @@ -1,5 +1,6 @@ import pyblish.api import avalon.api as avalon +from pype.nukestudio.lib import set_multiroot_env import os class CollectActiveProjectRoot(pyblish.api.ContextPlugin): @@ -9,7 +10,9 @@ class CollectActiveProjectRoot(pyblish.api.ContextPlugin): order = pyblish.api.CollectorOrder - 0.1 def process(self, context): + if not os.getenv("PYPE_ROOT_WORK"): + set_multiroot_env() S = avalon.Session context.data["projectroot"] = os.path.normpath( - os.path.join(S['AVALON_PROJECTS'], S['AVALON_PROJECT']) + os.path.join(os.getenv("PYPE_ROOT_WORK"), S['AVALON_PROJECT']) ) From 77d65e35b4783a4487399403929e03b00f5a8585 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 13 May 2020 17:55:49 +0200 Subject: [PATCH 3/6] fix(nuke, nks): replacing AVALON_PROJECTS --- pype/nuke/lib.py | 14 ++++++++++---- pype/nukestudio/lib.py | 13 ------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/pype/nuke/lib.py b/pype/nuke/lib.py index 423738dd7ff..4e6ef9f65dd 100644 --- a/pype/nuke/lib.py +++ b/pype/nuke/lib.py @@ -177,9 +177,14 @@ def format_anatomy(data): log.debug("__ anatomy.templates: {}".format(anatomy.templates)) try: - padding = int(anatomy.templates['render']['padding']) + # TODO: bck compatibility with old anatomy template + padding = int(anatomy.templates.get( + "frame_padding", + anatomy.templates["render"].get("padding")) + ) except KeyError as e: msg = ("`padding` key is not in `render` " + "or `frame_padding` on is not available in " "Anatomy template. Please, add it there and restart " "the pipeline (padding: \"4\"): `{}`").format(e) @@ -192,7 +197,7 @@ def format_anatomy(data): data["version"] = pype.get_version_from_path(file) project_document = pype.get_project() data.update({ - "root": api.Session["AVALON_PROJECTS"], + "root": os.getenv("PYPE_ROOT_WORK"), "subset": data["avalon"]["subset"], "asset": data["avalon"]["asset"], "task": api.Session["AVALON_TASK"], @@ -972,7 +977,7 @@ def set_context_settings(self): self.set_colorspace() def set_favorites(self): - projects_root = os.getenv("AVALON_PROJECTS") + projects_root = os.getenv("PYPE_ROOT_WORK") work_dir = os.getenv("AVALON_WORKDIR") asset = os.getenv("AVALON_ASSET") project = os.getenv("AVALON_PROJECT") @@ -1109,9 +1114,10 @@ def __init__(self, nodes=nodes, **kwargs) self.to_script = to_script + # collect data for formating self.data_tmp = { - "root": root_path or api.Session["AVALON_PROJECTS"], + "root": root_path or os.getenv("PYPE_ROOT_WORK"), "project": {"name": self._project["name"], "code": self._project["data"].get("code", '')}, "asset": self._asset or os.environ["AVALON_ASSET"], diff --git a/pype/nukestudio/lib.py b/pype/nukestudio/lib.py index 540f5e1c7d7..543e300cb90 100644 --- a/pype/nukestudio/lib.py +++ b/pype/nukestudio/lib.py @@ -30,25 +30,12 @@ def set_workfiles(): # show workfile gui workfiles.show(workdir) -def set_multiroot_env(): - """ Will fill multi root related pype environment variables - """ - S = avalon.Session - # import session to get project dir - anatomy = Anatomy(S['AVALON_PROJECT']) - - # generate multi root environment variables - anatomy.roots_obj.set_root_environments() - def sync_avalon_data_to_workfile(): """ Setting up all avalon data into hiero project """ S = avalon.Session - if not os.getenv("PYPE_ROOT_WORK"): - set_multiroot_env() - # set active project root work directory active_project_root = os.path.normpath( os.path.join(os.getenv("PYPE_ROOT_WORK"), S['AVALON_PROJECT'])) From ec82982571d36bfbe93b9a26480797a0093f2ed5 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 13 May 2020 18:15:58 +0200 Subject: [PATCH 4/6] clean(nks): hound suggestions --- pype/nukestudio/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/nukestudio/lib.py b/pype/nukestudio/lib.py index 543e300cb90..6122cd00851 100644 --- a/pype/nukestudio/lib.py +++ b/pype/nukestudio/lib.py @@ -6,7 +6,7 @@ import avalon.api as avalon from avalon.vendor.Qt import (QtWidgets, QtGui) import pype.api as pype -from pypeapp import Logger, Anatomy +from pypeapp import Logger log = Logger().get_logger(__name__, "nukestudio") From 5d8376ba19c22cb593adc4896d5ad3f97c402ed0 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 13 May 2020 18:19:16 +0200 Subject: [PATCH 5/6] clean(nks): unused plugin for context key collection --- .../nukestudio/{publish => _unused}/collect_project_root.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pype/plugins/nukestudio/{publish => _unused}/collect_project_root.py (100%) diff --git a/pype/plugins/nukestudio/publish/collect_project_root.py b/pype/plugins/nukestudio/_unused/collect_project_root.py similarity index 100% rename from pype/plugins/nukestudio/publish/collect_project_root.py rename to pype/plugins/nukestudio/_unused/collect_project_root.py From b5350d8e53363ba93c56937314cf56e19bd9ee5e Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 13 May 2020 19:11:32 +0200 Subject: [PATCH 6/6] clean(nks): removing ugly `_unused` dir in plugins --- .../nukestudio/_unused/collect_metadata.py | 30 ----- .../_unused/collect_project_root.py | 18 --- .../nukestudio/_unused/collect_submission.py | 14 -- .../_unused/collect_workfile_version.py | 15 --- .../_unused/extract_plates_waiting.py | 30 ----- .../nukestudio/_unused/extract_tasks.py | 124 ------------------ .../_unused/subset-representations_logic.txt | 26 ---- .../_unused/validate_projectroot.py | 40 ------ .../_unused/validate_resolved_paths.py | 27 ---- .../nukestudio/_unused/validate_task.py | 57 -------- .../nukestudio/_unused/validate_track_item.py | 46 ------- .../nukestudio/_unused/validate_viewer_lut.py | 21 --- 12 files changed, 448 deletions(-) delete mode 100644 pype/plugins/nukestudio/_unused/collect_metadata.py delete mode 100644 pype/plugins/nukestudio/_unused/collect_project_root.py delete mode 100644 pype/plugins/nukestudio/_unused/collect_submission.py delete mode 100644 pype/plugins/nukestudio/_unused/collect_workfile_version.py delete mode 100644 pype/plugins/nukestudio/_unused/extract_plates_waiting.py delete mode 100644 pype/plugins/nukestudio/_unused/extract_tasks.py delete mode 100644 pype/plugins/nukestudio/_unused/subset-representations_logic.txt delete mode 100644 pype/plugins/nukestudio/_unused/validate_projectroot.py delete mode 100644 pype/plugins/nukestudio/_unused/validate_resolved_paths.py delete mode 100644 pype/plugins/nukestudio/_unused/validate_task.py delete mode 100644 pype/plugins/nukestudio/_unused/validate_track_item.py delete mode 100644 pype/plugins/nukestudio/_unused/validate_viewer_lut.py diff --git a/pype/plugins/nukestudio/_unused/collect_metadata.py b/pype/plugins/nukestudio/_unused/collect_metadata.py deleted file mode 100644 index 23d36ba4a26..00000000000 --- a/pype/plugins/nukestudio/_unused/collect_metadata.py +++ /dev/null @@ -1,30 +0,0 @@ -from pyblish import api - - -class CollectClipMetadata(api.InstancePlugin): - """Collect Metadata from selected track items.""" - - order = api.CollectorOrder + 0.01 - label = "Collect Metadata" - hosts = ["nukestudio"] - - def process(self, instance): - item = instance.data["item"] - ti_metadata = self.metadata_to_string(dict(item.metadata())) - ms_metadata = self.metadata_to_string( - dict(item.source().mediaSource().metadata())) - - instance.data["clipMetadata"] = ti_metadata - instance.data["mediaSourceMetadata"] = ms_metadata - - self.log.info(instance.data["clipMetadata"]) - self.log.info(instance.data["mediaSourceMetadata"]) - return - - def metadata_to_string(self, metadata): - data = dict() - for k, v in metadata.items(): - if v not in ["-", ""]: - data[str(k)] = v - - return data diff --git a/pype/plugins/nukestudio/_unused/collect_project_root.py b/pype/plugins/nukestudio/_unused/collect_project_root.py deleted file mode 100644 index bdeec3c9f47..00000000000 --- a/pype/plugins/nukestudio/_unused/collect_project_root.py +++ /dev/null @@ -1,18 +0,0 @@ -import pyblish.api -import avalon.api as avalon -from pype.nukestudio.lib import set_multiroot_env -import os - -class CollectActiveProjectRoot(pyblish.api.ContextPlugin): - """Inject the active project into context""" - - label = "Collect Project Root" - order = pyblish.api.CollectorOrder - 0.1 - - def process(self, context): - if not os.getenv("PYPE_ROOT_WORK"): - set_multiroot_env() - S = avalon.Session - context.data["projectroot"] = os.path.normpath( - os.path.join(os.getenv("PYPE_ROOT_WORK"), S['AVALON_PROJECT']) - ) diff --git a/pype/plugins/nukestudio/_unused/collect_submission.py b/pype/plugins/nukestudio/_unused/collect_submission.py deleted file mode 100644 index cd2b8555242..00000000000 --- a/pype/plugins/nukestudio/_unused/collect_submission.py +++ /dev/null @@ -1,14 +0,0 @@ -import pyblish.api - - -class CollectSubmission(pyblish.api.ContextPlugin): - """Collect submisson children.""" - - order = pyblish.api.CollectorOrder - 0.1 - - def process(self, context): - import hiero - - if hasattr(hiero, "submission"): - context.data["submission"] = hiero.submission - self.log.debug("__ submission: {}".format(context.data["submission"])) diff --git a/pype/plugins/nukestudio/_unused/collect_workfile_version.py b/pype/plugins/nukestudio/_unused/collect_workfile_version.py deleted file mode 100644 index 733fbfc44a9..00000000000 --- a/pype/plugins/nukestudio/_unused/collect_workfile_version.py +++ /dev/null @@ -1,15 +0,0 @@ -import pyblish.api -import pype.api as pype - -class CollectWorkfileVersion(pyblish.api.ContextPlugin): - """Inject the current working file version into context""" - - order = pyblish.api.CollectorOrder - 0.1 - label = "Collect workfile version" - - def process(self, context): - - project = context.data('activeProject') - path = project.path() - context.data["version"] = int(pype.get_version_from_path(path)) - self.log.info("version: {}".format(context.data["version"])) diff --git a/pype/plugins/nukestudio/_unused/extract_plates_waiting.py b/pype/plugins/nukestudio/_unused/extract_plates_waiting.py deleted file mode 100644 index 9a4d8839178..00000000000 --- a/pype/plugins/nukestudio/_unused/extract_plates_waiting.py +++ /dev/null @@ -1,30 +0,0 @@ -from pyblish import api -import os -import time - - -class ExtractPlateCheck(api.ContextPlugin): - """Collect all Track items selection.""" - - order = api.ExtractorOrder + 0.01 - label = "Plates Export Waiting" - hosts = ["nukestudio"] - families = ["encode"] - - def process(self, context): - - plate_path = context.data.get("platesCheck", None) - - self.log.info("Chacking plate: `{}`".format(plate_path)) - - if not plate_path: - return - - while not os.path.exists(plate_path): - self.log.info("Waiting for plates to be rendered") - time.sleep(5) - - if os.path.isfile(plate_path): - self.log.info("Plates were rendered: `{}`".format(plate_path)) - else: - raise ValueError("%s isn't a file!" % plate_path) diff --git a/pype/plugins/nukestudio/_unused/extract_tasks.py b/pype/plugins/nukestudio/_unused/extract_tasks.py deleted file mode 100644 index 3e6ef9b71c8..00000000000 --- a/pype/plugins/nukestudio/_unused/extract_tasks.py +++ /dev/null @@ -1,124 +0,0 @@ -from pyblish import api - - -class ExtractTasks(api.InstancePlugin): - """Extract tasks.""" - - order = api.ExtractorOrder - label = "Tasks" - hosts = ["nukestudio"] - families = ["clip"] - optional = True - - def filelink(self, src, dst): - import filecmp - import os - import shutil - - import filelink - - # Compare files to check whether they are the same. - if os.path.exists(dst) and filecmp.cmp(src, dst): - return - - # Remove existing destination file. - if os.path.exists(dst): - os.remove(dst) - - try: - filelink.create(src, dst, filelink.HARDLINK) - self.log.debug("Linking: \"{0}\" to \"{1}\"".format(src, dst)) - except WindowsError as e: - if e.winerror == 17: - self.log.warning( - "File linking failed due to: \"{0}\". " - "Resorting to copying instead.".format(e) - ) - shutil.copy(src, dst) - else: - raise e - - def process(self, instance): - import time - import os - - import hiero.core.nuke as nuke - import hiero.exporters as he - import clique - - task = instance.data["task"] - - hiero_cls = he.FnSymLinkExporter.SymLinkExporter - if isinstance(task, hiero_cls): - src = os.path.join( - task.filepath(), - task.fileName() - ) - # Filelink each image file - if "img" in instance.data["families"]: - collection = clique.parse(src + " []") - for f in os.listdir(os.path.dirname(src)): - f = os.path.join(os.path.dirname(src), f) - - frame_offset = task.outputRange()[0] - task.inputRange()[0] - input_range = ( - int(task.inputRange()[0]), int(task.inputRange()[1]) + 1 - ) - for index in range(*input_range): - dst = task.resolvedExportPath() % (index + frame_offset) - self.filelink(src % index, dst) - # Filelink movie file - if "mov" in instance.data["families"]: - dst = task.resolvedExportPath() - self.filelink(src, dst) - - hiero_cls = he.FnTranscodeExporter.TranscodeExporter - if isinstance(task, hiero_cls): - task.startTask() - while task.taskStep(): - time.sleep(1) - - script_path = task._scriptfile - log_path = script_path.replace(".nk", ".log") - log_file = open(log_path, "w") - process = nuke.executeNukeScript(script_path, log_file, True) - - self.poll(process) - - log_file.close() - - if not task._preset.properties()["keepNukeScript"]: - os.remove(script_path) - os.remove(log_path) - - hiero_cls = he.FnNukeShotExporter.NukeShotExporter - if isinstance(task, hiero_cls): - task.startTask() - while task.taskStep(): - time.sleep(1) - - hiero_cls = he.FnAudioExportTask.AudioExportTask - if isinstance(task, hiero_cls): - task.startTask() - while task.taskStep(): - time.sleep(1) - - # Fill collection with output - if "img" in instance.data["families"]: - collection = instance.data["collection"] - path = os.path.dirname(collection.format()) - for f in os.listdir(path): - file_path = os.path.join(path, f).replace("\\", "/") - if collection.match(file_path): - collection.add(file_path) - - def poll(self, process): - import time - - returnCode = process.poll() - - # if the return code hasn't been set, Nuke is still running - if returnCode is None: - time.sleep(1) - - self.poll(process) diff --git a/pype/plugins/nukestudio/_unused/subset-representations_logic.txt b/pype/plugins/nukestudio/_unused/subset-representations_logic.txt deleted file mode 100644 index dcb78152765..00000000000 --- a/pype/plugins/nukestudio/_unused/subset-representations_logic.txt +++ /dev/null @@ -1,26 +0,0 @@ -- tags get tasks - -- collect_subset(instance): - - gets presets for subset by tasks - - creates instances for comp .nk, plates (main instance converted to plates) - - add families: - - .nk compositing script [workfile, ftrack] - - plates [plates] - - audio [audio] - -- extract_submit_frameserver(instance) - - families [plates] - - adds .nk script created only for encoding (plates write) no color correction - - adds .nk script created only for encoding (mov write) - - add .nk script created only for encoding (jpg, thumbnail) - - _______ - - from hiero.ui.nuke_bridge import FnNsFrameServer - - FnNsFrameServer.renderFrames(nks, "1-10", "Write_exr", ["main"]) - - dict(script(str), framerange(str), writeNode(str), views(list)) - -# next step ######################################################## -- submit_exporting_task(instance) - - families [workfile] - - create compositing scripts - - create inventory containers for Reads - - create publishable write nodes diff --git a/pype/plugins/nukestudio/_unused/validate_projectroot.py b/pype/plugins/nukestudio/_unused/validate_projectroot.py deleted file mode 100644 index 94315014c60..00000000000 --- a/pype/plugins/nukestudio/_unused/validate_projectroot.py +++ /dev/null @@ -1,40 +0,0 @@ -from pyblish import api - - -class RepairProjectRoot(api.Action): - - label = "Repair" - icon = "wrench" - on = "failed" - - def process(self, context, plugin): - import os - - project_root = os.path.join( - os.path.dirname(context.data["currentFile"]) - ) - - context.data["activeProject"].setProjectRoot(project_root) - - -class ValidateProjectRoot(api.ContextPlugin): - """Validate the project root to the workspace directory.""" - - order = api.ValidatorOrder - label = "Project Root" - hosts = ["nukestudio"] - actions = [RepairProjectRoot] - - def process(self, context): - import os - - workspace = os.path.join( - os.path.dirname(context.data["currentFile"]) - ) - project_root = context.data["activeProject"].projectRoot() - - failure_message = ( - 'The project root needs to be "{0}", its currently: "{1}"' - ).format(workspace, project_root) - - assert project_root == workspace, failure_message diff --git a/pype/plugins/nukestudio/_unused/validate_resolved_paths.py b/pype/plugins/nukestudio/_unused/validate_resolved_paths.py deleted file mode 100644 index f1f0b7bbc8b..00000000000 --- a/pype/plugins/nukestudio/_unused/validate_resolved_paths.py +++ /dev/null @@ -1,27 +0,0 @@ -from pyblish import api - -class ValidateResolvedPaths(api.ContextPlugin): - """Validate there are no overlapping resolved paths.""" - - order = api.ValidatorOrder - label = "Resolved Paths" - hosts = ["nukestudio"] - - def process(self, context): - import os - import collections - - paths = [] - for instance in context: - if "trackItem.task" == instance.data["family"]: - paths.append( - os.path.abspath(instance.data["task"].resolvedExportPath()) - ) - - duplicates = [] - for item, count in collections.Counter(paths).items(): - if count > 1: - duplicates.append(item) - - msg = "Duplicate output paths found: {0}".format(duplicates) - assert not duplicates, msg diff --git a/pype/plugins/nukestudio/_unused/validate_task.py b/pype/plugins/nukestudio/_unused/validate_task.py deleted file mode 100644 index ff8fa6b6e10..00000000000 --- a/pype/plugins/nukestudio/_unused/validate_task.py +++ /dev/null @@ -1,57 +0,0 @@ -from pyblish import api - - -class ValidateOutputRange(api.InstancePlugin): - """Validate the output range of the task. - - This compares the output range and clip associated with the task, so see - whether there is a difference. This difference indicates that the user has - selected to export the clip length for the task which is very uncommon to - do. - """ - - order = api.ValidatorOrder - families = ["trackItem.task"] - label = "Output Range" - hosts = ["nukestudio"] - optional = True - - def process(self, instance): - - task = instance.data["task"] - item = instance.data["parent"] - - output_range = task.outputRange() - first_frame = int(item.data["item"].source().sourceIn()) - last_frame = int(item.data["item"].source().sourceOut()) - clip_duration = last_frame - first_frame + 1 - - difference = clip_duration - output_range[1] - failure_message = ( - 'Looks like you are rendering the clip length for the task ' - 'rather than the cut length. If this is intended, just uncheck ' - 'this validator after resetting, else adjust the export range in ' - 'the "Handles" section of the export dialog.' - ) - assert difference, failure_message - - -class ValidateImageSequence(api.InstancePlugin): - """Validate image sequence output path is setup correctly.""" - - order = api.ValidatorOrder - families = ["trackItem.task", "img"] - match = api.Subset - label = "Image Sequence" - hosts = ["nukestudio"] - optional = True - - def process(self, instance): - - resolved_path = instance.data["task"].resolvedExportPath() - - msg = ( - "Image sequence output is missing a padding. Please add \"####\" " - "or \"%04d\" to the output templates." - ) - assert "#" in resolved_path or "%" in resolved_path, msg diff --git a/pype/plugins/nukestudio/_unused/validate_track_item.py b/pype/plugins/nukestudio/_unused/validate_track_item.py deleted file mode 100644 index 48f63b56085..00000000000 --- a/pype/plugins/nukestudio/_unused/validate_track_item.py +++ /dev/null @@ -1,46 +0,0 @@ -from pyblish import api - -class ValidateClip(api.InstancePlugin): - """Validate the track item to the sequence. - - Exact matching to optimize processing. - """ - - order = api.ValidatorOrder - families = ["clip"] - # match = api.Exact - label = "Validate Track Item" - hosts = ["nukestudio"] - optional = True - - def process(self, instance): - - item = instance.data["item"] - self.log.info("__ item: {}".format(item)) - media_source = item.source().mediaSource() - self.log.info("__ media_source: {}".format(media_source)) - - msg = ( - 'A setting does not match between track item "{0}" and sequence ' - '"{1}".'.format(item.name(), item.sequence().name()) + - '\n\nSetting: "{0}".''\n\nTrack item: "{1}".\n\nSequence: "{2}".' - ) - - # Validate format settings. - fmt = item.sequence().format() - assert fmt.width() == media_source.width(), msg.format( - "width", fmt.width(), media_source.width() - ) - assert fmt.height() == media_source.height(), msg.format( - "height", fmt.height(), media_source.height() - ) - assert fmt.pixelAspect() == media_source.pixelAspect(), msg.format( - "pixelAspect", fmt.pixelAspect(), media_source.pixelAspect() - ) - - # Validate framerate setting. - sequence = item.sequence() - source_framerate = media_source.metadata()["foundry.source.framerate"] - assert sequence.framerate() == source_framerate, msg.format( - "framerate", source_framerate, sequence.framerate() - ) diff --git a/pype/plugins/nukestudio/_unused/validate_viewer_lut.py b/pype/plugins/nukestudio/_unused/validate_viewer_lut.py deleted file mode 100644 index 08c084880dc..00000000000 --- a/pype/plugins/nukestudio/_unused/validate_viewer_lut.py +++ /dev/null @@ -1,21 +0,0 @@ -from pyblish import api - - -class ValidateViewerLut(api.ContextPlugin): - """Validate viewer lut in NukeStudio is the same as in Nuke.""" - - order = api.ValidatorOrder - label = "Viewer LUT" - hosts = ["nukestudio"] - optional = True - - def process(self, context): - import nuke - import hiero - - # nuke_lut = nuke.ViewerProcess.node()["current"].value() - nukestudio_lut = context.data["activeProject"].lutSettingViewer() - self.log.info("__ nukestudio_lut: {}".format(nukestudio_lut)) - - msg = "Viewer LUT can only be RGB" - assert "RGB" in nukestudio_lut, msg