From 509578c4efe14e5ffd2bf77acd0e890b0b1783e0 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 12 Nov 2019 12:52:57 +0100 Subject: [PATCH] fix(nuke): nuke little fixes --- pype/nuke/lib.py | 13 +++++++++---- pype/plugins/nuke/publish/collect_workfile.py | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pype/nuke/lib.py b/pype/nuke/lib.py index 9030ea43fb..157af9019d 100644 --- a/pype/nuke/lib.py +++ b/pype/nuke/lib.py @@ -1,8 +1,9 @@ import os +import re import sys import getpass from collections import OrderedDict -from pprint import pprint + from avalon import api, io, lib import avalon.nuke import pype.api as pype @@ -949,7 +950,7 @@ class BuildWorkfile(WorkfileSettings): **kwargs) self.to_script = to_script # collect data for formating - data = { + self.data_tmp = { "root": root_path or api.Session["AVALON_PROJECTS"], "project": {"name": self._project["name"], "code": self._project["data"].get("code", '')}, @@ -964,7 +965,7 @@ class BuildWorkfile(WorkfileSettings): # get presets from anatomy anatomy = get_anatomy() # format anatomy - anatomy_filled = anatomy.format(data) + anatomy_filled = anatomy.format(self.data_tmp) # get dir and file for workfile self.work_dir = anatomy_filled["avalon"]["work"] @@ -1140,6 +1141,10 @@ class BuildWorkfile(WorkfileSettings): representation (dict): avalon db entity """ + task = self.data_tmp["task"] + sanitized_task = re.sub('[^0-9a-zA-Z]+', '', task) + subset_name = "render{}Main".format( + sanitized_task.capitalize()) Create_name = "CreateWriteRender" @@ -1151,7 +1156,7 @@ class BuildWorkfile(WorkfileSettings): creator_plugin = Creator # return api.create() - return creator_plugin("render_writeMain", self._asset).process() + return creator_plugin(subset_name, self._asset).process() def create_backdrop(self, label="", color=None, layer=0, nodes=None): diff --git a/pype/plugins/nuke/publish/collect_workfile.py b/pype/plugins/nuke/publish/collect_workfile.py index 1e0ecb33f6..fcec97769a 100644 --- a/pype/plugins/nuke/publish/collect_workfile.py +++ b/pype/plugins/nuke/publish/collect_workfile.py @@ -77,6 +77,7 @@ class CollectWorkfile(pyblish.api.ContextPlugin): "name": base_name, "publish": root.knob('publish').value(), "family": family, + "families": [family], "representations": list() })