From c6d72a6488b1c1588cc753ac831906a41892f067 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 28 Mar 2024 19:01:23 +0000 Subject: [PATCH 01/50] Add render farm button on write nodes. --- client/ayon_core/hosts/nuke/api/lib.py | 26 ++++ client/ayon_core/hosts/nuke/api/utils.py | 166 ++++++++++++++++++++++- 2 files changed, 191 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index 4fcba8d2d4..22428fd657 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -1022,6 +1022,16 @@ def script_name(): return nuke.root().knob("name").value() +def add_button_render_farm(node): + name = "renderFarm" + label = "Render Farm" + value = "from ayon_core.hosts.nuke.api.utils import submit_headless_farm;" + value += "submit_headless_farm(nuke.thisNode())" + knob = nuke.PyScript_Knob(name, label, value) + knob.clearFlag(nuke.STARTLINE) + node.addKnob(knob) + + def add_button_write_to_read(node): name = "createReadNode" label = "Read From Rendered" @@ -1144,6 +1154,19 @@ def create_write_node( Return: node (obj): group node with avalon data as Knobs ''' + # Ensure name does not contain any invalid characters. + special_characters = set("!@#$%^&*()=[]{}|\\;',.<>/?~+-") + found_special_characters = [] + + # Check each character in the node name + for char in name: + if char in special_characters: + found_special_characters.append(char) + + msg = f"Special characters found in name \"{name}\": " + msg += f"{' '.join(found_special_characters)}" + assert not found_special_characters, msg + prenodes = prenodes or [] # filtering variables @@ -1268,6 +1291,9 @@ def create_write_node( link.setFlag(0x1000) GN.addKnob(link) + # Adding render farm submission button. + add_button_render_farm(GN) + # adding write to read button add_button_write_to_read(GN) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 1bfc1919fa..5a643d05d8 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -1,11 +1,18 @@ import os import re +import traceback +from datetime import datetime +import shutil import nuke -from ayon_core import resources +from pyblish import util from qtpy import QtWidgets +from ayon_core import resources +from ayon_core.pipeline import registered_host +from ayon_core.tools.utils import show_message_dialog + def set_context_favorites(favorites=None): """ Adding favorite folders to nuke's browser @@ -142,3 +149,160 @@ def is_headless(): bool: headless """ return QtWidgets.QApplication.instance() is None + + +def create_error_report(context): + error_message = "" + success = True + for result in context.data["results"]: + if result["success"]: + continue + + success = False + + err = result["error"] + formatted_traceback = "".join( + traceback.format_exception( + type(err), + err, + err.__traceback__ + ) + ) + fname = result["plugin"].__module__ + if 'File "", line' in formatted_traceback: + _, lineno, func, msg = err.traceback + fname = os.path.abspath(fname) + formatted_traceback = formatted_traceback.replace( + 'File "", line', + 'File "{0}", line'.format(fname) + ) + + err = result["error"] + error_message += "\n" + error_message += formatted_traceback + + return success, error_message + + +def submit_headless_farm(node): + # Ensure code is executed in root context. + if nuke.root() == nuke.thisNode(): + _submit_headless_farm(node) + else: + # If not in root context, move to the root context and then execute the + # code. + with nuke.root(): + _submit_headless_farm(node) + + +def _submit_headless_farm(node): + context = util.collect() + + success, error_report = create_error_report(context) + + if not success: + show_message_dialog( + "Collection Errors", error_report, level="critical" + ) + return + + # Find instance for node and workfile. + instance = None + instance_workfile = None + indexes_to_remove = [] + for count, Instance in enumerate(context): + if Instance.data["family"] == "workfile": + instance_workfile = Instance + continue + + instance_node = Instance.data["transientData"]["node"] + if node.name() == instance_node.name(): + instance = Instance + else: + indexes_to_remove.append(count) + + if instance is None: + show_message_dialog( + "Collection Error", + "Could not find the instance from the node.", + level="critical" + ) + return + + # Enable for farm publishing. + instance.data["farm"] = True + instance.data["transfer"] = False + + # Clear the families as we only want the main family, ei. no review etc. + instance.data["families"] = [] + + # Use the workfile instead of published. + publish_attributes = instance.data["publish_attributes"] + publish_attributes["NukeSubmitDeadline"]["use_published_workfile"] = False + + # Disable version validation. + instance.data.pop("latestVersion") + instance_workfile.data.pop("latestVersion") + + # Remove all other instances. + indexes_to_remove.sort(reverse=True) + for i in indexes_to_remove: + if 0 <= i < len(context): + del context[i] + + # Validate + util.validate(context) + + success, error_report = create_error_report(context) + + if not success: + show_message_dialog( + "Validation Errors", error_report, level="critical" + ) + return + + # Extraction. + util.extract(context) + + success, error_report = create_error_report(context) + + if not success: + show_message_dialog( + "Extraction Errors", error_report, level="critical" + ) + return + + # Save the workfile. + host = registered_host() + host.save_file(host.current_file()) + + # Copy the workfile to a timestamped copy. + current_datetime = datetime.now() + formatted_timestamp = current_datetime.strftime("%Y%m%d%H%M%S") + base, ext = os.path.splitext(host.current_file()) + + directory = os.path.join(os.path.dirname(base), "farm_submissions") + if not os.path.exists(directory): + os.makedirs(directory) + + filename = "{}_{}{}".format( + os.path.basename(base), formatted_timestamp, ext + ) + path = os.path.join(directory, filename).replace("\\", "/") + context.data["currentFile"] = path + shutil.copy(host.current_file(), path) + + # Continue to submission. + util.integrate(context) + + success, error_report = create_error_report(context) + + if not success: + show_message_dialog( + "Extraction Errors", error_report, level="critical" + ) + return + + show_message_dialog( + "Submission Successful", "Submission to the farm was successful." + ) From eca60b00068b891d0f5c9a80d632f7854a454e43 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 5 Apr 2024 17:34:28 +0100 Subject: [PATCH 02/50] Review feedback --- client/ayon_core/hosts/nuke/api/lib.py | 9 +++++---- client/ayon_core/hosts/nuke/api/utils.py | 16 +++------------- .../nuke/plugins/create/create_write_image.py | 5 ++++- .../plugins/create/create_write_prerender.py | 6 +++++- .../nuke/plugins/create/create_write_render.py | 6 +++++- .../nuke/server/settings/create_plugins.py | 6 +++++- server_addon/nuke/server/version.py | 2 +- 7 files changed, 28 insertions(+), 22 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index 22428fd657..63e6ddef0f 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -1022,9 +1022,9 @@ def script_name(): return nuke.root().knob("name").value() -def add_button_render_farm(node): - name = "renderFarm" - label = "Render Farm" +def add_button_headless_farm_submission(node): + name = "headlessFarmSubmission" + label = "Headless Farm Submission" value = "from ayon_core.hosts.nuke.api.utils import submit_headless_farm;" value += "submit_headless_farm(nuke.thisNode())" knob = nuke.PyScript_Knob(name, label, value) @@ -1292,7 +1292,8 @@ def create_write_node( GN.addKnob(link) # Adding render farm submission button. - add_button_render_farm(GN) + if data.get("headless_farm_submission", False): + add_button_headless_farm_submission(GN) # adding write to read button add_button_write_to_read(GN) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 5a643d05d8..9528ad3d4c 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -209,8 +209,7 @@ def _submit_headless_farm(node): # Find instance for node and workfile. instance = None instance_workfile = None - indexes_to_remove = [] - for count, Instance in enumerate(context): + for Instance in context: if Instance.data["family"] == "workfile": instance_workfile = Instance continue @@ -219,7 +218,7 @@ def _submit_headless_farm(node): if node.name() == instance_node.name(): instance = Instance else: - indexes_to_remove.append(count) + Instance.data["active"] = False if instance is None: show_message_dialog( @@ -244,12 +243,6 @@ def _submit_headless_farm(node): instance.data.pop("latestVersion") instance_workfile.data.pop("latestVersion") - # Remove all other instances. - indexes_to_remove.sort(reverse=True) - for i in indexes_to_remove: - if 0 <= i < len(context): - del context[i] - # Validate util.validate(context) @@ -272,11 +265,8 @@ def _submit_headless_farm(node): ) return - # Save the workfile. - host = registered_host() - host.save_file(host.current_file()) - # Copy the workfile to a timestamped copy. + host = registered_host() current_datetime = datetime.now() formatted_timestamp = current_datetime.strftime("%Y%m%d%H%M%S") base, ext = os.path.splitext(host.current_file()) diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py b/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py index 770726e34f..046b99f6b0 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py +++ b/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py @@ -65,12 +65,15 @@ class CreateWriteImage(napi.NukeWriteCreator): ) def create_instance_node(self, product_name, instance_data): + settings = self.project_settings["nuke"]["create"]["CreateWriteImage"] + settings = settings["instance_attributes"] # add fpath_template write_data = { "creator": self.__class__.__name__, "productName": product_name, - "fpath_template": self.temp_rendering_path_template + "fpath_template": self.temp_rendering_path_template, + "headless_farm_submission": "headless_farm_submission" in settings } write_data.update(instance_data) diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py b/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py index 96ac2fac9c..df906c9c25 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py +++ b/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py @@ -46,11 +46,15 @@ class CreateWritePrerender(napi.NukeWriteCreator): return attr_defs def create_instance_node(self, product_name, instance_data): + settings = self.project_settings["nuke"]["create"] + settings = settings["CreateWritePrerender"]["instance_attributes"] + # add fpath_template write_data = { "creator": self.__class__.__name__, "productName": product_name, - "fpath_template": self.temp_rendering_path_template + "fpath_template": self.temp_rendering_path_template, + "headless_farm_submission": "headless_farm_submission" in settings } write_data.update(instance_data) diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py b/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py index 24bddb3d26..16bce64ec6 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py +++ b/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py @@ -40,11 +40,15 @@ class CreateWriteRender(napi.NukeWriteCreator): return attr_defs def create_instance_node(self, product_name, instance_data): + settings = self.project_settings["nuke"]["create"]["CreateWriteRender"] + settings = settings["instance_attributes"] + # add fpath_template write_data = { "creator": self.__class__.__name__, "productName": product_name, - "fpath_template": self.temp_rendering_path_template + "fpath_template": self.temp_rendering_path_template, + "headless_farm_submission": "headless_farm_submission" in settings } write_data.update(instance_data) diff --git a/server_addon/nuke/server/settings/create_plugins.py b/server_addon/nuke/server/settings/create_plugins.py index 6bdc5ee5ad..897a467118 100644 --- a/server_addon/nuke/server/settings/create_plugins.py +++ b/server_addon/nuke/server/settings/create_plugins.py @@ -12,7 +12,11 @@ def instance_attributes_enum(): return [ {"value": "reviewable", "label": "Reviewable"}, {"value": "farm_rendering", "label": "Farm rendering"}, - {"value": "use_range_limit", "label": "Use range limit"} + {"value": "use_range_limit", "label": "Use range limit"}, + { + "value": "headless_farm_submission", + "label": "Headless Farm Submission" + } ] diff --git a/server_addon/nuke/server/version.py b/server_addon/nuke/server/version.py index 569b1212f7..0c5c30071a 100644 --- a/server_addon/nuke/server/version.py +++ b/server_addon/nuke/server/version.py @@ -1 +1 @@ -__version__ = "0.1.10" +__version__ = "0.1.11" From 85140058ee6d4397485b33974abb78f7509a88f0 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 12 Apr 2024 15:34:47 +0100 Subject: [PATCH 03/50] Code cosmetics --- client/ayon_core/hosts/nuke/api/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 9528ad3d4c..a11f6e023b 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -209,16 +209,16 @@ def _submit_headless_farm(node): # Find instance for node and workfile. instance = None instance_workfile = None - for Instance in context: - if Instance.data["family"] == "workfile": - instance_workfile = Instance + for _instance in context: + if _instance.data["family"] == "workfile": + instance_workfile = _instance continue - instance_node = Instance.data["transientData"]["node"] + instance_node = _instance.data["transientData"]["node"] if node.name() == instance_node.name(): - instance = Instance + instance = _instance else: - Instance.data["active"] = False + _instance.data["active"] = False if instance is None: show_message_dialog( From cd45e9a41c3be122d5b8b95ab11f1234dd77bda8 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 12 Apr 2024 15:43:31 +0100 Subject: [PATCH 04/50] docstring --- client/ayon_core/hosts/nuke/api/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index a11f6e023b..56ba581e1c 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -196,6 +196,16 @@ def submit_headless_farm(node): def _submit_headless_farm(node): + """Headless farm submission + + This function prepares the context for farm submission, validates it, + extracts relevant data, copies the current workfile to a timestamped copy, + and submits the job to the farm. + + Args: + node (Node): The node for which the farm submission is being made. + """ + context = util.collect() success, error_report = create_error_report(context) From 4f70d30ea59c2ef6cde9383edea860a7bfc154bb Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 12 Apr 2024 15:47:12 +0100 Subject: [PATCH 05/50] docstring --- client/ayon_core/hosts/nuke/api/utils.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 56ba581e1c..94582f75f1 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -152,6 +152,19 @@ def is_headless(): def create_error_report(context): + """Create an error report based on the given pyblish context. + + This function iterates through the results in the context and formats any + errors into a comprehensive error report. + + Args: + context (dict): Pyblish context. + + Returns: + tuple: A tuple containing a boolean indicating success and a string + representing the error message. + """ + error_message = "" success = True for result in context.data["results"]: From 756e1f93642d47e8e96cdfb55b9d1b51f09b06b9 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 12 Apr 2024 16:42:29 +0100 Subject: [PATCH 06/50] Deactivate workfile instance. --- client/ayon_core/hosts/nuke/api/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 94582f75f1..8f0dfd0713 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -235,6 +235,7 @@ def _submit_headless_farm(node): for _instance in context: if _instance.data["family"] == "workfile": instance_workfile = _instance + _instance.data["active"] = False continue instance_node = _instance.data["transientData"]["node"] From 4fcab3ca36d1efc6d2e56c2ec89c72184a19e1d8 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 15 Apr 2024 10:26:22 +0100 Subject: [PATCH 07/50] Remove redundant code. --- client/ayon_core/hosts/nuke/api/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 8f0dfd0713..e608863648 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -254,7 +254,6 @@ def _submit_headless_farm(node): # Enable for farm publishing. instance.data["farm"] = True - instance.data["transfer"] = False # Clear the families as we only want the main family, ei. no review etc. instance.data["families"] = [] From b6a5eadf96828d3a84ff680ccbd590ce90ea11f6 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Mon, 15 Apr 2024 12:26:22 +0100 Subject: [PATCH 08/50] Update client/ayon_core/hosts/nuke/api/lib.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/hosts/nuke/api/lib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index 63e6ddef0f..aa44f7c98c 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -1163,8 +1163,10 @@ def create_write_node( if char in special_characters: found_special_characters.append(char) - msg = f"Special characters found in name \"{name}\": " - msg += f"{' '.join(found_special_characters)}" + msg = ( + f"Special characters found in name \"{name}\": " + f"{' '.join(found_special_characters)}" + ) assert not found_special_characters, msg prenodes = prenodes or [] From acacf15723e8cf99fcc3cbe194e49612b6dcb53d Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 30 Apr 2024 15:24:34 +0100 Subject: [PATCH 09/50] Code cosmetics --- .../hosts/nuke/plugins/create/create_write_render.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py b/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py index 16bce64ec6..5340fbdecc 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py +++ b/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py @@ -41,14 +41,16 @@ class CreateWriteRender(napi.NukeWriteCreator): def create_instance_node(self, product_name, instance_data): settings = self.project_settings["nuke"]["create"]["CreateWriteRender"] - settings = settings["instance_attributes"] + instance_attributes = settings["instance_attributes"] # add fpath_template write_data = { "creator": self.__class__.__name__, "productName": product_name, "fpath_template": self.temp_rendering_path_template, - "headless_farm_submission": "headless_farm_submission" in settings + "headless_farm_submission": ( + "headless_farm_submission" in instance_attributes + ) } write_data.update(instance_data) From 0462d38445f9b4a66635e0ba3bcd9dfd4cf28a46 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 2 May 2024 15:11:56 +0100 Subject: [PATCH 10/50] Use pyblish plugins instead of code outside of publishing. --- client/ayon_core/hosts/nuke/api/utils.py | 107 ++---------------- .../plugins/publish/collect_headless_farm.py | 41 +++++++ .../plugins/publish/extract_headless_farm.py | 35 ++++++ 3 files changed, 88 insertions(+), 95 deletions(-) create mode 100644 client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py create mode 100644 client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index e608863648..a5d9bfb323 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -1,17 +1,16 @@ import os import re import traceback -from datetime import datetime -import shutil import nuke -from pyblish import util +from pyblish import util, api from qtpy import QtWidgets from ayon_core import resources from ayon_core.pipeline import registered_host from ayon_core.tools.utils import show_message_dialog +from ayon_core.pipeline.create import CreateContext def set_context_favorites(favorites=None): @@ -219,7 +218,16 @@ def _submit_headless_farm(node): node (Node): The node for which the farm submission is being made. """ - context = util.collect() + host = registered_host() + create_context = CreateContext(host) + context = api.Context() + context.data["create_context"] = create_context + # Used in pyblish plugin to determine which instance to publish. + context.data["node_name"] = node.name() + # Used in pyblish plugins to determine whether to run or not. + context.data["headless_farm"] = True + + context = util.publish(context) success, error_report = create_error_report(context) @@ -228,94 +236,3 @@ def _submit_headless_farm(node): "Collection Errors", error_report, level="critical" ) return - - # Find instance for node and workfile. - instance = None - instance_workfile = None - for _instance in context: - if _instance.data["family"] == "workfile": - instance_workfile = _instance - _instance.data["active"] = False - continue - - instance_node = _instance.data["transientData"]["node"] - if node.name() == instance_node.name(): - instance = _instance - else: - _instance.data["active"] = False - - if instance is None: - show_message_dialog( - "Collection Error", - "Could not find the instance from the node.", - level="critical" - ) - return - - # Enable for farm publishing. - instance.data["farm"] = True - - # Clear the families as we only want the main family, ei. no review etc. - instance.data["families"] = [] - - # Use the workfile instead of published. - publish_attributes = instance.data["publish_attributes"] - publish_attributes["NukeSubmitDeadline"]["use_published_workfile"] = False - - # Disable version validation. - instance.data.pop("latestVersion") - instance_workfile.data.pop("latestVersion") - - # Validate - util.validate(context) - - success, error_report = create_error_report(context) - - if not success: - show_message_dialog( - "Validation Errors", error_report, level="critical" - ) - return - - # Extraction. - util.extract(context) - - success, error_report = create_error_report(context) - - if not success: - show_message_dialog( - "Extraction Errors", error_report, level="critical" - ) - return - - # Copy the workfile to a timestamped copy. - host = registered_host() - current_datetime = datetime.now() - formatted_timestamp = current_datetime.strftime("%Y%m%d%H%M%S") - base, ext = os.path.splitext(host.current_file()) - - directory = os.path.join(os.path.dirname(base), "farm_submissions") - if not os.path.exists(directory): - os.makedirs(directory) - - filename = "{}_{}{}".format( - os.path.basename(base), formatted_timestamp, ext - ) - path = os.path.join(directory, filename).replace("\\", "/") - context.data["currentFile"] = path - shutil.copy(host.current_file(), path) - - # Continue to submission. - util.integrate(context) - - success, error_report = create_error_report(context) - - if not success: - show_message_dialog( - "Extraction Errors", error_report, level="critical" - ) - return - - show_message_dialog( - "Submission Successful", "Submission to the farm was successful." - ) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py new file mode 100644 index 0000000000..9bcdd199f3 --- /dev/null +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -0,0 +1,41 @@ +import pyblish.api + + +class CollectHeadlessFarm(pyblish.api.InstancePlugin): + """Setup instances for headless farm submission.""" + + order = pyblish.api.CollectorOrder + 0.4999 + label = "Collect Headless Farm" + hosts = ["nuke"] + + def process(self, instance): + if not instance.context.data.get("headless_farm", False): + return + + if instance.data["family"] == "workfile": + instance.data["active"] = False + + # Disable version validation. + instance.data.pop("latestVersion") + return + + # Filter out all other instances. + node = instance.data["transientData"]["node"] + if node.name() != instance.context.data["node_name"]: + instance.data["active"] = False + return + + # Enable for farm publishing. + instance.data["farm"] = True + + # Clear the families as we only want the main family, ei. no review + # etc. + instance.data["families"] = [] + + # Use the workfile instead of published. + settings = instance.data["publish_attributes"] + settings = settings["NukeSubmitDeadline"] + settings["use_published_workfile"] = False + + # Disable version validation. + instance.data.pop("latestVersion") diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py new file mode 100644 index 0000000000..be74a05392 --- /dev/null +++ b/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py @@ -0,0 +1,35 @@ +import os +from datetime import datetime +import shutil + +import pyblish.api + +from ayon_core.pipeline import registered_host + + +class ExtractHeadlessFarm(pyblish.api.InstancePlugin): + """Copy the workfile to a timestamped copy.""" + + order = pyblish.api.ExtractorOrder + 0.499 + label = "Extract Headless Farm" + hosts = ["nuke"] + + def process(self, instance): + if not instance.context.data.get("headless_farm", False): + return + + host = registered_host() + current_datetime = datetime.now() + formatted_timestamp = current_datetime.strftime("%Y%m%d%H%M%S") + base, ext = os.path.splitext(host.current_file()) + + directory = os.path.join(os.path.dirname(base), "farm_submissions") + if not os.path.exists(directory): + os.makedirs(directory) + + filename = "{}_{}{}".format( + os.path.basename(base), formatted_timestamp, ext + ) + path = os.path.join(directory, filename).replace("\\", "/") + instance.context.data["currentFile"] = path + shutil.copy(host.current_file(), path) From 81c75841db70d5ac601fc86f18e003f44d4ec11d Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 2 May 2024 15:14:04 +0100 Subject: [PATCH 11/50] increment nuke package --- server_addon/nuke/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/nuke/package.py b/server_addon/nuke/package.py index bf03c4e7e7..e522b9fb5d 100644 --- a/server_addon/nuke/package.py +++ b/server_addon/nuke/package.py @@ -1,3 +1,3 @@ name = "nuke" title = "Nuke" -version = "0.1.11" +version = "0.1.12" From a3c2bb1415b320fad1eabcc617c5d6643e719f8d Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 2 May 2024 15:52:38 +0100 Subject: [PATCH 12/50] Show successfull message. --- client/ayon_core/hosts/nuke/api/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index a5d9bfb323..5ab2e15552 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -236,3 +236,7 @@ def _submit_headless_farm(node): "Collection Errors", error_report, level="critical" ) return + + show_message_dialog( + "Submission Successful", "Submission to the farm was successful." + ) From e5fbb20bdc51a1c7bb8c9707cd3f659ce26e583d Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 2 May 2024 15:52:52 +0100 Subject: [PATCH 13/50] Skip script version increment --- .../hosts/nuke/plugins/publish/increment_script_version.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py b/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py index 6b0be42ba1..f20748b034 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py @@ -13,6 +13,8 @@ class IncrementScriptVersion(pyblish.api.ContextPlugin): hosts = ['nuke'] def process(self, context): + if context.data.get("headless_farm", False): + return assert all(result["success"] for result in context.data["results"]), ( "Publishing not successful so version is not increased.") From ce13e8629fa63c0b6649061400eccfc09d18fcb1 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 3 May 2024 09:49:52 +0100 Subject: [PATCH 14/50] Full imports --- client/ayon_core/hosts/nuke/api/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 5ab2e15552..8eb0339a89 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -4,7 +4,8 @@ import traceback import nuke -from pyblish import util, api +import pyblish.util +import pyblish.api from qtpy import QtWidgets from ayon_core import resources @@ -220,14 +221,14 @@ def _submit_headless_farm(node): host = registered_host() create_context = CreateContext(host) - context = api.Context() + context = pyblish.api.Context() context.data["create_context"] = create_context # Used in pyblish plugin to determine which instance to publish. context.data["node_name"] = node.name() # Used in pyblish plugins to determine whether to run or not. context.data["headless_farm"] = True - context = util.publish(context) + context = pyblish.util.publish(context) success, error_report = create_error_report(context) From 8a971f393c3a2d2f9cecb6afbd910d8f17a76d25 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 7 May 2024 09:25:31 +0100 Subject: [PATCH 15/50] CollectHeadlessFarm > ContextPlugin --- .../plugins/publish/collect_headless_farm.py | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index 9bcdd199f3..b9b5acf0bc 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -1,41 +1,42 @@ import pyblish.api -class CollectHeadlessFarm(pyblish.api.InstancePlugin): +class CollectHeadlessFarm(pyblish.api.ContextPlugin): """Setup instances for headless farm submission.""" order = pyblish.api.CollectorOrder + 0.4999 label = "Collect Headless Farm" hosts = ["nuke"] - def process(self, instance): - if not instance.context.data.get("headless_farm", False): - return + def process(self, context): + for instance in context: + if not instance.context.data.get("headless_farm", False): + continue - if instance.data["family"] == "workfile": - instance.data["active"] = False + if instance.data["family"] == "workfile": + instance.data["active"] = False + + # Disable version validation. + instance.data.pop("latestVersion") + continue + + # Filter out all other instances. + node = instance.data["transientData"]["node"] + if node.name() != instance.context.data["node_name"]: + instance.data["active"] = False + continue + + # Enable for farm publishing. + instance.data["farm"] = True + + # Clear the families as we only want the main family, ei. no review + # etc. + instance.data["families"] = [] + + # Use the workfile instead of published. + settings = instance.data["publish_attributes"] + settings = settings["NukeSubmitDeadline"] + settings["use_published_workfile"] = False # Disable version validation. instance.data.pop("latestVersion") - return - - # Filter out all other instances. - node = instance.data["transientData"]["node"] - if node.name() != instance.context.data["node_name"]: - instance.data["active"] = False - return - - # Enable for farm publishing. - instance.data["farm"] = True - - # Clear the families as we only want the main family, ei. no review - # etc. - instance.data["families"] = [] - - # Use the workfile instead of published. - settings = instance.data["publish_attributes"] - settings = settings["NukeSubmitDeadline"] - settings["use_published_workfile"] = False - - # Disable version validation. - instance.data.pop("latestVersion") From 978e7d1be5388fcf3f6bde665917913599f63e7f Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Tue, 7 May 2024 09:46:44 +0100 Subject: [PATCH 16/50] Update client/ayon_core/hosts/nuke/api/lib.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/hosts/nuke/api/lib.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index 2703307400..868c0ada34 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -1155,13 +1155,9 @@ def create_write_node( node (obj): group node with avalon data as Knobs ''' # Ensure name does not contain any invalid characters. - special_characters = set("!@#$%^&*()=[]{}|\\;',.<>/?~+-") - found_special_characters = [] - - # Check each character in the node name - for char in name: - if char in special_characters: - found_special_characters.append(char) + special_chars = re.escape("!@#$%^&*()=[]{}|\\;',.<>/?~+-") + special_chars_regex = re.compile(f"[{special_chars}]") + found_special_characters = list(special_chars_regex.findall(name)) msg = ( f"Special characters found in name \"{name}\": " From e9dc1d4a05efb9c03459da3d652f6806e63f6120 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Tue, 7 May 2024 09:48:58 +0100 Subject: [PATCH 17/50] Update client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../hosts/nuke/plugins/publish/collect_headless_farm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index b9b5acf0bc..73d2450351 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -9,10 +9,10 @@ class CollectHeadlessFarm(pyblish.api.ContextPlugin): hosts = ["nuke"] def process(self, context): - for instance in context: - if not instance.context.data.get("headless_farm", False): - continue + if not context.data.get("headless_farm", False): + return + for instance in context: if instance.data["family"] == "workfile": instance.data["active"] = False From 72116cd976f6fa5ccab07b902cf3a6e60d7d3700 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Tue, 7 May 2024 09:51:42 +0100 Subject: [PATCH 18/50] Update client/ayon_core/hosts/nuke/api/utils.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/hosts/nuke/api/utils.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 8eb0339a89..3752028c91 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -173,26 +173,9 @@ def create_error_report(context): success = False - err = result["error"] - formatted_traceback = "".join( - traceback.format_exception( - type(err), - err, - err.__traceback__ - ) - ) - fname = result["plugin"].__module__ - if 'File "", line' in formatted_traceback: - _, lineno, func, msg = err.traceback - fname = os.path.abspath(fname) - formatted_traceback = formatted_traceback.replace( - 'File "", line', - 'File "{0}", line'.format(fname) - ) - err = result["error"] error_message += "\n" - error_message += formatted_traceback + error_message += err.formatted_traceback return success, error_message From 5b591b602fe8119f68d7cf4656812c5c0cc2911f Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 7 May 2024 10:07:27 +0100 Subject: [PATCH 19/50] Ensure CreateInstance is active. --- client/ayon_core/hosts/nuke/api/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 3752028c91..08e2630cbd 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -204,6 +204,14 @@ def _submit_headless_farm(node): host = registered_host() create_context = CreateContext(host) + + # Ensure CreateInstance is enabled. + for instance in create_context.instances: + if node.name() != instance.transient_data["node"].name(): + continue + + instance.data["active"] = True + context = pyblish.api.Context() context.data["create_context"] = create_context # Used in pyblish plugin to determine which instance to publish. From 54500dbb59d9e6c4ab0ad5625f568aea64c01548 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Tue, 7 May 2024 10:08:29 +0100 Subject: [PATCH 20/50] Update client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../hosts/nuke/plugins/publish/collect_headless_farm.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index 73d2450351..4bdfc28fe9 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -15,9 +15,6 @@ class CollectHeadlessFarm(pyblish.api.ContextPlugin): for instance in context: if instance.data["family"] == "workfile": instance.data["active"] = False - - # Disable version validation. - instance.data.pop("latestVersion") continue # Filter out all other instances. From fd71818d4683b47a3aa43a61e2323fd570dbd5e3 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 7 May 2024 10:11:54 +0100 Subject: [PATCH 21/50] Remove redundant code --- .../hosts/nuke/plugins/publish/collect_headless_farm.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index 4bdfc28fe9..f2af3551d9 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -34,6 +34,3 @@ class CollectHeadlessFarm(pyblish.api.ContextPlugin): settings = instance.data["publish_attributes"] settings = settings["NukeSubmitDeadline"] settings["use_published_workfile"] = False - - # Disable version validation. - instance.data.pop("latestVersion") From d8eb451887e17ad3eb3ca794d29d8f442159cc62 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 7 May 2024 10:30:55 +0100 Subject: [PATCH 22/50] Illicit feedback --- .../hosts/nuke/plugins/publish/collect_headless_farm.py | 6 ++---- .../hosts/nuke/plugins/publish/extract_headless_farm.py | 1 + .../deadline/plugins/publish/submit_nuke_deadline.py | 7 +++++-- client/ayon_core/plugins/publish/validate_version.py | 9 +++++++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index f2af3551d9..dfd294cebc 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -28,9 +28,7 @@ class CollectHeadlessFarm(pyblish.api.ContextPlugin): # Clear the families as we only want the main family, ei. no review # etc. - instance.data["families"] = [] + instance.data["families"] = ["headless_farm"] # Use the workfile instead of published. - settings = instance.data["publish_attributes"] - settings = settings["NukeSubmitDeadline"] - settings["use_published_workfile"] = False + instance.data["use_published_workfile"] = False diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py index be74a05392..003e51aa1a 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py @@ -13,6 +13,7 @@ class ExtractHeadlessFarm(pyblish.api.InstancePlugin): order = pyblish.api.ExtractorOrder + 0.499 label = "Extract Headless Farm" hosts = ["nuke"] + families = ["headless_farm"] def process(self, instance): if not instance.context.data.get("headless_farm", False): diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py index d70cb75bf3..751fb4c46a 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py @@ -128,8 +128,11 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin, render_path = instance.data['path'] script_path = context.data["currentFile"] - use_published_workfile = instance.data["attributeValues"].get( - "use_published_workfile", self.use_published_workfile + use_published_workfile = instance.data.get( + "use_published_workfile", + instance.data["attributeValues"].get( + "use_published_workfile", self.use_published_workfile + ) ) if use_published_workfile: script_path = self._get_published_workfile_path(context) diff --git a/client/ayon_core/plugins/publish/validate_version.py b/client/ayon_core/plugins/publish/validate_version.py index 9031194e8c..25a5757330 100644 --- a/client/ayon_core/plugins/publish/validate_version.py +++ b/client/ayon_core/plugins/publish/validate_version.py @@ -1,8 +1,10 @@ import pyblish.api -from ayon_core.pipeline.publish import PublishValidationError +from ayon_core.pipeline.publish import ( + PublishValidationError, OptionalPyblishPluginMixin +) -class ValidateVersion(pyblish.api.InstancePlugin): +class ValidateVersion(pyblish.api.InstancePlugin, OptionalPyblishPluginMixin): """Validate instance version. AYON does not allow overwriting previously published versions. @@ -18,6 +20,9 @@ class ValidateVersion(pyblish.api.InstancePlugin): active = True def process(self, instance): + if not self.is_active(instance.data): + return + version = instance.data.get("version") latest_version = instance.data.get("latestVersion") From ad7d24c5cfbba3d27f14a69b167ec71b8bc6e819 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 7 May 2024 12:09:20 +0100 Subject: [PATCH 23/50] Disable instances as early as possible. --- .../plugins/publish/collect_headless_farm.py | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index dfd294cebc..5a3d3cc0de 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -4,7 +4,8 @@ import pyblish.api class CollectHeadlessFarm(pyblish.api.ContextPlugin): """Setup instances for headless farm submission.""" - order = pyblish.api.CollectorOrder + 0.4999 + # Needs to be after CollectFromCreateContext + order = pyblish.api.CollectorOrder - 0.4 label = "Collect Headless Farm" hosts = ["nuke"] @@ -23,12 +24,24 @@ class CollectHeadlessFarm(pyblish.api.ContextPlugin): instance.data["active"] = False continue - # Enable for farm publishing. - instance.data["farm"] = True + instance.data["families"].append("headless_farm") - # Clear the families as we only want the main family, ei. no review - # etc. - instance.data["families"] = ["headless_farm"] - # Use the workfile instead of published. - instance.data["use_published_workfile"] = False +class SetupHeadlessFarm(pyblish.api.InstancePlugin): + """Setup instance for headless farm submission.""" + + order = pyblish.api.CollectorOrder + 0.4999 + label = "Setup Headless Farm" + hosts = ["nuke"] + families = ["headless_farm"] + + def process(self, instance): + # Enable for farm publishing. + instance.data["farm"] = True + + # Clear the families as we only want the main family, ei. no review + # etc. + instance.data["families"] = ["headless_farm"] + + # Use the workfile instead of published. + instance.data["use_published_workfile"] = False From 242326093eaa77728d15785904a3db92496579e2 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 17 May 2024 13:12:43 +0200 Subject: [PATCH 24/50] adding nuke into CollectDeadlinePools Refactor host and family lists in CollectDeadlinePools plugin. Added "nuke" to hosts and "prerender" to families. --- .../deadline/plugins/publish/collect_pools.py | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py index 6923c2b16b..2592d358e5 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -26,27 +26,32 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, order = pyblish.api.CollectorOrder + 0.420 label = "Collect Deadline Pools" - hosts = ["aftereffects", - "fusion", - "harmony" - "nuke", - "maya", - "max", - "houdini"] + hosts = [ + "aftereffects", + "fusion", + "harmony", + "maya", + "max", + "houdini", + "nuke", + ] - families = ["render", - "rendering", - "render.farm", - "renderFarm", - "renderlayer", - "maxrender", - "usdrender", - "redshift_rop", - "arnold_rop", - "mantra_rop", - "karma_rop", - "vray_rop", - "publish.hou"] + families = [ + "render", + "prerender", + "rendering", + "render.farm", + "renderFarm", + "renderlayer", + "maxrender", + "usdrender", + "redshift_rop", + "arnold_rop", + "mantra_rop", + "karma_rop", + "vray_rop", + "publish.hou", + ] primary_pool = None secondary_pool = None From a75cb56dc5f31e16184322becd01bc56aa00c7d8 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Thu, 23 May 2024 16:16:07 +0100 Subject: [PATCH 25/50] Update client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../hosts/nuke/plugins/publish/collect_headless_farm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index 5a3d3cc0de..e59c296904 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -44,4 +44,5 @@ class SetupHeadlessFarm(pyblish.api.InstancePlugin): instance.data["families"] = ["headless_farm"] # Use the workfile instead of published. - instance.data["use_published_workfile"] = False + attribute_values = instance.data.setdefault("attributeValues", {}) + attribute_values["use_published_workfile"] = False From 459e9a51c04542da277d80c110c86a06a63bae8e Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Thu, 23 May 2024 16:17:33 +0100 Subject: [PATCH 26/50] Update client/ayon_core/hosts/nuke/api/lib.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/hosts/nuke/api/lib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index 9acd8ecfa9..f1a9418111 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -1027,8 +1027,10 @@ def script_name(): def add_button_headless_farm_submission(node): name = "headlessFarmSubmission" label = "Headless Farm Submission" - value = "from ayon_core.hosts.nuke.api.utils import submit_headless_farm;" - value += "submit_headless_farm(nuke.thisNode())" + value = ( + "from ayon_core.hosts.nuke.api.utils import submit_headless_farm;" + "submit_headless_farm(nuke.thisNode())" + ) knob = nuke.PyScript_Knob(name, label, value) knob.clearFlag(nuke.STARTLINE) node.addKnob(knob) From 3debb92c02f7ed539983f734821bfdda7512e385 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 23 May 2024 17:15:52 +0100 Subject: [PATCH 27/50] Use publish_attributes --- .../nuke/plugins/publish/collect_headless_farm.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index e59c296904..7db2ed117c 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -1,5 +1,9 @@ import pyblish.api +from ayon_core.pipeline.publish import ( + AYONPyblishPluginMixin +) + class CollectHeadlessFarm(pyblish.api.ContextPlugin): """Setup instances for headless farm submission.""" @@ -27,7 +31,7 @@ class CollectHeadlessFarm(pyblish.api.ContextPlugin): instance.data["families"].append("headless_farm") -class SetupHeadlessFarm(pyblish.api.InstancePlugin): +class SetupHeadlessFarm(pyblish.api.InstancePlugin, AYONPyblishPluginMixin): """Setup instance for headless farm submission.""" order = pyblish.api.CollectorOrder + 0.4999 @@ -44,5 +48,6 @@ class SetupHeadlessFarm(pyblish.api.InstancePlugin): instance.data["families"] = ["headless_farm"] # Use the workfile instead of published. - attribute_values = instance.data.setdefault("attributeValues", {}) - attribute_values["use_published_workfile"] = False + publish_attributes = instance.data["publish_attributes"] + plugin_attributes = publish_attributes["NukeSubmitDeadline"] + plugin_attributes["use_published_workfile"] = False From 4c6eb7a84ddff30e7bb028ac2ae4473202df545e Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 23 May 2024 17:16:39 +0100 Subject: [PATCH 28/50] Revert use_published_workfile --- .../deadline/plugins/publish/submit_nuke_deadline.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py index 6e752a5455..db35c2ae67 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py @@ -115,11 +115,8 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin, render_path = instance.data['path'] script_path = context.data["currentFile"] - use_published_workfile = instance.data.get( - "use_published_workfile", - instance.data["attributeValues"].get( - "use_published_workfile", self.use_published_workfile - ) + use_published_workfile = instance.data["attributeValues"].get( + "use_published_workfile", self.use_published_workfile ) if use_published_workfile: script_path = self._get_published_workfile_path(context) From 23ee1caa44ea702212a04b08899757a63a004618 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Thu, 23 May 2024 17:22:00 +0100 Subject: [PATCH 29/50] Update client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../hosts/nuke/plugins/publish/collect_headless_farm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index 7db2ed117c..82b6b2b3e9 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -9,7 +9,7 @@ class CollectHeadlessFarm(pyblish.api.ContextPlugin): """Setup instances for headless farm submission.""" # Needs to be after CollectFromCreateContext - order = pyblish.api.CollectorOrder - 0.4 + order = pyblish.api.CollectorOrder - 0.49 label = "Collect Headless Farm" hosts = ["nuke"] From c8bc9ab0ea30e3f7748f00473ff25210cab3ef32 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 18:54:18 +0200 Subject: [PATCH 30/50] projects model has option to get status items --- .../ayon_core/tools/common_models/projects.py | 94 ++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/tools/common_models/projects.py b/client/ayon_core/tools/common_models/projects.py index 19a38bee21..3911d0c403 100644 --- a/client/ayon_core/tools/common_models/projects.py +++ b/client/ayon_core/tools/common_models/projects.py @@ -5,7 +5,7 @@ import ayon_api import six from ayon_core.style import get_default_entity_icon_color -from ayon_core.lib import CacheItem +from ayon_core.lib import CacheItem, NestedCacheItem PROJECTS_MODEL_SENDER = "projects.model" @@ -17,6 +17,49 @@ class AbstractHierarchyController: pass +class StatusItem: + """Item representing status of project. + + Args: + name (str): Status name ("Not ready"). + color (str): Status color in hex ("#434a56"). + short (str): Short status name ("NRD"). + icon (str): Icon name in MaterialIcons ("fiber_new"). + state (Literal["not_started", "in_progress", "done", "blocked"]): + Status state. + + """ + def __init__(self, name, color, short, icon, state): + self.name = name + self.color = color + self.short = short + self.icon = icon + self.state = state + + def to_data(self): + return { + "name": self.name, + "color": self.color, + "short": self.short, + "icon": self.icon, + "state": self.state, + } + + @classmethod + def from_data(cls, data): + return cls(**data) + + @classmethod + def from_project_item(cls, status_data): + return cls( + name=status_data["name"], + color=status_data["color"], + short=status_data["shortName"], + icon=status_data["icon"], + state=status_data["state"], + ) + + class ProjectItem: """Item representing folder entity on a server. @@ -89,6 +132,9 @@ class ProjectsModel(object): self._projects_cache = CacheItem(default_factory=list) self._project_items_by_name = {} self._projects_by_name = {} + self._project_statuses_cache = NestedCacheItem( + levels=1, default_factory=list + ) self._is_refreshing = False self._controller = controller @@ -97,6 +143,7 @@ class ProjectsModel(object): self._projects_cache.reset() self._project_items_by_name = {} self._projects_by_name = {} + self._project_statuses_cache.reset() def refresh(self): self._refresh_projects_cache() @@ -124,6 +171,34 @@ class ProjectsModel(object): self._projects_by_name[project_name] = entity return self._projects_by_name[project_name] + def get_project_status_items(self, project_name, sender): + """Get project status items. + + Args: + project_name (str): Project name. + sender (Union[str, None]): Name of sender who asked for items. + + Returns: + list[StatusItem]: Status items for project. + + """ + statuses_cache = self._project_statuses_cache[project_name] + if not statuses_cache.is_valid: + with self._project_statuses_refresh_event_manager( + sender, project_name + ): + project_entity = None + if project_name: + project_entity = self.get_project_entity(project_name) + statuses = [] + if project_entity: + statuses = [ + StatusItem.from_project_item(status) + for status in project_entity["statuses"] + ] + statuses_cache.update_data(statuses) + return statuses_cache.get_data() + @contextlib.contextmanager def _project_refresh_event_manager(self, sender): self._is_refreshing = True @@ -143,6 +218,23 @@ class ProjectsModel(object): ) self._is_refreshing = False + @contextlib.contextmanager + def _project_statuses_refresh_event_manager(self, sender, project_name): + self._controller.emit_event( + "projects.statuses.refresh.started", + {"sender": sender, "project_name": project_name}, + PROJECTS_MODEL_SENDER + ) + try: + yield + + finally: + self._controller.emit_event( + "projects.statuses.refresh.finished", + {"sender": sender, "project_name": project_name}, + PROJECTS_MODEL_SENDER + ) + def _refresh_projects_cache(self, sender=None): if self._is_refreshing: return None From c575420bb579f73cf1f4a738c85141b9b4203298 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 18:55:00 +0200 Subject: [PATCH 31/50] project entities are cached values --- .../ayon_core/tools/common_models/projects.py | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/tools/common_models/projects.py b/client/ayon_core/tools/common_models/projects.py index 3911d0c403..d14963a4e9 100644 --- a/client/ayon_core/tools/common_models/projects.py +++ b/client/ayon_core/tools/common_models/projects.py @@ -131,10 +131,12 @@ class ProjectsModel(object): def __init__(self, controller): self._projects_cache = CacheItem(default_factory=list) self._project_items_by_name = {} - self._projects_by_name = {} self._project_statuses_cache = NestedCacheItem( levels=1, default_factory=list ) + self._projects_by_name = NestedCacheItem( + levels=1, default_factory=list + ) self._is_refreshing = False self._controller = controller @@ -142,8 +144,8 @@ class ProjectsModel(object): def reset(self): self._projects_cache.reset() self._project_items_by_name = {} - self._projects_by_name = {} self._project_statuses_cache.reset() + self._projects_by_name.reset() def refresh(self): self._refresh_projects_cache() @@ -164,12 +166,23 @@ class ProjectsModel(object): return self._projects_cache.get_data() def get_project_entity(self, project_name): - if project_name not in self._projects_by_name: + """Get project entity. + + Args: + project_name (str): Project name. + + Returns: + Union[dict[str, Any], None]: Project entity or None if project + was not found by name. + + """ + project_cache = self._projects_by_name[project_name] + if not project_cache.is_valid: entity = None if project_name: entity = ayon_api.get_project(project_name) - self._projects_by_name[project_name] = entity - return self._projects_by_name[project_name] + project_cache.update_data(entity) + return project_cache.get_data() def get_project_status_items(self, project_name, sender): """Get project status items. From 66122bfabe5fea58776ff5e2846ab8d3ef3eb27a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 18:55:28 +0200 Subject: [PATCH 32/50] removed unused attribute --- client/ayon_core/tools/common_models/projects.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/ayon_core/tools/common_models/projects.py b/client/ayon_core/tools/common_models/projects.py index d14963a4e9..fa308de0a9 100644 --- a/client/ayon_core/tools/common_models/projects.py +++ b/client/ayon_core/tools/common_models/projects.py @@ -130,7 +130,6 @@ def _get_project_items_from_entitiy(projects): class ProjectsModel(object): def __init__(self, controller): self._projects_cache = CacheItem(default_factory=list) - self._project_items_by_name = {} self._project_statuses_cache = NestedCacheItem( levels=1, default_factory=list ) @@ -143,7 +142,6 @@ class ProjectsModel(object): def reset(self): self._projects_cache.reset() - self._project_items_by_name = {} self._project_statuses_cache.reset() self._projects_by_name.reset() From d572f929c2512c7ceea59fdba1cc480bee78f30a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 18:55:40 +0200 Subject: [PATCH 33/50] use helper method to create ProjectItem --- .../ayon_core/tools/common_models/projects.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/tools/common_models/projects.py b/client/ayon_core/tools/common_models/projects.py index fa308de0a9..5df7178bcc 100644 --- a/client/ayon_core/tools/common_models/projects.py +++ b/client/ayon_core/tools/common_models/projects.py @@ -83,6 +83,23 @@ class ProjectItem: } self.icon = icon + @classmethod + def from_entity(cls, project_entity): + """Creates folder item from entity. + + Args: + project_entity (dict[str, Any]): Project entity. + + Returns: + ProjectItem: Project item. + + """ + return cls( + project_entity["name"], + project_entity["active"], + project_entity["library"], + ) + def to_data(self): """Converts folder item to data. @@ -122,7 +139,7 @@ def _get_project_items_from_entitiy(projects): """ return [ - ProjectItem(project["name"], project["active"], project["library"]) + ProjectItem.from_entity(project) for project in projects ] From 1c282b1bbb80266b3e7241111aefbe102651c695 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 18:55:51 +0200 Subject: [PATCH 34/50] add docstring to 'refresh' method --- client/ayon_core/tools/common_models/projects.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/ayon_core/tools/common_models/projects.py b/client/ayon_core/tools/common_models/projects.py index 5df7178bcc..89dd881a10 100644 --- a/client/ayon_core/tools/common_models/projects.py +++ b/client/ayon_core/tools/common_models/projects.py @@ -163,6 +163,13 @@ class ProjectsModel(object): self._projects_by_name.reset() def refresh(self): + """Refresh project items. + + This method will requery list of ProjectItem returned by + 'get_project_items'. + + To reset all cached items use 'reset' method. + """ self._refresh_projects_cache() def get_project_items(self, sender): From 235cd4b69b2c158aa2424173b2a647d99c9f50b9 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 18:56:16 +0200 Subject: [PATCH 35/50] prepare backend for status value --- client/ayon_core/tools/loader/abstract.py | 25 +++++++++++++++++++ client/ayon_core/tools/loader/control.py | 5 ++++ .../ayon_core/tools/loader/models/products.py | 6 ++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/tools/loader/abstract.py b/client/ayon_core/tools/loader/abstract.py index 7a7d335092..509db4d037 100644 --- a/client/ayon_core/tools/loader/abstract.py +++ b/client/ayon_core/tools/loader/abstract.py @@ -114,6 +114,7 @@ class VersionItem: thumbnail_id (Union[str, None]): Thumbnail id. published_time (Union[str, None]): Published time in format '%Y%m%dT%H%M%SZ'. + status (Union[str, None]): Status name. author (Union[str, None]): Author. frame_range (Union[str, None]): Frame range. duration (Union[int, None]): Duration. @@ -132,6 +133,7 @@ class VersionItem: thumbnail_id, published_time, author, + status, frame_range, duration, handles, @@ -146,6 +148,7 @@ class VersionItem: self.is_hero = is_hero self.published_time = published_time self.author = author + self.status = status self.frame_range = frame_range self.duration = duration self.handles = handles @@ -185,6 +188,7 @@ class VersionItem: "is_hero": self.is_hero, "published_time": self.published_time, "author": self.author, + "status": self.status, "frame_range": self.frame_range, "duration": self.duration, "handles": self.handles, @@ -488,6 +492,27 @@ class FrontendLoaderController(_BaseLoaderController): pass + @abstractmethod + def get_project_status_items(self, project_name, sender=None): + """Items for all projects available on server. + + Triggers event topics "projects.statuses.refresh.started" and + "projects.statuses.refresh.finished" with data: + { + "sender": sender, + "project_name": project_name + } + + Args: + project_name (Union[str, None]): Project name. + sender (Optional[str]): Sender who requested the items. + + Returns: + list[StatusItem]: List of status items. + """ + + pass + @abstractmethod def get_product_items(self, project_name, folder_ids, sender=None): """Product items for folder ids. diff --git a/client/ayon_core/tools/loader/control.py b/client/ayon_core/tools/loader/control.py index 0c9bb369c7..35188369c2 100644 --- a/client/ayon_core/tools/loader/control.py +++ b/client/ayon_core/tools/loader/control.py @@ -180,6 +180,11 @@ class LoaderController(BackendLoaderController, FrontendLoaderController): def get_project_items(self, sender=None): return self._projects_model.get_project_items(sender) + def get_project_status_items(self, project_name, sender=None): + return self._projects_model.get_project_status_items( + project_name, sender + ) + def get_folder_items(self, project_name, sender=None): return self._hierarchy_model.get_folder_items(project_name, sender) diff --git a/client/ayon_core/tools/loader/models/products.py b/client/ayon_core/tools/loader/models/products.py index a3bbc30a09..c9325c4480 100644 --- a/client/ayon_core/tools/loader/models/products.py +++ b/client/ayon_core/tools/loader/models/products.py @@ -58,6 +58,7 @@ def version_item_from_entity(version): thumbnail_id=version["thumbnailId"], published_time=published_time, author=author, + status=version["status"], frame_range=frame_range, duration=duration, handles=handles, @@ -526,8 +527,11 @@ class ProductsModel: products = list(ayon_api.get_products(project_name, **kwargs)) product_ids = {product["id"] for product in products} + # Add 'status' to fields -> fixed in ayon-python-api 1.0.4 + fields = ayon_api.get_default_fields_for_type("version") + fields.add("status") versions = ayon_api.get_versions( - project_name, product_ids=product_ids + project_name, product_ids=product_ids, fields=fields ) return self._create_product_items( From f9efd8f05d5adb726d2d9f3c7dab15de3d18a70c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 18:56:27 +0200 Subject: [PATCH 36/50] added status column in UI --- .../tools/loader/ui/products_model.py | 96 ++++++++++++------- 1 file changed, 60 insertions(+), 36 deletions(-) diff --git a/client/ayon_core/tools/loader/ui/products_model.py b/client/ayon_core/tools/loader/ui/products_model.py index b465679c3b..76da76dbfb 100644 --- a/client/ayon_core/tools/loader/ui/products_model.py +++ b/client/ayon_core/tools/loader/ui/products_model.py @@ -22,18 +22,22 @@ VERSION_HERO_ROLE = QtCore.Qt.UserRole + 11 VERSION_NAME_ROLE = QtCore.Qt.UserRole + 12 VERSION_NAME_EDIT_ROLE = QtCore.Qt.UserRole + 13 VERSION_PUBLISH_TIME_ROLE = QtCore.Qt.UserRole + 14 -VERSION_AUTHOR_ROLE = QtCore.Qt.UserRole + 15 -VERSION_FRAME_RANGE_ROLE = QtCore.Qt.UserRole + 16 -VERSION_DURATION_ROLE = QtCore.Qt.UserRole + 17 -VERSION_HANDLES_ROLE = QtCore.Qt.UserRole + 18 -VERSION_STEP_ROLE = QtCore.Qt.UserRole + 19 -VERSION_AVAILABLE_ROLE = QtCore.Qt.UserRole + 20 -VERSION_THUMBNAIL_ID_ROLE = QtCore.Qt.UserRole + 21 -ACTIVE_SITE_ICON_ROLE = QtCore.Qt.UserRole + 22 -REMOTE_SITE_ICON_ROLE = QtCore.Qt.UserRole + 23 -REPRESENTATIONS_COUNT_ROLE = QtCore.Qt.UserRole + 24 -SYNC_ACTIVE_SITE_AVAILABILITY = QtCore.Qt.UserRole + 25 -SYNC_REMOTE_SITE_AVAILABILITY = QtCore.Qt.UserRole + 26 +VERSION_STATUS_NAME_ROLE = QtCore.Qt.UserRole + 15 +VERSION_STATUS_SHORT_ROLE = QtCore.Qt.UserRole + 16 +VERSION_STATUS_COLOR_ROLE = QtCore.Qt.UserRole + 17 +VERSION_STATUS_ROLE = QtCore.Qt.UserRole + 18 +VERSION_AUTHOR_ROLE = QtCore.Qt.UserRole + 19 +VERSION_FRAME_RANGE_ROLE = QtCore.Qt.UserRole + 20 +VERSION_DURATION_ROLE = QtCore.Qt.UserRole + 21 +VERSION_HANDLES_ROLE = QtCore.Qt.UserRole + 22 +VERSION_STEP_ROLE = QtCore.Qt.UserRole + 23 +VERSION_AVAILABLE_ROLE = QtCore.Qt.UserRole + 24 +VERSION_THUMBNAIL_ID_ROLE = QtCore.Qt.UserRole + 25 +ACTIVE_SITE_ICON_ROLE = QtCore.Qt.UserRole + 26 +REMOTE_SITE_ICON_ROLE = QtCore.Qt.UserRole + 27 +REPRESENTATIONS_COUNT_ROLE = QtCore.Qt.UserRole + 28 +SYNC_ACTIVE_SITE_AVAILABILITY = QtCore.Qt.UserRole + 29 +SYNC_REMOTE_SITE_AVAILABILITY = QtCore.Qt.UserRole + 30 class ProductsModel(QtGui.QStandardItemModel): @@ -46,6 +50,7 @@ class ProductsModel(QtGui.QStandardItemModel): "Version", "Time", "Author", + "Status", "Frames", "Duration", "Handles", @@ -69,11 +74,35 @@ class ProductsModel(QtGui.QStandardItemModel): ] ] + product_name_col = column_labels.index("Product name") + product_type_col = column_labels.index("Product type") + folders_label_col = column_labels.index("Folder") version_col = column_labels.index("Version") published_time_col = column_labels.index("Time") - folders_label_col = column_labels.index("Folder") + author_col = column_labels.index("Author") + status_col = column_labels.index("Status") + frame_range_col = column_labels.index("Frames") + duration_col = column_labels.index("Duration") + handles_col = column_labels.index("Handles") + step_col = column_labels.index("Step") in_scene_col = column_labels.index("In scene") sitesync_avail_col = column_labels.index("Availability") + _display_role_mapping = { + product_name_col: QtCore.Qt.DisplayRole, + product_type_col: PRODUCT_TYPE_ROLE, + folders_label_col: FOLDER_LABEL_ROLE, + version_col: VERSION_NAME_ROLE, + published_time_col: VERSION_PUBLISH_TIME_ROLE, + author_col: VERSION_AUTHOR_ROLE, + status_col: VERSION_STATUS_NAME_ROLE, + frame_range_col: VERSION_FRAME_RANGE_ROLE, + duration_col: VERSION_DURATION_ROLE, + handles_col: VERSION_HANDLES_ROLE, + step_col: VERSION_STEP_ROLE, + in_scene_col: PRODUCT_IN_SCENE_ROLE, + sitesync_avail_col: VERSION_AVAILABLE_ROLE, + + } def __init__(self, controller): super(ProductsModel, self).__init__() @@ -96,6 +125,7 @@ class ProductsModel(QtGui.QStandardItemModel): self._last_project_name = None self._last_folder_ids = [] + self._last_project_statuses = {} def get_product_item_indexes(self): return [ @@ -141,6 +171,15 @@ class ProductsModel(QtGui.QStandardItemModel): if not index.isValid(): return None + if role in (VERSION_STATUS_SHORT_ROLE, VERSION_STATUS_COLOR_ROLE): + status_name = self.data(index, VERSION_STATUS_NAME_ROLE) + status_item = self._last_project_statuses.get(status_name) + if status_item is None: + return "" + if role == VERSION_STATUS_SHORT_ROLE: + return status_item.short + return status_item.color + col = index.column() if col == 0: return super(ProductsModel, self).data(index, role) @@ -168,29 +207,8 @@ class ProductsModel(QtGui.QStandardItemModel): if role == QtCore.Qt.DisplayRole: if not index.data(PRODUCT_ID_ROLE): return None - if col == self.version_col: - role = VERSION_NAME_ROLE - elif col == 1: - role = PRODUCT_TYPE_ROLE - elif col == 2: - role = FOLDER_LABEL_ROLE - elif col == 4: - role = VERSION_PUBLISH_TIME_ROLE - elif col == 5: - role = VERSION_AUTHOR_ROLE - elif col == 6: - role = VERSION_FRAME_RANGE_ROLE - elif col == 7: - role = VERSION_DURATION_ROLE - elif col == 8: - role = VERSION_HANDLES_ROLE - elif col == 9: - role = VERSION_STEP_ROLE - elif col == 10: - role = PRODUCT_IN_SCENE_ROLE - elif col == 11: - role = VERSION_AVAILABLE_ROLE - else: + role = self._display_role_mapping.get(col) + if role is None: return None index = self.index(index.row(), 0, index.parent()) @@ -312,6 +330,7 @@ class ProductsModel(QtGui.QStandardItemModel): version_item.published_time, VERSION_PUBLISH_TIME_ROLE ) model_item.setData(version_item.author, VERSION_AUTHOR_ROLE) + model_item.setData(version_item.status, VERSION_STATUS_NAME_ROLE) model_item.setData(version_item.frame_range, VERSION_FRAME_RANGE_ROLE) model_item.setData(version_item.duration, VERSION_DURATION_ROLE) model_item.setData(version_item.handles, VERSION_HANDLES_ROLE) @@ -393,6 +412,11 @@ class ProductsModel(QtGui.QStandardItemModel): self._last_project_name = project_name self._last_folder_ids = folder_ids + status_items = self._controller.get_project_status_items(project_name) + self._last_project_statuses = { + status_item.name: status_item + for status_item in status_items + } active_site_icon_def = self._controller.get_active_site_icon_def( project_name From 3dfe36702904dd9575d1314410a4c1aaca055bd5 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 23 May 2024 22:40:33 +0100 Subject: [PATCH 37/50] Change to Render On Farm --- client/ayon_core/hosts/nuke/api/lib.py | 14 ++--- client/ayon_core/hosts/nuke/api/utils.py | 56 ++++++------------- .../nuke/plugins/create/create_write_image.py | 5 +- .../plugins/create/create_write_prerender.py | 6 +- .../plugins/create/create_write_render.py | 5 +- .../plugins/publish/collect_headless_farm.py | 29 +++++----- .../plugins/publish/extract_headless_farm.py | 8 +-- .../publish/increment_script_version.py | 2 +- server_addon/nuke/package.py | 2 +- .../nuke/server/settings/create_plugins.py | 4 +- 10 files changed, 58 insertions(+), 73 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index f1a9418111..500a0f9601 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -1024,12 +1024,12 @@ def script_name(): return nuke.root().knob("name").value() -def add_button_headless_farm_submission(node): - name = "headlessFarmSubmission" - label = "Headless Farm Submission" +def add_button_render_on_farm(node): + name = "renderOnFarm" + label = "Render On Farm" value = ( - "from ayon_core.hosts.nuke.api.utils import submit_headless_farm;" - "submit_headless_farm(nuke.thisNode())" + "from ayon_core.hosts.nuke.api.utils import submit_render_on_farm;" + "submit_render_on_farm(nuke.thisNode())" ) knob = nuke.PyScript_Knob(name, label, value) knob.clearFlag(nuke.STARTLINE) @@ -1294,8 +1294,8 @@ def create_write_node( GN.addKnob(link) # Adding render farm submission button. - if data.get("headless_farm_submission", False): - add_button_headless_farm_submission(GN) + if data.get("render_on_farm", False): + add_button_render_on_farm(GN) # adding write to read button add_button_write_to_read(GN) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 08e2630cbd..1c9b0b8996 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -1,6 +1,5 @@ import os import re -import traceback import nuke @@ -151,48 +150,19 @@ def is_headless(): return QtWidgets.QApplication.instance() is None -def create_error_report(context): - """Create an error report based on the given pyblish context. - - This function iterates through the results in the context and formats any - errors into a comprehensive error report. - - Args: - context (dict): Pyblish context. - - Returns: - tuple: A tuple containing a boolean indicating success and a string - representing the error message. - """ - - error_message = "" - success = True - for result in context.data["results"]: - if result["success"]: - continue - - success = False - - err = result["error"] - error_message += "\n" - error_message += err.formatted_traceback - - return success, error_message - - -def submit_headless_farm(node): +def submit_render_on_farm(node): # Ensure code is executed in root context. if nuke.root() == nuke.thisNode(): - _submit_headless_farm(node) + _submit_render_on_farm(node) else: # If not in root context, move to the root context and then execute the # code. with nuke.root(): - _submit_headless_farm(node) + _submit_render_on_farm(node) -def _submit_headless_farm(node): - """Headless farm submission +def _submit_render_on_farm(node): + """Render on farm submission This function prepares the context for farm submission, validates it, extracts relevant data, copies the current workfile to a timestamped copy, @@ -217,15 +187,25 @@ def _submit_headless_farm(node): # Used in pyblish plugin to determine which instance to publish. context.data["node_name"] = node.name() # Used in pyblish plugins to determine whether to run or not. - context.data["headless_farm"] = True + context.data["render_on_farm"] = True context = pyblish.util.publish(context) - success, error_report = create_error_report(context) + error_message = "" + success = True + for result in context.data["results"]: + if result["success"]: + continue + + success = False + + err = result["error"] + error_message += "\n" + error_message += err.formatted_traceback if not success: show_message_dialog( - "Collection Errors", error_report, level="critical" + "Publish Errors", error_message, level="critical" ) return diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py b/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py index 046b99f6b0..fc2538f23d 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py +++ b/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py @@ -66,14 +66,15 @@ class CreateWriteImage(napi.NukeWriteCreator): def create_instance_node(self, product_name, instance_data): settings = self.project_settings["nuke"]["create"]["CreateWriteImage"] - settings = settings["instance_attributes"] # add fpath_template write_data = { "creator": self.__class__.__name__, "productName": product_name, "fpath_template": self.temp_rendering_path_template, - "headless_farm_submission": "headless_farm_submission" in settings + "render_on_farm": ( + "render_on_farm" in settings["instance_attributes"] + ) } write_data.update(instance_data) diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py b/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py index df906c9c25..47796d159c 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py +++ b/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py @@ -47,14 +47,16 @@ class CreateWritePrerender(napi.NukeWriteCreator): def create_instance_node(self, product_name, instance_data): settings = self.project_settings["nuke"]["create"] - settings = settings["CreateWritePrerender"]["instance_attributes"] + settings = settings["CreateWritePrerender"] # add fpath_template write_data = { "creator": self.__class__.__name__, "productName": product_name, "fpath_template": self.temp_rendering_path_template, - "headless_farm_submission": "headless_farm_submission" in settings + "render_on_farm": ( + "render_on_farm" in settings["instance_attributes"] + ) } write_data.update(instance_data) diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py b/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py index 5340fbdecc..4cb5ccdfa2 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py +++ b/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py @@ -41,15 +41,14 @@ class CreateWriteRender(napi.NukeWriteCreator): def create_instance_node(self, product_name, instance_data): settings = self.project_settings["nuke"]["create"]["CreateWriteRender"] - instance_attributes = settings["instance_attributes"] # add fpath_template write_data = { "creator": self.__class__.__name__, "productName": product_name, "fpath_template": self.temp_rendering_path_template, - "headless_farm_submission": ( - "headless_farm_submission" in instance_attributes + "render_on_farm": ( + "render_on_farm" in settings["instance_attributes"] ) } diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py index 82b6b2b3e9..3f49a2bf01 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py @@ -5,16 +5,16 @@ from ayon_core.pipeline.publish import ( ) -class CollectHeadlessFarm(pyblish.api.ContextPlugin): - """Setup instances for headless farm submission.""" +class CollectRenderOnFarm(pyblish.api.ContextPlugin): + """Setup instances for render on farm submission.""" # Needs to be after CollectFromCreateContext order = pyblish.api.CollectorOrder - 0.49 - label = "Collect Headless Farm" + label = "Collect Render On Farm" hosts = ["nuke"] def process(self, context): - if not context.data.get("headless_farm", False): + if not context.data.get("render_on_farm", False): return for instance in context: @@ -28,24 +28,27 @@ class CollectHeadlessFarm(pyblish.api.ContextPlugin): instance.data["active"] = False continue - instance.data["families"].append("headless_farm") + instance.data["families"].append("render_on_farm") + + # Enable for farm publishing. + instance.data["farm"] = True + + # Skip workfile version incremental save. + instance.context.data["increment_script_version"] = False -class SetupHeadlessFarm(pyblish.api.InstancePlugin, AYONPyblishPluginMixin): - """Setup instance for headless farm submission.""" +class SetupRenderOnFarm(pyblish.api.InstancePlugin, AYONPyblishPluginMixin): + """Setup instance for render on farm submission.""" order = pyblish.api.CollectorOrder + 0.4999 - label = "Setup Headless Farm" + label = "Setup Render On Farm" hosts = ["nuke"] - families = ["headless_farm"] + families = ["render_on_farm"] def process(self, instance): - # Enable for farm publishing. - instance.data["farm"] = True - # Clear the families as we only want the main family, ei. no review # etc. - instance.data["families"] = ["headless_farm"] + instance.data["families"] = ["render_on_farm"] # Use the workfile instead of published. publish_attributes = instance.data["publish_attributes"] diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py b/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py index 003e51aa1a..4ba55f8c46 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py @@ -7,16 +7,16 @@ import pyblish.api from ayon_core.pipeline import registered_host -class ExtractHeadlessFarm(pyblish.api.InstancePlugin): +class ExtractRenderOnFarm(pyblish.api.InstancePlugin): """Copy the workfile to a timestamped copy.""" order = pyblish.api.ExtractorOrder + 0.499 - label = "Extract Headless Farm" + label = "Extract Render On Farm" hosts = ["nuke"] - families = ["headless_farm"] + families = ["render_on_farm"] def process(self, instance): - if not instance.context.data.get("headless_farm", False): + if not instance.context.data.get("render_on_farm", False): return host = registered_host() diff --git a/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py b/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py index f20748b034..70fd04a985 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py @@ -13,7 +13,7 @@ class IncrementScriptVersion(pyblish.api.ContextPlugin): hosts = ['nuke'] def process(self, context): - if context.data.get("headless_farm", False): + if not context.data.get("increment_script_version", True): return assert all(result["success"] for result in context.data["results"]), ( diff --git a/server_addon/nuke/package.py b/server_addon/nuke/package.py index bc166bd14e..d8decef208 100644 --- a/server_addon/nuke/package.py +++ b/server_addon/nuke/package.py @@ -1,3 +1,3 @@ name = "nuke" title = "Nuke" -version = "0.1.13" +version = "0.1.14" diff --git a/server_addon/nuke/server/settings/create_plugins.py b/server_addon/nuke/server/settings/create_plugins.py index 897a467118..e4a0f9c938 100644 --- a/server_addon/nuke/server/settings/create_plugins.py +++ b/server_addon/nuke/server/settings/create_plugins.py @@ -14,8 +14,8 @@ def instance_attributes_enum(): {"value": "farm_rendering", "label": "Farm rendering"}, {"value": "use_range_limit", "label": "Use range limit"}, { - "value": "headless_farm_submission", - "label": "Headless Farm Submission" + "value": "render_on_farm", + "label": "Render On Farm" } ] From cc5e18149788538c4db76f09aa0fe64dfdf2efa2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:12:36 +0200 Subject: [PATCH 38/50] remove redundand roles --- .../tools/loader/ui/products_model.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/client/ayon_core/tools/loader/ui/products_model.py b/client/ayon_core/tools/loader/ui/products_model.py index 76da76dbfb..dedd68abfe 100644 --- a/client/ayon_core/tools/loader/ui/products_model.py +++ b/client/ayon_core/tools/loader/ui/products_model.py @@ -25,19 +25,18 @@ VERSION_PUBLISH_TIME_ROLE = QtCore.Qt.UserRole + 14 VERSION_STATUS_NAME_ROLE = QtCore.Qt.UserRole + 15 VERSION_STATUS_SHORT_ROLE = QtCore.Qt.UserRole + 16 VERSION_STATUS_COLOR_ROLE = QtCore.Qt.UserRole + 17 -VERSION_STATUS_ROLE = QtCore.Qt.UserRole + 18 -VERSION_AUTHOR_ROLE = QtCore.Qt.UserRole + 19 -VERSION_FRAME_RANGE_ROLE = QtCore.Qt.UserRole + 20 -VERSION_DURATION_ROLE = QtCore.Qt.UserRole + 21 -VERSION_HANDLES_ROLE = QtCore.Qt.UserRole + 22 -VERSION_STEP_ROLE = QtCore.Qt.UserRole + 23 -VERSION_AVAILABLE_ROLE = QtCore.Qt.UserRole + 24 -VERSION_THUMBNAIL_ID_ROLE = QtCore.Qt.UserRole + 25 -ACTIVE_SITE_ICON_ROLE = QtCore.Qt.UserRole + 26 -REMOTE_SITE_ICON_ROLE = QtCore.Qt.UserRole + 27 -REPRESENTATIONS_COUNT_ROLE = QtCore.Qt.UserRole + 28 -SYNC_ACTIVE_SITE_AVAILABILITY = QtCore.Qt.UserRole + 29 -SYNC_REMOTE_SITE_AVAILABILITY = QtCore.Qt.UserRole + 30 +VERSION_AUTHOR_ROLE = QtCore.Qt.UserRole + 18 +VERSION_FRAME_RANGE_ROLE = QtCore.Qt.UserRole + 19 +VERSION_DURATION_ROLE = QtCore.Qt.UserRole + 20 +VERSION_HANDLES_ROLE = QtCore.Qt.UserRole + 21 +VERSION_STEP_ROLE = QtCore.Qt.UserRole + 22 +VERSION_AVAILABLE_ROLE = QtCore.Qt.UserRole + 23 +VERSION_THUMBNAIL_ID_ROLE = QtCore.Qt.UserRole + 24 +ACTIVE_SITE_ICON_ROLE = QtCore.Qt.UserRole + 25 +REMOTE_SITE_ICON_ROLE = QtCore.Qt.UserRole + 26 +REPRESENTATIONS_COUNT_ROLE = QtCore.Qt.UserRole + 27 +SYNC_ACTIVE_SITE_AVAILABILITY = QtCore.Qt.UserRole + 28 +SYNC_REMOTE_SITE_AVAILABILITY = QtCore.Qt.UserRole + 29 class ProductsModel(QtGui.QStandardItemModel): From 4a70b7d26eb551b5a08f5e4c577bf5f783571e9f Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:13:23 +0200 Subject: [PATCH 39/50] better way how to set delegates --- .../tools/loader/ui/products_widget.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/client/ayon_core/tools/loader/ui/products_widget.py b/client/ayon_core/tools/loader/ui/products_widget.py index d9f027153e..9c6a1dbb85 100644 --- a/client/ayon_core/tools/loader/ui/products_widget.py +++ b/client/ayon_core/tools/loader/ui/products_widget.py @@ -128,20 +128,17 @@ class ProductsWidget(QtWidgets.QWidget): products_view.setColumnWidth(idx, width) version_delegate = VersionDelegate() - products_view.setItemDelegateForColumn( - products_model.version_col, version_delegate) - time_delegate = PrettyTimeDelegate() - products_view.setItemDelegateForColumn( - products_model.published_time_col, time_delegate) - in_scene_delegate = LoadedInSceneDelegate() - products_view.setItemDelegateForColumn( - products_model.in_scene_col, in_scene_delegate) - sitesync_delegate = SiteSyncDelegate() - products_view.setItemDelegateForColumn( - products_model.sitesync_avail_col, sitesync_delegate) + + for col, delegate in ( + (products_model.version_col, version_delegate), + (products_model.published_time_col, time_delegate), + (products_model.in_scene_col, in_scene_delegate), + (products_model.sitesync_avail_col, sitesync_delegate), + ): + products_view.setItemDelegateForColumn(col, delegate) main_layout = QtWidgets.QHBoxLayout(self) main_layout.setContentsMargins(0, 0, 0, 0) From 50c26e3b71068be6695c6eb472ef3a5cbee26031 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:13:43 +0200 Subject: [PATCH 40/50] added delegate for status --- .../tools/loader/ui/products_delegates.py | 46 +++++++++++++++++++ .../tools/loader/ui/products_widget.py | 7 ++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/tools/loader/ui/products_delegates.py b/client/ayon_core/tools/loader/ui/products_delegates.py index 12ed1165ae..6bcb78ec66 100644 --- a/client/ayon_core/tools/loader/ui/products_delegates.py +++ b/client/ayon_core/tools/loader/ui/products_delegates.py @@ -6,6 +6,9 @@ from ayon_core.tools.utils.lib import format_version from .products_model import ( PRODUCT_ID_ROLE, VERSION_NAME_EDIT_ROLE, + VERSION_STATUS_NAME_ROLE, + VERSION_STATUS_SHORT_ROLE, + VERSION_STATUS_COLOR_ROLE, VERSION_ID_ROLE, PRODUCT_IN_SCENE_ROLE, ACTIVE_SITE_ICON_ROLE, @@ -194,6 +197,49 @@ class LoadedInSceneDelegate(QtWidgets.QStyledItemDelegate): option.palette.setBrush(QtGui.QPalette.Text, color) +class StatusDelegate(QtWidgets.QStyledItemDelegate): + """Delegate showing status name and short name.""" + + def paint(self, painter, option, index): + if option.widget: + style = option.widget.style() + else: + style = QtWidgets.QApplication.style() + + style.drawControl( + style.CE_ItemViewItem, option, painter, option.widget + ) + + painter.save() + + text_rect = style.subElementRect(style.SE_ItemViewItemText, option) + text_margin = style.proxy().pixelMetric( + style.PM_FocusFrameHMargin, option, option.widget + ) + 1 + padded_text_rect = text_rect.adjusted( + text_margin, 0, - text_margin, 0 + ) + + fm = QtGui.QFontMetrics(option.font) + text = index.data(VERSION_STATUS_NAME_ROLE) + if padded_text_rect.width() < fm.width(text): + text = index.data(VERSION_STATUS_SHORT_ROLE) + + status_color = index.data(VERSION_STATUS_COLOR_ROLE) + fg_color = QtGui.QColor(status_color) + pen = painter.pen() + pen.setColor(fg_color) + painter.setPen(pen) + + painter.drawText( + padded_text_rect, + option.displayAlignment, + text + ) + + painter.restore() + + class SiteSyncDelegate(QtWidgets.QStyledItemDelegate): """Paints icons and downloaded representation ration for both sites.""" diff --git a/client/ayon_core/tools/loader/ui/products_widget.py b/client/ayon_core/tools/loader/ui/products_widget.py index 9c6a1dbb85..3a30d83d52 100644 --- a/client/ayon_core/tools/loader/ui/products_widget.py +++ b/client/ayon_core/tools/loader/ui/products_widget.py @@ -22,7 +22,8 @@ from .products_model import ( from .products_delegates import ( VersionDelegate, LoadedInSceneDelegate, - SiteSyncDelegate + StatusDelegate, + SiteSyncDelegate, ) from .actions_utils import show_actions_menu @@ -89,6 +90,7 @@ class ProductsWidget(QtWidgets.QWidget): 90, # Product type 130, # Folder label 60, # Version + 100, # Status 125, # Time 75, # Author 75, # Frames @@ -129,12 +131,14 @@ class ProductsWidget(QtWidgets.QWidget): version_delegate = VersionDelegate() time_delegate = PrettyTimeDelegate() + status_delegate = StatusDelegate() in_scene_delegate = LoadedInSceneDelegate() sitesync_delegate = SiteSyncDelegate() for col, delegate in ( (products_model.version_col, version_delegate), (products_model.published_time_col, time_delegate), + (products_model.status_col, status_delegate), (products_model.in_scene_col, in_scene_delegate), (products_model.sitesync_avail_col, sitesync_delegate), ): @@ -172,6 +176,7 @@ class ProductsWidget(QtWidgets.QWidget): self._version_delegate = version_delegate self._time_delegate = time_delegate + self._status_delegate = status_delegate self._in_scene_delegate = in_scene_delegate self._sitesync_delegate = sitesync_delegate From 3c032fc764fe5a20cec2f18e4e2ad18c4dcb1542 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:13:54 +0200 Subject: [PATCH 41/50] move status column after version --- client/ayon_core/tools/loader/ui/products_model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/tools/loader/ui/products_model.py b/client/ayon_core/tools/loader/ui/products_model.py index dedd68abfe..f309473d10 100644 --- a/client/ayon_core/tools/loader/ui/products_model.py +++ b/client/ayon_core/tools/loader/ui/products_model.py @@ -47,9 +47,9 @@ class ProductsModel(QtGui.QStandardItemModel): "Product type", "Folder", "Version", + "Status", "Time", "Author", - "Status", "Frames", "Duration", "Handles", @@ -77,9 +77,9 @@ class ProductsModel(QtGui.QStandardItemModel): product_type_col = column_labels.index("Product type") folders_label_col = column_labels.index("Folder") version_col = column_labels.index("Version") + status_col = column_labels.index("Status") published_time_col = column_labels.index("Time") author_col = column_labels.index("Author") - status_col = column_labels.index("Status") frame_range_col = column_labels.index("Frames") duration_col = column_labels.index("Duration") handles_col = column_labels.index("Handles") @@ -91,9 +91,9 @@ class ProductsModel(QtGui.QStandardItemModel): product_type_col: PRODUCT_TYPE_ROLE, folders_label_col: FOLDER_LABEL_ROLE, version_col: VERSION_NAME_ROLE, + status_col: VERSION_STATUS_NAME_ROLE, published_time_col: VERSION_PUBLISH_TIME_ROLE, author_col: VERSION_AUTHOR_ROLE, - status_col: VERSION_STATUS_NAME_ROLE, frame_range_col: VERSION_FRAME_RANGE_ROLE, duration_col: VERSION_DURATION_ROLE, handles_col: VERSION_HANDLES_ROLE, From 7fd8ca81e4b7c8ef38051c00971f3b8f2c2fc29a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:29:09 +0200 Subject: [PATCH 42/50] move traypublisher next to server codebase --- .../traypublisher/client/ayon_traypublisher}/__init__.py | 0 .../traypublisher/client/ayon_traypublisher}/addon.py | 0 .../traypublisher/client/ayon_traypublisher}/api/__init__.py | 0 .../traypublisher/client/ayon_traypublisher}/api/editorial.py | 0 .../traypublisher/client/ayon_traypublisher}/api/pipeline.py | 0 .../traypublisher/client/ayon_traypublisher}/api/plugin.py | 0 .../traypublisher/client/ayon_traypublisher}/batch_parsing.py | 0 .../traypublisher/client/ayon_traypublisher}/csv_publish.py | 0 .../ayon_traypublisher}/plugins/create/create_colorspace_look.py | 0 .../ayon_traypublisher}/plugins/create/create_csv_ingest.py | 0 .../client/ayon_traypublisher}/plugins/create/create_editorial.py | 0 .../plugins/create/create_editorial_package.py | 0 .../ayon_traypublisher}/plugins/create/create_from_settings.py | 0 .../ayon_traypublisher}/plugins/create/create_movie_batch.py | 0 .../client/ayon_traypublisher}/plugins/create/create_online.py | 0 .../ayon_traypublisher}/plugins/publish/collect_app_name.py | 0 .../ayon_traypublisher}/plugins/publish/collect_clip_instances.py | 0 .../plugins/publish/collect_colorspace_look.py | 0 .../plugins/publish/collect_csv_ingest_instance_data.py | 0 .../plugins/publish/collect_editorial_instances.py | 0 .../plugins/publish/collect_editorial_package.py | 0 .../plugins/publish/collect_editorial_reviewable.py | 0 .../plugins/publish/collect_explicit_colorspace.py | 0 .../plugins/publish/collect_frame_data_from_folder_entity.py | 0 .../ayon_traypublisher}/plugins/publish/collect_movie_batch.py | 0 .../ayon_traypublisher}/plugins/publish/collect_online_file.py | 0 .../ayon_traypublisher}/plugins/publish/collect_review_frames.py | 0 .../plugins/publish/collect_sequence_frame_data.py | 0 .../ayon_traypublisher}/plugins/publish/collect_shot_instances.py | 0 .../plugins/publish/collect_simple_instances.py | 0 .../client/ayon_traypublisher}/plugins/publish/collect_source.py | 0 .../plugins/publish/extract_colorspace_look.py | 0 .../ayon_traypublisher}/plugins/publish/extract_csv_file.py | 0 .../ayon_traypublisher}/plugins/publish/extract_editorial_pckg.py | 0 .../plugins/publish/help/validate_existing_version.xml | 0 .../plugins/publish/help/validate_frame_ranges.xml | 0 .../ayon_traypublisher}/plugins/publish/validate_colorspace.py | 0 .../plugins/publish/validate_colorspace_look.py | 0 .../plugins/publish/validate_editorial_package.py | 0 .../plugins/publish/validate_existing_version.py | 0 .../ayon_traypublisher}/plugins/publish/validate_filepaths.py | 0 .../ayon_traypublisher}/plugins/publish/validate_frame_ranges.py | 0 .../ayon_traypublisher}/plugins/publish/validate_online_file.py | 0 43 files changed, 0 insertions(+), 0 deletions(-) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/__init__.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/addon.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/api/__init__.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/api/editorial.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/api/pipeline.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/api/plugin.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/batch_parsing.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/csv_publish.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/create/create_colorspace_look.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/create/create_csv_ingest.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/create/create_editorial.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/create/create_editorial_package.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/create/create_from_settings.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/create/create_movie_batch.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/create/create_online.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_app_name.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_clip_instances.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_colorspace_look.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_csv_ingest_instance_data.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_editorial_instances.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_editorial_package.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_editorial_reviewable.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_explicit_colorspace.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_frame_data_from_folder_entity.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_movie_batch.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_online_file.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_review_frames.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_sequence_frame_data.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_shot_instances.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_simple_instances.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/collect_source.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/extract_colorspace_look.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/extract_csv_file.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/extract_editorial_pckg.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/help/validate_existing_version.xml (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/help/validate_frame_ranges.xml (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/validate_colorspace.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/validate_colorspace_look.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/validate_editorial_package.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/validate_existing_version.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/validate_filepaths.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/validate_frame_ranges.py (100%) rename {client/ayon_core/hosts/traypublisher => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/validate_online_file.py (100%) diff --git a/client/ayon_core/hosts/traypublisher/__init__.py b/server_addon/traypublisher/client/ayon_traypublisher/__init__.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/__init__.py rename to server_addon/traypublisher/client/ayon_traypublisher/__init__.py diff --git a/client/ayon_core/hosts/traypublisher/addon.py b/server_addon/traypublisher/client/ayon_traypublisher/addon.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/addon.py rename to server_addon/traypublisher/client/ayon_traypublisher/addon.py diff --git a/client/ayon_core/hosts/traypublisher/api/__init__.py b/server_addon/traypublisher/client/ayon_traypublisher/api/__init__.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/api/__init__.py rename to server_addon/traypublisher/client/ayon_traypublisher/api/__init__.py diff --git a/client/ayon_core/hosts/traypublisher/api/editorial.py b/server_addon/traypublisher/client/ayon_traypublisher/api/editorial.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/api/editorial.py rename to server_addon/traypublisher/client/ayon_traypublisher/api/editorial.py diff --git a/client/ayon_core/hosts/traypublisher/api/pipeline.py b/server_addon/traypublisher/client/ayon_traypublisher/api/pipeline.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/api/pipeline.py rename to server_addon/traypublisher/client/ayon_traypublisher/api/pipeline.py diff --git a/client/ayon_core/hosts/traypublisher/api/plugin.py b/server_addon/traypublisher/client/ayon_traypublisher/api/plugin.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/api/plugin.py rename to server_addon/traypublisher/client/ayon_traypublisher/api/plugin.py diff --git a/client/ayon_core/hosts/traypublisher/batch_parsing.py b/server_addon/traypublisher/client/ayon_traypublisher/batch_parsing.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/batch_parsing.py rename to server_addon/traypublisher/client/ayon_traypublisher/batch_parsing.py diff --git a/client/ayon_core/hosts/traypublisher/csv_publish.py b/server_addon/traypublisher/client/ayon_traypublisher/csv_publish.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/csv_publish.py rename to server_addon/traypublisher/client/ayon_traypublisher/csv_publish.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_colorspace_look.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/create/create_colorspace_look.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_csv_ingest.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_csv_ingest.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/create/create_csv_ingest.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_csv_ingest.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/create/create_editorial.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial_package.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial_package.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_from_settings.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_from_settings.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/create/create_from_settings.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_from_settings.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_movie_batch.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_movie_batch.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/create/create_movie_batch.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_movie_batch.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_online.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/create/create_online.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_app_name.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_app_name.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_app_name.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_app_name.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_clip_instances.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_clip_instances.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_clip_instances.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_clip_instances.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_colorspace_look.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_colorspace_look.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_colorspace_look.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_colorspace_look.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_csv_ingest_instance_data.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_csv_ingest_instance_data.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_csv_ingest_instance_data.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_csv_ingest_instance_data.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_instances.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_editorial_instances.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_instances.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_editorial_instances.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_editorial_package.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_editorial_package.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_reviewable.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_editorial_reviewable.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_reviewable.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_editorial_reviewable.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_explicit_colorspace.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_explicit_colorspace.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_explicit_colorspace.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_explicit_colorspace.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_movie_batch.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_movie_batch.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_movie_batch.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_movie_batch.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_online_file.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_online_file.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_online_file.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_online_file.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_review_frames.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_review_frames.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_review_frames.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_review_frames.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_sequence_frame_data.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_sequence_frame_data.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_sequence_frame_data.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_sequence_frame_data.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_shot_instances.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_shot_instances.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_shot_instances.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_shot_instances.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_simple_instances.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_simple_instances.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_simple_instances.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_simple_instances.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_source.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_source.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/collect_source.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/collect_source.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_colorspace_look.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/extract_colorspace_look.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/extract_colorspace_look.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/extract_colorspace_look.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_csv_file.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/extract_csv_file.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/extract_csv_file.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/extract_csv_file.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/extract_editorial_pckg.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/extract_editorial_pckg.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/help/validate_existing_version.xml b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/help/validate_existing_version.xml similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/help/validate_existing_version.xml rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/help/validate_existing_version.xml diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/help/validate_frame_ranges.xml b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/help/validate_frame_ranges.xml similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/help/validate_frame_ranges.xml rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/help/validate_frame_ranges.xml diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_colorspace.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_colorspace.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/validate_colorspace.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_colorspace.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_colorspace_look.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_colorspace_look.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/validate_colorspace_look.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_colorspace_look.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_editorial_package.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_editorial_package.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_existing_version.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_existing_version.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/validate_existing_version.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_existing_version.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_filepaths.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_filepaths.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/validate_filepaths.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_filepaths.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_frame_ranges.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_frame_ranges.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/validate_frame_ranges.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_frame_ranges.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_online_file.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_online_file.py similarity index 100% rename from client/ayon_core/hosts/traypublisher/plugins/publish/validate_online_file.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/validate_online_file.py From a75af77907f2e53860fe2eb6cf3db3e9ff34f015 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:36:26 +0200 Subject: [PATCH 43/50] fix imports --- .../traypublisher/client/ayon_traypublisher/csv_publish.py | 2 +- .../plugins/create/create_colorspace_look.py | 2 +- .../ayon_traypublisher/plugins/create/create_csv_ingest.py | 4 +--- .../ayon_traypublisher/plugins/create/create_editorial.py | 4 ++-- .../plugins/create/create_editorial_package.py | 2 +- .../ayon_traypublisher/plugins/create/create_from_settings.py | 2 +- .../ayon_traypublisher/plugins/create/create_movie_batch.py | 4 ++-- .../client/ayon_traypublisher/plugins/create/create_online.py | 2 +- 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/server_addon/traypublisher/client/ayon_traypublisher/csv_publish.py b/server_addon/traypublisher/client/ayon_traypublisher/csv_publish.py index 2762172936..b7906c5706 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/csv_publish.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/csv_publish.py @@ -6,7 +6,7 @@ from ayon_core.lib.attribute_definitions import FileDefItem from ayon_core.pipeline import install_host from ayon_core.pipeline.create import CreateContext -from ayon_core.hosts.traypublisher.api import TrayPublisherHost +from ayon_traypublisher.api import TrayPublisherHost def csvpublish( diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py index da05afe86b..1cf98e8dab 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py @@ -15,7 +15,7 @@ from ayon_core.pipeline import ( CreatorError ) from ayon_core.pipeline import colorspace -from ayon_core.hosts.traypublisher.api.plugin import TrayPublishCreator +from ayon_traypublisher.api.plugin import TrayPublishCreator class CreateColorspaceLook(TrayPublishCreator): diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_csv_ingest.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_csv_ingest.py index 8143e8b45b..5a5deeada8 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_csv_ingest.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_csv_ingest.py @@ -13,9 +13,7 @@ from ayon_core.lib.transcoding import ( VIDEO_EXTENSIONS, IMAGE_EXTENSIONS ) from ayon_core.pipeline.create import CreatorError -from ayon_core.hosts.traypublisher.api.plugin import ( - TrayPublishCreator -) +from ayon_traypublisher.api.plugin import TrayPublishCreator class IngestCSV(TrayPublishCreator): diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial.py index 4057aee9a6..a2f6f211f5 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial.py @@ -4,11 +4,11 @@ from copy import deepcopy import ayon_api import opentimelineio as otio -from ayon_core.hosts.traypublisher.api.plugin import ( +from ayon_traypublisher.api.plugin import ( TrayPublishCreator, HiddenTrayPublishCreator ) -from ayon_core.hosts.traypublisher.api.editorial import ( +from ayon_traypublisher.api.editorial import ( ShotMetadataSolver ) from ayon_core.pipeline import CreatedInstance diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial_package.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial_package.py index 82b109be28..5f0a84be4a 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial_package.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_editorial_package.py @@ -9,7 +9,7 @@ from ayon_core.lib.attribute_definitions import ( BoolDef, TextDef, ) -from ayon_core.hosts.traypublisher.api.plugin import TrayPublishCreator +from ayon_traypublisher.api.plugin import TrayPublishCreator class EditorialPackageCreator(TrayPublishCreator): diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_from_settings.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_from_settings.py index fe7ba4c4a4..13cf92ab10 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_from_settings.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_from_settings.py @@ -6,7 +6,7 @@ log = Logger.get_logger(__name__) def initialize(): - from ayon_core.hosts.traypublisher.api.plugin import SettingsCreator + from ayon_traypublisher.api.plugin import SettingsCreator project_name = os.environ["AYON_PROJECT_NAME"] project_settings = get_project_settings(project_name) diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_movie_batch.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_movie_batch.py index 546408b4d6..77b9b0df0a 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_movie_batch.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_movie_batch.py @@ -17,8 +17,8 @@ from ayon_core.pipeline.create import ( TaskNotSetError, ) -from ayon_core.hosts.traypublisher.api.plugin import TrayPublishCreator -from ayon_core.hosts.traypublisher.batch_parsing import ( +from ayon_traypublisher.api.plugin import TrayPublishCreator +from ayon_traypublisher.batch_parsing import ( get_folder_entity_from_filename ) diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py index f48037701e..a3d34d3d3a 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py @@ -14,7 +14,7 @@ from ayon_core.pipeline import ( CreatedInstance, CreatorError ) -from ayon_core.hosts.traypublisher.api.plugin import TrayPublishCreator +from ayon_traypublisher.api.plugin import TrayPublishCreator class OnlineCreator(TrayPublishCreator): From bf5d99d90421d5fe83bf102e6a4b60aad6423bcd Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:36:39 +0200 Subject: [PATCH 44/50] use ayon naming --- server_addon/traypublisher/client/ayon_traypublisher/addon.py | 4 ++-- .../traypublisher/client/ayon_traypublisher/api/plugin.py | 2 +- .../plugins/create/create_colorspace_look.py | 2 +- .../client/ayon_traypublisher/plugins/create/create_online.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server_addon/traypublisher/client/ayon_traypublisher/addon.py b/server_addon/traypublisher/client/ayon_traypublisher/addon.py index 3dd275f223..3e72681e1d 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/addon.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/addon.py @@ -29,8 +29,8 @@ class TrayPublishAddon(AYONAddon, IHostAddon, ITrayAction): def on_action_trigger(self): self.run_traypublisher() - def connect_with_addons(self, enabled_modules): - """Collect publish paths from other modules.""" + def connect_with_addons(self, enabled_addons): + """Collect publish paths from other addons.""" publish_paths = self.manager.collect_plugin_paths()["publish"] self.publish_paths.extend(publish_paths) diff --git a/server_addon/traypublisher/client/ayon_traypublisher/api/plugin.py b/server_addon/traypublisher/client/ayon_traypublisher/api/plugin.py index 257d01eb50..973eb65b11 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/api/plugin.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/api/plugin.py @@ -22,7 +22,7 @@ from .pipeline import ( ) REVIEW_EXTENSIONS = set(IMAGE_EXTENSIONS) | set(VIDEO_EXTENSIONS) -SHARED_DATA_KEY = "openpype.traypublisher.instances" +SHARED_DATA_KEY = "ayon.traypublisher.instances" class HiddenTrayPublishCreator(HiddenCreator): diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py index 1cf98e8dab..901bd758ba 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_colorspace_look.py @@ -21,7 +21,7 @@ from ayon_traypublisher.api.plugin import TrayPublishCreator class CreateColorspaceLook(TrayPublishCreator): """Creates colorspace look files.""" - identifier = "io.openpype.creators.traypublisher.colorspace_look" + identifier = "io.ayon.creators.traypublisher.colorspace_look" label = "Colorspace Look" product_type = "ociolook" description = "Publishes color space look file." diff --git a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py index a3d34d3d3a..135a11c0c6 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/plugins/create/create_online.py @@ -20,7 +20,7 @@ from ayon_traypublisher.api.plugin import TrayPublishCreator class OnlineCreator(TrayPublishCreator): """Creates instance from file and retains its original name.""" - identifier = "io.openpype.creators.traypublisher.online" + identifier = "io.ayon.creators.traypublisher.online" label = "Online" product_type = "online" description = "Publish file retaining its original file name" From e043f1930cba54f257b5bd7660c828ef46911ece Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:37:48 +0200 Subject: [PATCH 45/50] move tool to traypublisher addon --- server_addon/traypublisher/client/ayon_traypublisher/addon.py | 4 ++-- .../traypublisher/client/ayon_traypublisher/ui}/__init__.py | 0 .../traypublisher/client/ayon_traypublisher/ui}/window.py | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {client/ayon_core/tools/traypublisher => server_addon/traypublisher/client/ayon_traypublisher/ui}/__init__.py (100%) rename {client/ayon_core/tools/traypublisher => server_addon/traypublisher/client/ayon_traypublisher/ui}/window.py (100%) diff --git a/server_addon/traypublisher/client/ayon_traypublisher/addon.py b/server_addon/traypublisher/client/ayon_traypublisher/addon.py index 3e72681e1d..5432cb1a92 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/addon.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/addon.py @@ -55,9 +55,9 @@ def cli_main(): def launch(): """Launch TrayPublish tool UI.""" - from ayon_core.tools import traypublisher + from ayon_traypublisher import ui - traypublisher.main() + ui.main() @cli_main.command() diff --git a/client/ayon_core/tools/traypublisher/__init__.py b/server_addon/traypublisher/client/ayon_traypublisher/ui/__init__.py similarity index 100% rename from client/ayon_core/tools/traypublisher/__init__.py rename to server_addon/traypublisher/client/ayon_traypublisher/ui/__init__.py diff --git a/client/ayon_core/tools/traypublisher/window.py b/server_addon/traypublisher/client/ayon_traypublisher/ui/window.py similarity index 100% rename from client/ayon_core/tools/traypublisher/window.py rename to server_addon/traypublisher/client/ayon_traypublisher/ui/window.py From a4fa52cb422958d500f2b28c50bec1372e30d8bb Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:39:17 +0200 Subject: [PATCH 46/50] define milestone version --- client/ayon_core/addon/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/addon/base.py b/client/ayon_core/addon/base.py index d49358b0d2..dba25510be 100644 --- a/client/ayon_core/addon/base.py +++ b/client/ayon_core/addon/base.py @@ -52,6 +52,7 @@ IGNORED_MODULES_IN_AYON = set() MOVED_ADDON_MILESTONE_VERSIONS = { "applications": VersionInfo(0, 2, 0), "clockify": VersionInfo(0, 2, 0), + "traypublisher": VersionInfo(0, 2, 0), "tvpaint": VersionInfo(0, 2, 0), } From 5375cabc2b75f9ac045186025e4a8d950fb864b7 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:39:25 +0200 Subject: [PATCH 47/50] updated package.py --- server_addon/traypublisher/package.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server_addon/traypublisher/package.py b/server_addon/traypublisher/package.py index c138a2296d..ea04835b45 100644 --- a/server_addon/traypublisher/package.py +++ b/server_addon/traypublisher/package.py @@ -1,3 +1,10 @@ name = "traypublisher" title = "TrayPublisher" -version = "0.1.5" +version = "0.2.0" + +client_dir = "ayon_traypublisher" + +ayon_required_addons = { + "core": ">0.3.2", +} +ayon_compatible_addons = {} From 0a1989badc7c3f32fac41a2a1745ab7ea8ebec76 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 10:44:11 +0200 Subject: [PATCH 48/50] move extract trim video audio to traypublisher addon --- .../plugins/publish/extract_trim_video_audio.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {client/ayon_core => server_addon/traypublisher/client/ayon_traypublisher}/plugins/publish/extract_trim_video_audio.py (100%) diff --git a/client/ayon_core/plugins/publish/extract_trim_video_audio.py b/server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/extract_trim_video_audio.py similarity index 100% rename from client/ayon_core/plugins/publish/extract_trim_video_audio.py rename to server_addon/traypublisher/client/ayon_traypublisher/plugins/publish/extract_trim_video_audio.py From add37d28c2513499011c9f90659415d702786889 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 24 May 2024 14:10:43 +0200 Subject: [PATCH 49/50] fix import --- .../traypublisher/client/ayon_traypublisher/ui/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/traypublisher/client/ayon_traypublisher/ui/window.py b/server_addon/traypublisher/client/ayon_traypublisher/ui/window.py index 4700e20531..288dac8529 100644 --- a/server_addon/traypublisher/client/ayon_traypublisher/ui/window.py +++ b/server_addon/traypublisher/client/ayon_traypublisher/ui/window.py @@ -13,7 +13,6 @@ import qtawesome from ayon_core.lib import AYONSettingsRegistry, is_running_from_build from ayon_core.pipeline import install_host -from ayon_core.hosts.traypublisher.api import TrayPublisherHost from ayon_core.tools.publisher.control_qt import QtPublisherController from ayon_core.tools.publisher.window import PublisherWindow from ayon_core.tools.common_models import ProjectsModel @@ -24,6 +23,7 @@ from ayon_core.tools.utils import ( ProjectSortFilterProxy, PROJECT_NAME_ROLE, ) +from ayon_traypublisher.api import TrayPublisherHost class TrayPublisherRegistry(AYONSettingsRegistry): From da4da46c9cd5600f56ded8bf5a3985b488796e83 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 24 May 2024 15:28:02 +0200 Subject: [PATCH 50/50] Blacklisting plugins for workfile version validation and incrementing Refactored render submission process to handle plugins differently, bypassing version validation and incrementing by removing specific plugins from the list. --- client/ayon_core/hosts/nuke/api/utils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/client/ayon_core/hosts/nuke/api/utils.py index 1c9b0b8996..646bb0ece1 100644 --- a/client/ayon_core/hosts/nuke/api/utils.py +++ b/client/ayon_core/hosts/nuke/api/utils.py @@ -189,7 +189,17 @@ def _submit_render_on_farm(node): # Used in pyblish plugins to determine whether to run or not. context.data["render_on_farm"] = True - context = pyblish.util.publish(context) + # Since we need to bypass version validation and incrementing, we need to + # remove the plugins from the list that are responsible for these tasks. + plugins = pyblish.api.discover() + blacklist = ["IncrementScriptVersion", "ValidateVersion"] + plugins = [ + plugin + for plugin in plugins + if plugin.__name__ not in blacklist + ] + + context = pyblish.util.publish(context, plugins=plugins) error_message = "" success = True