From c2167056720a93764eb3f4409350820fba476330 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 20 Mar 2024 16:59:48 +0100 Subject: [PATCH 001/269] Blender: Implement USD extractor and loader --- client/ayon_core/hosts/blender/api/lib.py | 59 ++++++++++++++ client/ayon_core/hosts/blender/api/plugin.py | 3 +- .../blender/plugins/create/create_usd.py | 30 +++++++ .../hosts/blender/plugins/load/load_abc.py | 27 +++++-- .../plugins/publish/collect_instance.py | 2 +- .../blender/plugins/publish/extract_usd.py | 79 +++++++++++++++++++ 6 files changed, 190 insertions(+), 10 deletions(-) create mode 100644 client/ayon_core/hosts/blender/plugins/create/create_usd.py create mode 100644 client/ayon_core/hosts/blender/plugins/publish/extract_usd.py diff --git a/client/ayon_core/hosts/blender/api/lib.py b/client/ayon_core/hosts/blender/api/lib.py index 458a275b51..031a25e791 100644 --- a/client/ayon_core/hosts/blender/api/lib.py +++ b/client/ayon_core/hosts/blender/api/lib.py @@ -365,3 +365,62 @@ def maintained_time(): yield finally: bpy.context.scene.frame_current = current_time + + +def get_all_parents(obj): + """Get all recursive parents of object. + + Arguments: + obj (bpy.types.Object): Object to get all parents for. + + Returns: + List[bpy.types.Object]: All parents of object + + """ + result = [] + while True: + obj = obj.parent + if not obj: + break + result.append(obj) + return result + + +def get_highest_root(objects): + """Get the highest object (the least parents) among the objects. + + If multiple objects have the same amount of parents (or no parents) the + first object found in the input iterable will be returned. + + Note that this will *not* return objects outside of the input list, as + such it will not return the root of node from a child node. It is purely + intended to find the highest object among a list of objects. To instead + get the root from one object use, e.g. `get_all_parents(obj)[-1]` + + Arguments: + objects (List[bpy.types.Object]): Objects to find the highest root in. + + Returns: + Optional[bpy.types.Object]: First highest root found or None if no + `bpy.types.Object` found in input list. + + """ + included_objects = {obj.name_full for obj in objects} + num_parents_to_obj = {} + for obj in objects: + if isinstance(obj, bpy.types.Object): + parents = get_all_parents(obj) + # included parents + parents = [parent for parent in parents if + parent.name_full in included_objects] + if not parents: + # A node without parents must be a highest root + return obj + + num_parents_to_obj.setdefault(len(parents), obj) + + if not num_parents_to_obj: + return + + minimum_parent = min(num_parents_to_obj) + return num_parents_to_obj[minimum_parent] diff --git a/client/ayon_core/hosts/blender/api/plugin.py b/client/ayon_core/hosts/blender/api/plugin.py index 6c9bfb6569..383dd1e5c6 100644 --- a/client/ayon_core/hosts/blender/api/plugin.py +++ b/client/ayon_core/hosts/blender/api/plugin.py @@ -26,7 +26,8 @@ from .ops import ( ) from .lib import imprint -VALID_EXTENSIONS = [".blend", ".json", ".abc", ".fbx"] +VALID_EXTENSIONS = [".blend", ".json", ".abc", ".fbx", + ".usd", ".usdc", ".usda"] def prepare_scene_name( diff --git a/client/ayon_core/hosts/blender/plugins/create/create_usd.py b/client/ayon_core/hosts/blender/plugins/create/create_usd.py new file mode 100644 index 0000000000..2c2d0c46c6 --- /dev/null +++ b/client/ayon_core/hosts/blender/plugins/create/create_usd.py @@ -0,0 +1,30 @@ +"""Create a USD Export.""" + +from ayon_core.hosts.blender.api import plugin, lib + + +class CreateUSD(plugin.BaseCreator): + """Create USD Export""" + + identifier = "io.openpype.creators.blender.usd" + name = "usdMain" + label = "USD" + product_type = "usd" + icon = "gears" + + def create( + self, product_name: str, instance_data: dict, pre_create_data: dict + ): + # Run parent create method + collection = super().create( + product_name, instance_data, pre_create_data + ) + + if pre_create_data.get("use_selection"): + objects = lib.get_selection() + for obj in objects: + collection.objects.link(obj) + if obj.type == 'EMPTY': + objects.extend(obj.children) + + return collection diff --git a/client/ayon_core/hosts/blender/plugins/load/load_abc.py b/client/ayon_core/hosts/blender/plugins/load/load_abc.py index 938ae6106b..877cf0ca49 100644 --- a/client/ayon_core/hosts/blender/plugins/load/load_abc.py +++ b/client/ayon_core/hosts/blender/plugins/load/load_abc.py @@ -26,10 +26,11 @@ class CacheModelLoader(plugin.AssetLoader): Note: At least for now it only supports Alembic files. """ - product_types = {"model", "pointcache", "animation"} - representations = ["abc"] + product_types = {"model", "pointcache", "animation", "usd"} + representations = ["abc", "usd"] - label = "Load Alembic" + # TODO: Should USD loader be a separate loader instead? + label = "Load Alembic/USD" icon = "code-fork" color = "orange" @@ -53,10 +54,21 @@ class CacheModelLoader(plugin.AssetLoader): plugin.deselect_all() relative = bpy.context.preferences.filepaths.use_relative_paths - bpy.ops.wm.alembic_import( - filepath=libpath, - relative_path=relative - ) + + if any(libpath.lower().endswith(ext) + for ext in [".usd", ".usda", ".usdc"]): + # USD + bpy.ops.wm.usd_import( + filepath=libpath, + relative_path=relative + ) + + else: + # Alembic + bpy.ops.wm.alembic_import( + filepath=libpath, + relative_path=relative + ) imported = lib.get_selection() @@ -161,7 +173,6 @@ class CacheModelLoader(plugin.AssetLoader): self._link_objects(objects, asset_group, containers, asset_group) - product_type = context["product"]["productType"] asset_group[AVALON_PROPERTY] = { "schema": "openpype:container-2.0", "id": AVALON_CONTAINER_ID, diff --git a/client/ayon_core/hosts/blender/plugins/publish/collect_instance.py b/client/ayon_core/hosts/blender/plugins/publish/collect_instance.py index d47c69a270..314ffd368a 100644 --- a/client/ayon_core/hosts/blender/plugins/publish/collect_instance.py +++ b/client/ayon_core/hosts/blender/plugins/publish/collect_instance.py @@ -12,7 +12,7 @@ class CollectBlenderInstanceData(pyblish.api.InstancePlugin): order = pyblish.api.CollectorOrder hosts = ["blender"] families = ["model", "pointcache", "animation", "rig", "camera", "layout", - "blendScene"] + "blendScene", "usd"] label = "Collect Instance" def process(self, instance): diff --git a/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py b/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py new file mode 100644 index 0000000000..74d0756133 --- /dev/null +++ b/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py @@ -0,0 +1,79 @@ +import os + +import bpy + +from ayon_core.pipeline import publish +from ayon_core.hosts.blender.api import plugin, lib + + +class ExtractUSD(publish.Extractor): + """Extract as USD.""" + + label = "Extract USD" + hosts = ["blender"] + families = ["usd"] + + def process(self, instance): + + # Ignore runtime instances (e.g. USD layers) + # TODO: This is better done via more specific `families` + if not instance.data.get("transientData", {}).get("instance_node"): + return + + # Define extract output file path + stagingdir = self.staging_dir(instance) + filename = f"{instance.name}.usd" + filepath = os.path.join(stagingdir, filename) + + # Perform extraction + self.log.debug("Performing extraction..") + + # Select all members to "export selected" + plugin.deselect_all() + + selected = [] + for obj in instance: + if isinstance(obj, bpy.types.Object): + obj.select_set(True) + selected.append(obj) + + root = lib.get_highest_root(objects=instance[:]) + if not root: + instance_node = instance.data["transientData"]["instance_node"] + raise publish.KnownPublishError( + f"No root object found in instance: {instance_node.name}" + ) + self.log.debug(f"Exporting using active root: {root.name}") + + context = plugin.create_blender_context( + active=root, selected=selected) + + # Export USD + bpy.ops.wm.usd_export( + context, + filepath=filepath, + selected_objects_only=True, + export_textures=False, + relative_paths=False, + export_animation=False, + export_hair=False, + export_uvmaps=True, + # TODO: add for new version of Blender (4+?) + # export_mesh_colors=True, + export_normals=True, + export_materials=True, + use_instancing=True + ) + + plugin.deselect_all() + + # Add representation + representation = { + 'name': 'usd', + 'ext': 'usd', + 'files': filename, + "stagingDir": stagingdir, + } + instance.data.setdefault("representations", []).append(representation) + self.log.debug("Extracted instance '%s' to: %s", + instance.name, representation) From f856f5237c2735eb04663e857ca81677a517f0cd Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 20 Mar 2024 17:07:14 +0100 Subject: [PATCH 002/269] Fix export for recent blender versions --- .../blender/plugins/publish/extract_usd.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py b/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py index 74d0756133..70092ded7b 100644 --- a/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py +++ b/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py @@ -49,21 +49,21 @@ class ExtractUSD(publish.Extractor): active=root, selected=selected) # Export USD - bpy.ops.wm.usd_export( - context, - filepath=filepath, - selected_objects_only=True, - export_textures=False, - relative_paths=False, - export_animation=False, - export_hair=False, - export_uvmaps=True, - # TODO: add for new version of Blender (4+?) - # export_mesh_colors=True, - export_normals=True, - export_materials=True, - use_instancing=True - ) + with bpy.context.temp_override(**context): + bpy.ops.wm.usd_export( + filepath=filepath, + selected_objects_only=True, + export_textures=False, + relative_paths=False, + export_animation=False, + export_hair=False, + export_uvmaps=True, + # TODO: add for new version of Blender (4+?) + # export_mesh_colors=True, + export_normals=True, + export_materials=True, + use_instancing=True + ) plugin.deselect_all() From 5660ed58d39ff4755b2db97511c65aaabfe147f7 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 20 Mar 2024 17:08:35 +0100 Subject: [PATCH 003/269] Fix refactor --- client/ayon_core/hosts/blender/plugins/load/load_abc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/hosts/blender/plugins/load/load_abc.py b/client/ayon_core/hosts/blender/plugins/load/load_abc.py index 877cf0ca49..2fec4cc78b 100644 --- a/client/ayon_core/hosts/blender/plugins/load/load_abc.py +++ b/client/ayon_core/hosts/blender/plugins/load/load_abc.py @@ -173,6 +173,7 @@ class CacheModelLoader(plugin.AssetLoader): self._link_objects(objects, asset_group, containers, asset_group) + product_type = context["product"]["productType"] asset_group[AVALON_PROPERTY] = { "schema": "openpype:container-2.0", "id": AVALON_CONTAINER_ID, From c60bd1cb2df44735ed1ce719f88449928f8d4e4e Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 20 Mar 2024 17:56:29 +0100 Subject: [PATCH 004/269] Fusion: Add Validate Instance in Context validator --- client/ayon_core/hosts/fusion/api/action.py | 52 ++++++++++++ .../publish/validate_instance_in_context.py | 80 +++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 client/ayon_core/hosts/fusion/plugins/publish/validate_instance_in_context.py diff --git a/client/ayon_core/hosts/fusion/api/action.py b/client/ayon_core/hosts/fusion/api/action.py index 1643f1ce03..a0c6aafcb5 100644 --- a/client/ayon_core/hosts/fusion/api/action.py +++ b/client/ayon_core/hosts/fusion/api/action.py @@ -58,3 +58,55 @@ class SelectInvalidAction(pyblish.api.Action): self.log.info( "Selecting invalid tools: %s" % ", ".join(sorted(names)) ) + + +class SelectToolAction(pyblish.api.Action): + """Select invalid output tool in Fusion when plug-in failed. + + """ + + label = "Select saver" + on = "failed" # This action is only available on a failed plug-in + icon = "search" # Icon from Awesome Icon + + def process(self, context, plugin): + errored_instances = get_errored_instances_from_context( + context, + plugin=plugin, + ) + + # Get the invalid nodes for the plug-ins + self.log.info("Finding invalid nodes..") + tools = [] + for instance in errored_instances: + + tool = instance.data.get("tool") + if tool is not None: + tools.append(tool) + else: + self.log.warning( + "Plug-in returned to be invalid, " + f"but has no saver for instance {instance.name}." + ) + + if not tools: + # Assume relevant comp is current comp and clear selection + self.log.info("No invalid tools found.") + comp = get_current_comp() + flow = comp.CurrentFrame.FlowView + flow.Select() # No args equals clearing selection + return + + # Assume a single comp + first_tool = tools[0] + comp = first_tool.Comp() + flow = comp.CurrentFrame.FlowView + flow.Select() # No args equals clearing selection + names = set() + for tool in tools: + flow.Select(tool, True) + comp.SetActiveTool(tool) + names.add(tool.Name) + self.log.info( + "Selecting invalid tools: %s" % ", ".join(sorted(names)) + ) diff --git a/client/ayon_core/hosts/fusion/plugins/publish/validate_instance_in_context.py b/client/ayon_core/hosts/fusion/plugins/publish/validate_instance_in_context.py new file mode 100644 index 0000000000..3aa6fb452f --- /dev/null +++ b/client/ayon_core/hosts/fusion/plugins/publish/validate_instance_in_context.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +"""Validate if instance context is the same as publish context.""" + +import pyblish.api +from ayon_core.hosts.fusion.api.action import SelectToolAction +from ayon_core.pipeline.publish import ( + RepairAction, + ValidateContentsOrder, + PublishValidationError, + OptionalPyblishPluginMixin +) + + +class ValidateInstanceInContextFusion(pyblish.api.InstancePlugin, + OptionalPyblishPluginMixin): + """Validator to check if instance context matches context of publish. + + When working in per-shot style you always publish data in context of + current asset (shot). This validator checks if this is so. It is optional + so it can be disabled when needed. + """ + # Similar to maya and houdini-equivalent `ValidateInstanceInContext` + + order = ValidateContentsOrder + label = "Instance in same Context" + optional = True + hosts = ["fusion"] + actions = [SelectToolAction, RepairAction] + + def process(self, instance): + if not self.is_active(instance.data): + return + + instance_context = self.get_context(instance.data) + context = self.get_context(instance.context.data) + if instance_context != context: + context_label = "{} > {}".format(*context) + instance_label = "{} > {}".format(*instance_context) + + raise PublishValidationError( + message=( + "Instance '{}' publishes to different asset than current " + "context: {}. Current context: {}".format( + instance.name, instance_label, context_label + ) + ), + description=( + "## Publishing to a different asset\n" + "There are publish instances present which are publishing " + "into a different asset than your current context.\n\n" + "Usually this is not what you want but there can be cases " + "where you might want to publish into another asset or " + "shot. If that's the case you can disable the validation " + "on the instance to ignore it." + ) + ) + + @classmethod + def repair(cls, instance): + + create_context = instance.context.data["create_context"] + instance_id = instance.data.get("instance_id") + created_instance = create_context.get_instance_by_id( + instance_id + ) + if created_instance is None: + raise RuntimeError( + f"No CreatedInstances found with id '{instance_id} " + f"in {create_context.instances_by_id}" + ) + + context_asset, context_task = cls.get_context(instance.context.data) + created_instance["folderPath"] = context_asset + created_instance["task"] = context_task + create_context.save_changes() + + @staticmethod + def get_context(data): + """Return asset, task from publishing context data""" + return data["folderPath"], data["task"] From 7d9ff383096a262bb03b66009802945c974dad8a Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 20 Mar 2024 17:57:02 +0100 Subject: [PATCH 005/269] Correctly preserve the instance's task instead of forcing current context task --- client/ayon_core/hosts/fusion/plugins/publish/collect_render.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/fusion/plugins/publish/collect_render.py b/client/ayon_core/hosts/fusion/plugins/publish/collect_render.py index 36102d02cb..b1ecce728b 100644 --- a/client/ayon_core/hosts/fusion/plugins/publish/collect_render.py +++ b/client/ayon_core/hosts/fusion/plugins/publish/collect_render.py @@ -53,7 +53,7 @@ class CollectFusionRender( if product_type not in ["render", "image"]: continue - task_name = context.data["task"] + task_name = inst.data["task"] tool = inst.data["transientData"]["tool"] instance_families = inst.data.get("families", []) From d2503fae073113374da76bde5d11a902a055cf7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 26 Mar 2024 11:01:08 +0100 Subject: [PATCH 006/269] :recycle: remove explicit list --- client/ayon_core/plugins/publish/integrate.py | 64 +------------------ 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/client/ayon_core/plugins/publish/integrate.py b/client/ayon_core/plugins/publish/integrate.py index ce34f2e88b..5b91d9afb8 100644 --- a/client/ayon_core/plugins/publish/integrate.py +++ b/client/ayon_core/plugins/publish/integrate.py @@ -42,7 +42,7 @@ def prepare_changes(old_entity, new_entity): Returns: dict[str, Any]: Changes that have new entity. - + """ changes = {} for key in set(new_entity.keys()): @@ -108,68 +108,6 @@ class IntegrateAsset(pyblish.api.InstancePlugin): label = "Integrate Asset" order = pyblish.api.IntegratorOrder - families = ["workfile", - "pointcache", - "pointcloud", - "proxyAbc", - "camera", - "animation", - "model", - "maxScene", - "mayaAscii", - "mayaScene", - "setdress", - "layout", - "ass", - "vdbcache", - "scene", - "vrayproxy", - "vrayscene_layer", - "render", - "prerender", - "imagesequence", - "review", - "rendersetup", - "rig", - "plate", - "look", - "ociolook", - "audio", - "yetiRig", - "yeticache", - "nukenodes", - "gizmo", - "source", - "matchmove", - "image", - "assembly", - "fbx", - "gltf", - "textures", - "action", - "harmony.template", - "harmony.palette", - "editorial", - "background", - "camerarig", - "redshiftproxy", - "effect", - "xgen", - "hda", - "usd", - "staticMesh", - "skeletalMesh", - "mvLook", - "mvUsd", - "mvUsdComposition", - "mvUsdOverride", - "online", - "uasset", - "blendScene", - "yeticacheUE", - "tycache" - ] - default_template_name = "publish" # Representation context keys that should always be written to From 4c51f3a560109fa75c50f4104e609f93b4c8f28b Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 26 Mar 2024 17:44:31 +0100 Subject: [PATCH 007/269] Implement fix for losing instance id and disconnected logs in publisher UI --- .../fusion/plugins/publish/collect_render.py | 7 +++++++ .../publish/abstract_collect_render.py | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/client/ayon_core/hosts/fusion/plugins/publish/collect_render.py b/client/ayon_core/hosts/fusion/plugins/publish/collect_render.py index b1ecce728b..3f5e2837bc 100644 --- a/client/ayon_core/hosts/fusion/plugins/publish/collect_render.py +++ b/client/ayon_core/hosts/fusion/plugins/publish/collect_render.py @@ -119,6 +119,13 @@ class CollectFusionRender( instances.append(instance) instances_to_remove.append(inst) + # TODO: Avoid this transfer instance id hack + # pass on the `id` of the original instance so any artist + # facing logs transfer as if they were made on the new instance + # instead, see `AbstractCollectRender.process()` + instance.id = inst.id + instance.instance_id = inst.data.get("instance_id") + for instance in instances_to_remove: context.remove(instance) diff --git a/client/ayon_core/pipeline/publish/abstract_collect_render.py b/client/ayon_core/pipeline/publish/abstract_collect_render.py index 745632ca0a..8b98cb678e 100644 --- a/client/ayon_core/pipeline/publish/abstract_collect_render.py +++ b/client/ayon_core/pipeline/publish/abstract_collect_render.py @@ -215,6 +215,25 @@ class AbstractCollectRender(pyblish.api.ContextPlugin): render_instance_dict = attr.asdict(render_instance) instance = context.create_instance(render_instance.name) + + # TODO: Avoid this transfer instance id hack + # Transfer the id from another instance, e.g. when the render + # instance is intended to "replace" an existing instance like + # fusion does in `CollectRender`. Without matching the ids any + # logs produced for the instance prior to the "replacement" will + # not show artist-facing logs in reports + transfer_id = getattr(render_instance, "id") + if transfer_id: + instance._id = transfer_id + # The `instance_id` data may be overridden on the Creator + # to e.g. maybe make unique by node name instead of uuid, + # like in Maya, Fusion, Houdini integration. + # This transfers that unique (named) instance id. + # This transfer logic is currently (only?) used in Fusion. + transfer_instance_id = getattr(render_instance, "instance_id") + if transfer_instance_id: + instance.data["instance_id"] = transfer_instance_id + instance.data["label"] = render_instance.label instance.data.update(render_instance_dict) instance.data.update(data) From c6d72a6488b1c1588cc753ac831906a41892f067 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 28 Mar 2024 19:01:23 +0000 Subject: [PATCH 008/269] 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 941e80dd952864adcd4ba4386d5883434f5cd338 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 15:25:41 +0200 Subject: [PATCH 009/269] Use a general family for houdini farm rendering --- .../plugins/publish/collect_farm_instances.py | 23 +++++++++++++++++++ .../plugins/publish/increment_current_file.py | 4 ++-- .../deadline/plugins/publish/collect_pools.py | 2 +- .../publish/submit_houdini_render_deadline.py | 13 +++++++---- .../plugins/publish/submit_publish_job.py | 2 +- 5 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py new file mode 100644 index 0000000000..9a05ff75dd --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -0,0 +1,23 @@ +import pyblish.api + + +class CollectFarmInstances(pyblish.api.InstancePlugin): + """Collect instances for farm render.""" + + order = pyblish.api.CollectorOrder + families = ["mantra_rop"] + + hosts = ["houdini"] + targets = ["local", "remote"] + label = "Collect farm instances" + + def process(self, instance): + creator_attribute = instance.data["creator_attributes"] + farm_enabled = creator_attribute["farm"] + instance.data["farm"] = farm_enabled + if not farm_enabled: + self.log.debug("Render on farm is disabled. " + "Skipping farm collecting.") + return + + instance.data["families"].append("render.farm.hou") diff --git a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py index 73145b211a..f94d1f10ed 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py @@ -3,7 +3,7 @@ import pyblish.api from ayon_core.lib import version_up from ayon_core.pipeline import registered_host from ayon_core.pipeline.publish import get_errored_plugins_from_context -from ayon_core.hosts.houdini.api import HoudiniHost + from ayon_core.pipeline.publish import KnownPublishError @@ -20,9 +20,9 @@ class IncrementCurrentFile(pyblish.api.ContextPlugin): families = ["workfile", "redshift_rop", "arnold_rop", - "mantra_rop", "karma_rop", "usdrender", + "render.farm.hou", "publish.hou"] optional = True 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..62d997eb2c 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -43,9 +43,9 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, "usdrender", "redshift_rop", "arnold_rop", - "mantra_rop", "karma_rop", "vray_rop", + "render.farm.hou", "publish.hou"] primary_pool = None diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 6952604293..d91fd895ad 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -73,9 +73,9 @@ class HoudiniSubmitDeadline( families = ["usdrender", "redshift_rop", "arnold_rop", - "mantra_rop", "karma_rop", - "vray_rop"] + "vray_rop", + "render.farm.hou"] targets = ["local"] use_published = True @@ -86,7 +86,7 @@ class HoudiniSubmitDeadline( priority = 50 chunk_size = 1 group = "" - + @classmethod def get_attribute_defs(cls): return [ @@ -194,7 +194,7 @@ class HoudiniSubmitDeadline( job_info.Pool = instance.data.get("primaryPool") job_info.SecondaryPool = instance.data.get("secondaryPool") - + if split_render_job and is_export_job: job_info.Priority = attribute_values.get( "export_priority", self.export_priority @@ -265,11 +265,14 @@ class HoudiniSubmitDeadline( # Output driver to render if job_type == "render": product_type = instance.data.get("productType") + rop_node = hou.node(instance.data.get("instance_node")) + node_type = rop_node.type().name() + if product_type == "arnold_rop": plugin_info = ArnoldRenderDeadlinePluginInfo( InputFile=instance.data["ifdFile"] ) - elif product_type == "mantra_rop": + elif node_type == "ifd": plugin_info = MantraRenderDeadlinePluginInfo( SceneFile=instance.data["ifdFile"], Version=hou_major_minor, diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 84bac6d017..82232c70c0 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -92,7 +92,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "prerender.farm", "prerender.frames_farm", "renderlayer", "imagesequence", "vrayscene", "maxrender", - "arnold_rop", "mantra_rop", + "arnold_rop", "render.farm.hou", "karma_rop", "vray_rop", "redshift_rop"] From 37cecde8869dc273b1e783efe529b82b570a7794 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 16:08:03 +0200 Subject: [PATCH 010/269] add few keywords related to Houdini --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ee124ddc2d..5bc11031e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,7 +92,7 @@ line-ending = "auto" [tool.codespell] # Ignore words that are not in the dictionary. -ignore-words-list = "ayon,ynput" +ignore-words-list = "ayon,ynput,hda,parms" skip = "./.*,./package/*,*/vendor/*,*/unreal/integration/*,*/aftereffects/api/extension/js/libs/*" count = true quiet-level = 3 From 71bf18910c8955523313a947f9be5b8adc5b9ad4 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 16:09:45 +0200 Subject: [PATCH 011/269] make codespell happy about integrate.py --- client/ayon_core/plugins/publish/integrate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/plugins/publish/integrate.py b/client/ayon_core/plugins/publish/integrate.py index ce34f2e88b..38169ca2c3 100644 --- a/client/ayon_core/plugins/publish/integrate.py +++ b/client/ayon_core/plugins/publish/integrate.py @@ -42,7 +42,7 @@ def prepare_changes(old_entity, new_entity): Returns: dict[str, Any]: Changes that have new entity. - + """ changes = {} for key in set(new_entity.keys()): @@ -358,7 +358,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin): # Compute the resource file infos once (files belonging to the # version instance instead of an individual representation) so - # we can re-use those file infos per representation + # we can reuse those file infos per representation resource_file_infos = self.get_files_info( resource_destinations, anatomy ) From 620538330c10e83ec95a90ec0a59b587ba09b7df Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 16:10:48 +0200 Subject: [PATCH 012/269] support local rendering for mantra_rop and add dedicated plugins --- .../plugins/create/create_mantra_rop.py | 43 +++++---- .../publish/collect_local_render_instances.py | 88 +++++++++++++++++++ .../publish/extract_mantra_local_render.py | 29 ++++++ .../plugins/publish/increment_current_file.py | 1 + .../validate_split_render_is_disabled.py | 65 ++++++++++++++ client/ayon_core/plugins/publish/integrate.py | 3 +- 6 files changed, 213 insertions(+), 16 deletions(-) create mode 100644 client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py create mode 100644 client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py create mode 100644 client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index f15f49f463..6dac3ff02a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- """Creator plugin to create Mantra ROP.""" from ayon_core.hosts.houdini.api import plugin -from ayon_core.pipeline import CreatedInstance -from ayon_core.lib import EnumDef, BoolDef +from ayon_core.lib import EnumDef, BoolDef, UISeparatorDef, UILabelDef class CreateMantraROP(plugin.HoudiniCreator): @@ -23,12 +22,14 @@ class CreateMantraROP(plugin.HoudiniCreator): # Add chunk size attribute instance_data["chunkSize"] = 10 # Submit for job publishing - instance_data["farm"] = pre_create_data.get("farm") + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + creator_attributes["farm"] = pre_create_data.get("farm") instance = super(CreateMantraROP, self).create( product_name, instance_data, - pre_create_data) # type: CreatedInstance + pre_create_data) instance_node = hou.node(instance.get("instance_node")) @@ -78,21 +79,14 @@ class CreateMantraROP(plugin.HoudiniCreator): to_lock = ["productType", "id"] self.lock_parameters(instance_node, to_lock) - def get_pre_create_attr_defs(self): - attrs = super(CreateMantraROP, self).get_pre_create_attr_defs() - + def get_instance_attr_defs(self): image_format_enum = [ "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", "rad", "rat", "rta", "sgi", "tga", "tif", ] - return attrs + [ - BoolDef("farm", - label="Submitting to Farm", - default=True), - BoolDef("export_job", - label="Split export and render jobs", - default=self.export_job), + return [ + UILabelDef(label="Mantra Render Settings:"), EnumDef("image_format", image_format_enum, default="exr", @@ -101,5 +95,24 @@ class CreateMantraROP(plugin.HoudiniCreator): label="Override Camera Resolution", tooltip="Override the current camera " "resolution, recommended for IPR.", - default=False) + default=False), + UISeparatorDef(key="1"), + UILabelDef(label="Farm Render Options:"), + BoolDef("farm", + label="Submitting to Farm", + default=True), + BoolDef("export_job", + label="Split export and render jobs", + default=self.export_job), + UISeparatorDef(key="2"), + UILabelDef(label="Local Render Options:"), + BoolDef("skip_render", + label="Skip Render", + tooltip="Enable this option to skip render which publish existing frames.", + default=False), ] + + def get_pre_create_attr_defs(self): + attrs = super(CreateMantraROP, self).get_pre_create_attr_defs() + + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py new file mode 100644 index 0000000000..6b55bfffa4 --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -0,0 +1,88 @@ +import os +import pyblish.api + + +class CollectLocalRenderInstances(pyblish.api.InstancePlugin): + """Collect instances for local render. + + Agnostic Local Render Collector. + """ + + # this plugin runs after Collect Render Products + order = pyblish.api.CollectorOrder + 0.12 + families = ["mantra_rop"] + + hosts = ["houdini"] + targets = ["local", "remote"] + label = "Collect local render instances" + + def process(self, instance): + creator_attribute = instance.data["creator_attributes"] + farm_enabled = creator_attribute["farm"] + instance.data["farm"] = farm_enabled + if farm_enabled: + self.log.debug("Render on farm is enabled. " + "Skipping local render collecting.") + return + + # Create Instance for each AOV. + context = instance.context + expectedFiles = next(iter(instance.data["expectedFiles"]), {}) + + product_type = "render" # is always render + product_group = "render{Task}{productName}".format( + Task=self._capitalize(instance.data["task"]), + productName=self._capitalize(instance.data["productName"]) + ) # is always the group + + for aov_name, aov_filepaths in expectedFiles.items(): + # Some AOV instance data + # label = "{productName}_{AOV}".format( + # AOV=aov_name, + # productName=instance.data["productName"] + # ) + product_name = "render{Task}{productName}_{AOV}".format( + Task=self._capitalize(instance.data["task"]), + productName=self._capitalize(instance.data["productName"]), + AOV=aov_name + ) + + # Create instance for each AOV + aov_instance = context.create_instance(product_name) + + # Prepare Representation for each AOV + aov_filenames = [os.path.basename(path) for path in aov_filepaths] + staging_dir = os.path.dirname(aov_filepaths[0]) + ext = aov_filepaths[0].split(".")[-1] + + aov_instance.data.update({ + # 'label': label, + "task": instance.data["task"], + "folderPath": instance.data["folderPath"], + "frameStart": instance.data["frameStartHandle"], + "frameEnd": instance.data["frameEndHandle"], + "productType": product_type, + "productName": product_name, + "productGroup": product_group, + "tags": [], + "families": ["render.local.hou"], + "instance_node": instance.data["instance_node"], + "representations": [ + { + "stagingDir": staging_dir, + "ext": ext, + "name": ext, + "files": aov_filenames, + "frameStart": instance.data["frameStartHandle"], + "frameEnd": instance.data["frameEndHandle"] + } + ] + }) + + # Remove Mantra instance + # I can't remove it here as I still need it to trigger the render. + # context.remove(instance) + + @staticmethod + def _capitalize(word): + return word[:1].upper() + word[1:] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py new file mode 100644 index 0000000000..bb78f6b1ee --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py @@ -0,0 +1,29 @@ +import pyblish.api + +from ayon_core.pipeline import publish +from ayon_core.hosts.houdini.api.lib import render_rop +import hou + + +class ExtractMantraLocalRender(publish.Extractor): + + order = pyblish.api.ExtractorOrder + label = "Extract Mantra Local Render" + hosts = ["houdini"] + families = ["mantra_rop"] + targets = ["local", "remote"] + + def process(self, instance): + if instance.data.get("farm"): + self.log.debug("Should be processed on farm, skipping.") + return + + creator_attribute = instance.data["creator_attributes"] + skip_render = creator_attribute["skip_render"] + + if skip_render: + self.log.debug("Skip render is enabled, skipping rendering.") + return + + ropnode = hou.node(instance.data.get("instance_node")) + render_rop(ropnode) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py index f94d1f10ed..199843bc14 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py @@ -23,6 +23,7 @@ class IncrementCurrentFile(pyblish.api.ContextPlugin): "karma_rop", "usdrender", "render.farm.hou", + "render.local.hou", "publish.hou"] optional = True diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py new file mode 100644 index 0000000000..2d7a95e817 --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +import pyblish.api +import hou +from ayon_core.pipeline import PublishValidationError +from ayon_core.pipeline.publish import RepairAction + + +class DisableSplitExportAction(RepairAction): + label = "Disable Split Export" + + +class ValidateSplitExportIsDisabled(pyblish.api.InstancePlugin): + """Validate the Instance has no current cooking errors.""" + + order = pyblish.api.ValidatorOrder + hosts = ["houdini"] + families = ["mantra_rop"] + label = "Validate Split Export Is Disabled" + actions = [DisableSplitExportAction] + + def process(self, instance): + + invalid = self.get_invalid(instance) + if invalid: + nodes = [n.path() for n in invalid] + raise PublishValidationError( + "See log for details. " + "Invalid nodes: {0}".format(nodes) + ) + + + @classmethod + def get_invalid(cls, instance): + + invalid = [] + rop_node = hou.node(instance.data["instance_node"]) + + creator_attribute = instance.data["creator_attributes"] + farm_enabled = creator_attribute["farm"] + if farm_enabled: + cls.log.debug( + "Farm is enabled, skipping validation." + ) + return + + + split_enabled = creator_attribute["export_job"] + if split_enabled: + invalid.append(rop_node) + cls.log.error( + "Split Export must be disabled in local render instances." + ) + + return invalid + + @classmethod + def repair(cls, instance): + + create_context = instance.context.data["create_context"] + created_instance = create_context.get_instance_by_id( + instance.data["instance_id"]) + creator_attributes = created_instance["creator_attributes"] + # Disable export_job + creator_attributes["export_job"] = False + create_context.save_changes() diff --git a/client/ayon_core/plugins/publish/integrate.py b/client/ayon_core/plugins/publish/integrate.py index 38169ca2c3..ea24112831 100644 --- a/client/ayon_core/plugins/publish/integrate.py +++ b/client/ayon_core/plugins/publish/integrate.py @@ -167,7 +167,8 @@ class IntegrateAsset(pyblish.api.InstancePlugin): "uasset", "blendScene", "yeticacheUE", - "tycache" + "tycache", + "render.local.hou" ] default_template_name = "publish" From b35bc8c9d55b7b064f9d9b81cb0184c37925705a Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 16:18:15 +0200 Subject: [PATCH 013/269] remove redundant code --- .../ayon_core/hosts/houdini/plugins/create/create_karma_rop.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index 9eb9d80cd3..e91ddbc0ac 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- """Creator plugin to create Karma ROP.""" from ayon_core.hosts.houdini.api import plugin -from ayon_core.pipeline import CreatedInstance from ayon_core.lib import BoolDef, EnumDef, NumberDef @@ -25,7 +24,7 @@ class CreateKarmaROP(plugin.HoudiniCreator): instance = super(CreateKarmaROP, self).create( product_name, instance_data, - pre_create_data) # type: CreatedInstance + pre_create_data) instance_node = hou.node(instance.get("instance_node")) From 068b9c3f4ec721d6404c5c26e78b6d03f5ae40aa Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 16:32:43 +0200 Subject: [PATCH 014/269] support local rendering for karma_rop --- .../plugins/create/create_karma_rop.py | 24 ++++++++++++------- .../plugins/publish/collect_farm_instances.py | 3 ++- .../publish/collect_local_render_instances.py | 3 ++- .../publish/extract_mantra_local_render.py | 7 +++--- .../plugins/publish/increment_current_file.py | 1 - .../deadline/plugins/publish/collect_pools.py | 1 - .../publish/submit_houdini_render_deadline.py | 1 - .../plugins/publish/submit_publish_job.py | 2 +- 8 files changed, 25 insertions(+), 17 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index e91ddbc0ac..c791cfe647 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Creator plugin to create Karma ROP.""" from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import BoolDef, EnumDef, NumberDef +from ayon_core.lib import BoolDef, EnumDef, NumberDef, UISeparatorDef, UILabelDef class CreateKarmaROP(plugin.HoudiniCreator): @@ -18,8 +18,6 @@ class CreateKarmaROP(plugin.HoudiniCreator): instance_data.update({"node_type": "karma"}) # Add chunk size attribute instance_data["chunkSize"] = 10 - # Submit for job publishing - instance_data["farm"] = pre_create_data.get("farm") instance = super(CreateKarmaROP, self).create( product_name, @@ -86,15 +84,13 @@ class CreateKarmaROP(plugin.HoudiniCreator): to_lock = ["productType", "id"] self.lock_parameters(instance_node, to_lock) - def get_pre_create_attr_defs(self): - attrs = super(CreateKarmaROP, self).get_pre_create_attr_defs() - + def get_instance_attr_defs(self): image_format_enum = [ "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", "rad", "rat", "rta", "sgi", "tga", "tif", ] - return attrs + [ + return [ BoolDef("farm", label="Submitting to Farm", default=True), @@ -112,5 +108,17 @@ class CreateKarmaROP(plugin.HoudiniCreator): decimals=0), BoolDef("cam_res", label="Camera Resolution", - default=False) + default=False), + UISeparatorDef(key="2"), + UILabelDef(label="Local Render Options:"), + BoolDef("skip_render", + label="Skip Render", + tooltip="Enable this option to skip render which publish existing frames.", + default=False), ] + + + def get_pre_create_attr_defs(self): + attrs = super(CreateKarmaROP, self).get_pre_create_attr_defs() + + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py index 9a05ff75dd..61894da98e 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -5,7 +5,8 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): """Collect instances for farm render.""" order = pyblish.api.CollectorOrder - families = ["mantra_rop"] + families = ["mantra_rop", + "karma_rop"] hosts = ["houdini"] targets = ["local", "remote"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 6b55bfffa4..e94e1187d7 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -10,7 +10,8 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): # this plugin runs after Collect Render Products order = pyblish.api.CollectorOrder + 0.12 - families = ["mantra_rop"] + families = ["mantra_rop", + "karma_rop"] hosts = ["houdini"] targets = ["local", "remote"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py index bb78f6b1ee..a7967435c9 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py @@ -5,12 +5,13 @@ from ayon_core.hosts.houdini.api.lib import render_rop import hou -class ExtractMantraLocalRender(publish.Extractor): +class ExtractLocalRender(publish.Extractor): order = pyblish.api.ExtractorOrder - label = "Extract Mantra Local Render" + label = "Extract Local Render" hosts = ["houdini"] - families = ["mantra_rop"] + families = ["mantra_rop", + "karma_rop"] targets = ["local", "remote"] def process(self, instance): diff --git a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py index 199843bc14..5885fd8643 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py @@ -20,7 +20,6 @@ class IncrementCurrentFile(pyblish.api.ContextPlugin): families = ["workfile", "redshift_rop", "arnold_rop", - "karma_rop", "usdrender", "render.farm.hou", "render.local.hou", 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 62d997eb2c..bb556c2b9d 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -43,7 +43,6 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, "usdrender", "redshift_rop", "arnold_rop", - "karma_rop", "vray_rop", "render.farm.hou", "publish.hou"] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index d91fd895ad..b433151b34 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -73,7 +73,6 @@ class HoudiniSubmitDeadline( families = ["usdrender", "redshift_rop", "arnold_rop", - "karma_rop", "vray_rop", "render.farm.hou"] targets = ["local"] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 82232c70c0..69f626b602 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -93,7 +93,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "renderlayer", "imagesequence", "vrayscene", "maxrender", "arnold_rop", "render.farm.hou", - "karma_rop", "vray_rop", + "vray_rop", "redshift_rop"] aov_filter = [ From 5dd571dc2140601823f6fdf3c9da6a875eaebcce Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 16:33:48 +0200 Subject: [PATCH 015/269] algin file name to class name --- .../{extract_mantra_local_render.py => extract_local_render.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/ayon_core/hosts/houdini/plugins/publish/{extract_mantra_local_render.py => extract_local_render.py} (100%) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py similarity index 100% rename from client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_local_render.py rename to client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py From e8907b00c171a6c6d76ebff009335aeeb83ab026 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 17:02:13 +0200 Subject: [PATCH 016/269] add parm to cspell ignore list --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5bc11031e2..58f07f0fa9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,7 +92,7 @@ line-ending = "auto" [tool.codespell] # Ignore words that are not in the dictionary. -ignore-words-list = "ayon,ynput,hda,parms" +ignore-words-list = "ayon,ynput,hda,parms,parm" skip = "./.*,./package/*,*/vendor/*,*/unreal/integration/*,*/aftereffects/api/extension/js/libs/*" count = true quiet-level = 3 From 313a7a2456a680b659999436924140afca18d2fc Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 17:02:26 +0200 Subject: [PATCH 017/269] support local rendering for redshift_rop --- .../plugins/create/create_redshift_rop.py | 38 ++++++++++++------- .../plugins/publish/collect_farm_instances.py | 3 +- .../publish/collect_local_render_instances.py | 3 +- .../plugins/publish/extract_local_render.py | 3 +- .../plugins/publish/increment_current_file.py | 1 - .../validate_split_render_is_disabled.py | 7 ++-- .../deadline/plugins/publish/collect_pools.py | 1 - .../publish/submit_houdini_render_deadline.py | 3 +- .../plugins/publish/submit_publish_job.py | 3 +- 9 files changed, 36 insertions(+), 26 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index 1cd239e929..f6d42419f9 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -4,7 +4,7 @@ import hou # noqa from ayon_core.pipeline import CreatorError from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import EnumDef, BoolDef +from ayon_core.lib import EnumDef, BoolDef, UISeparatorDef, UILabelDef class CreateRedshiftROP(plugin.HoudiniCreator): @@ -26,8 +26,6 @@ class CreateRedshiftROP(plugin.HoudiniCreator): instance_data.update({"node_type": "Redshift_ROP"}) # Add chunk size attribute instance_data["chunkSize"] = 10 - # Submit for job publishing - instance_data["farm"] = pre_create_data.get("farm") instance = super(CreateRedshiftROP, self).create( product_name, @@ -118,8 +116,7 @@ class CreateRedshiftROP(plugin.HoudiniCreator): return super(CreateRedshiftROP, self).remove_instances(instances) - def get_pre_create_attr_defs(self): - attrs = super(CreateRedshiftROP, self).get_pre_create_attr_defs() + def get_instance_attr_defs(self): image_format_enum = [ "exr", "tif", "jpg", "png", ] @@ -128,14 +125,8 @@ class CreateRedshiftROP(plugin.HoudiniCreator): "Full Multi-Layered EXR File" ] - - return attrs + [ - BoolDef("farm", - label="Submitting to Farm", - default=True), - BoolDef("split_render", - label="Split export and render jobs", - default=self.split_render), + return [ + UILabelDef(label="RedShift Render Settings:"), EnumDef("image_format", image_format_enum, default=self.ext, @@ -143,5 +134,24 @@ class CreateRedshiftROP(plugin.HoudiniCreator): EnumDef("multi_layered_mode", multi_layered_mode, default=self.multi_layered_mode, - label="Multi-Layered EXR") + label="Multi-Layered EXR"), + UISeparatorDef(key="1"), + UILabelDef(label="Farm Render Options:"), + BoolDef("farm", + label="Submitting to Farm", + default=True), + BoolDef("split_render", + label="Split export and render jobs", + default=self.split_render), + UISeparatorDef(key="2"), + UILabelDef(label="Local Render Options:"), + BoolDef("skip_render", + label="Skip Render", + tooltip="Enable this option to skip render which publish existing frames.", + default=False), ] + + def get_pre_create_attr_defs(self): + attrs = super(CreateRedshiftROP, self).get_pre_create_attr_defs() + + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py index 61894da98e..ffdce1df32 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -6,7 +6,8 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): order = pyblish.api.CollectorOrder families = ["mantra_rop", - "karma_rop"] + "karma_rop", + "redshift_rop"] hosts = ["houdini"] targets = ["local", "remote"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index e94e1187d7..0b8e004873 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -11,7 +11,8 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): # this plugin runs after Collect Render Products order = pyblish.api.CollectorOrder + 0.12 families = ["mantra_rop", - "karma_rop"] + "karma_rop", + "redshift_rop"] hosts = ["houdini"] targets = ["local", "remote"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py index a7967435c9..e2f51d0dff 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py @@ -11,7 +11,8 @@ class ExtractLocalRender(publish.Extractor): label = "Extract Local Render" hosts = ["houdini"] families = ["mantra_rop", - "karma_rop"] + "karma_rop", + "redshift_rop"] targets = ["local", "remote"] def process(self, instance): diff --git a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py index 5885fd8643..b33b9cc344 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py @@ -18,7 +18,6 @@ class IncrementCurrentFile(pyblish.api.ContextPlugin): order = pyblish.api.IntegratorOrder + 9.0 hosts = ["houdini"] families = ["workfile", - "redshift_rop", "arnold_rop", "usdrender", "render.farm.hou", diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py index 2d7a95e817..cbed59fa3f 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py @@ -14,7 +14,8 @@ class ValidateSplitExportIsDisabled(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder hosts = ["houdini"] - families = ["mantra_rop"] + families = ["mantra_rop", + "redshift_rop"] label = "Validate Split Export Is Disabled" actions = [DisableSplitExportAction] @@ -44,7 +45,7 @@ class ValidateSplitExportIsDisabled(pyblish.api.InstancePlugin): return - split_enabled = creator_attribute["export_job"] + split_enabled = creator_attribute["split_render"] if split_enabled: invalid.append(rop_node) cls.log.error( @@ -61,5 +62,5 @@ class ValidateSplitExportIsDisabled(pyblish.api.InstancePlugin): instance.data["instance_id"]) creator_attributes = created_instance["creator_attributes"] # Disable export_job - creator_attributes["export_job"] = False + creator_attributes["split_render"] = False create_context.save_changes() 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 bb556c2b9d..05b0e55548 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -41,7 +41,6 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, "renderlayer", "maxrender", "usdrender", - "redshift_rop", "arnold_rop", "vray_rop", "render.farm.hou", diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index b433151b34..39a150ab2d 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -71,7 +71,6 @@ class HoudiniSubmitDeadline( order = pyblish.api.IntegratorOrder hosts = ["houdini"] families = ["usdrender", - "redshift_rop", "arnold_rop", "vray_rop", "render.farm.hou"] @@ -280,7 +279,7 @@ class HoudiniSubmitDeadline( plugin_info = VrayRenderPluginInfo( InputFilename=instance.data["ifdFile"], ) - elif product_type == "redshift_rop": + elif node_type == "Redshift_ROP": plugin_info = RedshiftRenderPluginInfo( SceneFile=instance.data["ifdFile"] ) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 69f626b602..d70bc925ed 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -93,8 +93,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "renderlayer", "imagesequence", "vrayscene", "maxrender", "arnold_rop", "render.farm.hou", - "vray_rop", - "redshift_rop"] + "vray_rop"] aov_filter = [ { From 2228279a2d6cee48f7e0ed18ea07a993d1d4d077 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 17:09:36 +0200 Subject: [PATCH 018/269] refactor 'export_job' variable name into 'split_render' --- .../hosts/houdini/plugins/create/create_arnold_rop.py | 8 ++++---- .../hosts/houdini/plugins/create/create_mantra_rop.py | 8 ++++---- .../hosts/houdini/plugins/create/create_vray_rop.py | 10 +++++----- .../publish/validate_split_render_is_disabled.py | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index b7c5910a4f..68c68c5a16 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -14,7 +14,7 @@ class CreateArnoldRop(plugin.HoudiniCreator): ext = "exr" # Default to split export and render jobs - export_job = True + split_render = True def create(self, product_name, instance_data, pre_create_data): import hou @@ -51,7 +51,7 @@ class CreateArnoldRop(plugin.HoudiniCreator): "ar_exr_half_precision": 1 # half precision } - if pre_create_data.get("export_job"): + if pre_create_data.get("split_render"): ass_filepath = \ "{export_dir}{product_name}/{product_name}.$F4.ass".format( export_dir=hou.text.expandString("$HIP/pyblish/ass/"), @@ -78,9 +78,9 @@ class CreateArnoldRop(plugin.HoudiniCreator): BoolDef("farm", label="Submitting to Farm", default=True), - BoolDef("export_job", + BoolDef("split_render", label="Split export and render jobs", - default=self.export_job), + default=self.split_render), EnumDef("image_format", image_format_enum, default=self.ext, diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 6dac3ff02a..58aadfd26c 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -12,7 +12,7 @@ class CreateMantraROP(plugin.HoudiniCreator): icon = "magic" # Default to split export and render jobs - export_job = True + split_render = True def create(self, product_name, instance_data, pre_create_data): import hou # noqa @@ -48,7 +48,7 @@ class CreateMantraROP(plugin.HoudiniCreator): "vm_picture": filepath, } - if pre_create_data.get("export_job"): + if pre_create_data.get("split_render"): ifd_filepath = \ "{export_dir}{product_name}/{product_name}.$F4.ifd".format( export_dir=hou.text.expandString("$HIP/pyblish/ifd/"), @@ -101,9 +101,9 @@ class CreateMantraROP(plugin.HoudiniCreator): BoolDef("farm", label="Submitting to Farm", default=True), - BoolDef("export_job", + BoolDef("split_render", label="Split export and render jobs", - default=self.export_job), + default=self.split_render), UISeparatorDef(key="2"), UILabelDef(label="Local Render Options:"), BoolDef("skip_render", diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 6b2396bffb..f7779cc67c 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -3,7 +3,7 @@ import hou from ayon_core.hosts.houdini.api import plugin -from ayon_core.pipeline import CreatedInstance, CreatorError +from ayon_core.pipeline import CreatorError from ayon_core.lib import EnumDef, BoolDef @@ -17,7 +17,7 @@ class CreateVrayROP(plugin.HoudiniCreator): ext = "exr" # Default to split export and render jobs - export_job = True + split_render = True def create(self, product_name, instance_data, pre_create_data): @@ -55,7 +55,7 @@ class CreateVrayROP(plugin.HoudiniCreator): "SettingsEXR_bits_per_channel": "16" # half precision } - if pre_create_data.get("export_job"): + if pre_create_data.get("split_render"): scene_filepath = \ "{export_dir}{product_name}/{product_name}.$F4.vrscene".format( export_dir=hou.text.expandString("$HIP/pyblish/vrscene/"), @@ -154,9 +154,9 @@ class CreateVrayROP(plugin.HoudiniCreator): BoolDef("farm", label="Submitting to Farm", default=True), - BoolDef("export_job", + BoolDef("split_render", label="Split export and render jobs", - default=self.export_job), + default=self.split_render), EnumDef("image_format", image_format_enum, default=self.ext, diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py index cbed59fa3f..d54f10b29b 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py @@ -61,6 +61,6 @@ class ValidateSplitExportIsDisabled(pyblish.api.InstancePlugin): created_instance = create_context.get_instance_by_id( instance.data["instance_id"]) creator_attributes = created_instance["creator_attributes"] - # Disable export_job + # Disable split_render creator_attributes["split_render"] = False create_context.save_changes() From 0ba5fee7e259543b0c8df66d9f2e898b46089ccc Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 17:23:56 +0200 Subject: [PATCH 019/269] support local rendering for arnold_rop --- .../plugins/create/create_arnold_rop.py | 23 ++++++++++++------- .../plugins/publish/collect_farm_instances.py | 3 ++- .../publish/collect_local_render_instances.py | 3 ++- .../plugins/publish/extract_local_render.py | 3 ++- .../plugins/publish/increment_current_file.py | 1 - .../validate_split_render_is_disabled.py | 3 ++- .../deadline/plugins/publish/collect_pools.py | 1 - .../publish/submit_houdini_render_deadline.py | 3 +-- .../plugins/publish/submit_publish_job.py | 2 +- 9 files changed, 25 insertions(+), 17 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 68c68c5a16..c65c425a45 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -1,5 +1,5 @@ from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import EnumDef, BoolDef +from ayon_core.lib import EnumDef, BoolDef, UISeparatorDef, UILabelDef class CreateArnoldRop(plugin.HoudiniCreator): @@ -25,8 +25,6 @@ class CreateArnoldRop(plugin.HoudiniCreator): # Add chunk size attribute instance_data["chunkSize"] = 1 - # Submit for job publishing - instance_data["farm"] = pre_create_data.get("farm") instance = super(CreateArnoldRop, self).create( product_name, @@ -66,15 +64,13 @@ class CreateArnoldRop(plugin.HoudiniCreator): to_lock = ["productType", "id"] self.lock_parameters(instance_node, to_lock) - def get_pre_create_attr_defs(self): - attrs = super(CreateArnoldRop, self).get_pre_create_attr_defs() - + def get_instance_attr_defs(self): image_format_enum = [ "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", "rad", "rat", "rta", "sgi", "tga", "tif", ] - return attrs + [ + return [ BoolDef("farm", label="Submitting to Farm", default=True), @@ -84,5 +80,16 @@ class CreateArnoldRop(plugin.HoudiniCreator): EnumDef("image_format", image_format_enum, default=self.ext, - label="Image Format Options") + label="Image Format Options"), + UISeparatorDef(key="2"), + UILabelDef(label="Local Render Options:"), + BoolDef("skip_render", + label="Skip Render", + tooltip="Enable this option to skip render which publish existing frames.", + default=False), ] + + def get_pre_create_attr_defs(self): + attrs = super(CreateArnoldRop, self).get_pre_create_attr_defs() + + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py index ffdce1df32..afe67279e1 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -7,7 +7,8 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): order = pyblish.api.CollectorOrder families = ["mantra_rop", "karma_rop", - "redshift_rop"] + "redshift_rop", + "arnold_rop"] hosts = ["houdini"] targets = ["local", "remote"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 0b8e004873..9b121a6894 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -12,7 +12,8 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): order = pyblish.api.CollectorOrder + 0.12 families = ["mantra_rop", "karma_rop", - "redshift_rop"] + "redshift_rop", + "arnold_rop"] hosts = ["houdini"] targets = ["local", "remote"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py index e2f51d0dff..1fce9dc87f 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py @@ -12,7 +12,8 @@ class ExtractLocalRender(publish.Extractor): hosts = ["houdini"] families = ["mantra_rop", "karma_rop", - "redshift_rop"] + "redshift_rop", + "arnold_rop"] targets = ["local", "remote"] def process(self, instance): diff --git a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py index b33b9cc344..acb66afa4e 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py @@ -18,7 +18,6 @@ class IncrementCurrentFile(pyblish.api.ContextPlugin): order = pyblish.api.IntegratorOrder + 9.0 hosts = ["houdini"] families = ["workfile", - "arnold_rop", "usdrender", "render.farm.hou", "render.local.hou", diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py index d54f10b29b..38912f434f 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py @@ -15,7 +15,8 @@ class ValidateSplitExportIsDisabled(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder hosts = ["houdini"] families = ["mantra_rop", - "redshift_rop"] + "redshift_rop", + "arnold_rop"] label = "Validate Split Export Is Disabled" actions = [DisableSplitExportAction] 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 05b0e55548..c30c7fb0f2 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -41,7 +41,6 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, "renderlayer", "maxrender", "usdrender", - "arnold_rop", "vray_rop", "render.farm.hou", "publish.hou"] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 39a150ab2d..17a0b4ad32 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -71,7 +71,6 @@ class HoudiniSubmitDeadline( order = pyblish.api.IntegratorOrder hosts = ["houdini"] families = ["usdrender", - "arnold_rop", "vray_rop", "render.farm.hou"] targets = ["local"] @@ -266,7 +265,7 @@ class HoudiniSubmitDeadline( rop_node = hou.node(instance.data.get("instance_node")) node_type = rop_node.type().name() - if product_type == "arnold_rop": + if node_type == "arnold": plugin_info = ArnoldRenderDeadlinePluginInfo( InputFile=instance.data["ifdFile"] ) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index d70bc925ed..6171d7135f 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -92,7 +92,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "prerender.farm", "prerender.frames_farm", "renderlayer", "imagesequence", "vrayscene", "maxrender", - "arnold_rop", "render.farm.hou", + "render.farm.hou", "vray_rop"] aov_filter = [ From c7e0821ff57e046c8de87c37d0779d296c8ca407 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 29 Mar 2024 17:42:49 +0200 Subject: [PATCH 020/269] support local rendering for vray_rop --- .../houdini/plugins/create/create_vray_rop.py | 36 ++++++++++++------- .../plugins/publish/collect_farm_instances.py | 3 +- .../publish/collect_local_render_instances.py | 3 +- .../plugins/publish/extract_local_render.py | 3 +- .../validate_split_render_is_disabled.py | 3 +- .../deadline/plugins/publish/collect_pools.py | 1 - .../publish/submit_houdini_render_deadline.py | 3 +- .../plugins/publish/submit_publish_job.py | 3 +- 8 files changed, 33 insertions(+), 22 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index f7779cc67c..682eec379e 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -4,7 +4,7 @@ import hou from ayon_core.hosts.houdini.api import plugin from ayon_core.pipeline import CreatorError -from ayon_core.lib import EnumDef, BoolDef +from ayon_core.lib import EnumDef, BoolDef, UISeparatorDef, UILabelDef class CreateVrayROP(plugin.HoudiniCreator): @@ -25,8 +25,6 @@ class CreateVrayROP(plugin.HoudiniCreator): instance_data.update({"node_type": "vray_renderer"}) # Add chunk size attribute instance_data["chunkSize"] = 10 - # Submit for job publishing - instance_data["farm"] = pre_create_data.get("farm") instance = super(CreateVrayROP, self).create( product_name, @@ -143,20 +141,13 @@ class CreateVrayROP(plugin.HoudiniCreator): return super(CreateVrayROP, self).remove_instances(instances) - def get_pre_create_attr_defs(self): - attrs = super(CreateVrayROP, self).get_pre_create_attr_defs() + def get_instance_attr_defs(self): image_format_enum = [ "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", "rad", "rat", "rta", "sgi", "tga", "tif", ] - return attrs + [ - BoolDef("farm", - label="Submitting to Farm", - default=True), - BoolDef("split_render", - label="Split export and render jobs", - default=self.split_render), + return [ EnumDef("image_format", image_format_enum, default=self.ext, @@ -170,5 +161,24 @@ class CreateVrayROP(plugin.HoudiniCreator): label="Render Element", tooltip="Create Render Element Node " "if enabled", - default=False) + default=False), + UISeparatorDef(key="1"), + UILabelDef(label="Farm Render Options:"), + BoolDef("farm", + label="Submitting to Farm", + default=True), + BoolDef("split_render", + label="Split export and render jobs", + default=self.split_render), + UISeparatorDef(key="2"), + UILabelDef(label="Local Render Options:"), + BoolDef("skip_render", + label="Skip Render", + tooltip="Enable this option to skip render which publish existing frames.", + default=False), ] + + def get_pre_create_attr_defs(self): + attrs = super(CreateVrayROP, self).get_pre_create_attr_defs() + + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py index afe67279e1..37a979d94b 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -8,7 +8,8 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): families = ["mantra_rop", "karma_rop", "redshift_rop", - "arnold_rop"] + "arnold_rop", + "vray_rop"] hosts = ["houdini"] targets = ["local", "remote"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 9b121a6894..9ad44da978 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -13,7 +13,8 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): families = ["mantra_rop", "karma_rop", "redshift_rop", - "arnold_rop"] + "arnold_rop", + "vray_rop"] hosts = ["houdini"] targets = ["local", "remote"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py index 1fce9dc87f..5e89e760ab 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py @@ -13,7 +13,8 @@ class ExtractLocalRender(publish.Extractor): families = ["mantra_rop", "karma_rop", "redshift_rop", - "arnold_rop"] + "arnold_rop", + "vray_rop"] targets = ["local", "remote"] def process(self, instance): diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py index 38912f434f..72ccb90e86 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py @@ -16,7 +16,8 @@ class ValidateSplitExportIsDisabled(pyblish.api.InstancePlugin): hosts = ["houdini"] families = ["mantra_rop", "redshift_rop", - "arnold_rop"] + "arnold_rop", + "vray_rop"] label = "Validate Split Export Is Disabled" actions = [DisableSplitExportAction] 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 c30c7fb0f2..76b397eee0 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -41,7 +41,6 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, "renderlayer", "maxrender", "usdrender", - "vray_rop", "render.farm.hou", "publish.hou"] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 17a0b4ad32..404c7ade04 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -71,7 +71,6 @@ class HoudiniSubmitDeadline( order = pyblish.api.IntegratorOrder hosts = ["houdini"] families = ["usdrender", - "vray_rop", "render.farm.hou"] targets = ["local"] use_published = True @@ -274,7 +273,7 @@ class HoudiniSubmitDeadline( SceneFile=instance.data["ifdFile"], Version=hou_major_minor, ) - elif product_type == "vray_rop": + elif node_type == "vray_renderer": plugin_info = VrayRenderPluginInfo( InputFilename=instance.data["ifdFile"], ) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 6171d7135f..f8df1b4d4c 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -92,8 +92,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "prerender.farm", "prerender.frames_farm", "renderlayer", "imagesequence", "vrayscene", "maxrender", - "render.farm.hou", - "vray_rop"] + "render.farm.hou"] aov_filter = [ { From bcb1c2a0ba3b49c43a08507ad52a9fdce07037ef Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 2 Apr 2024 21:42:56 +0200 Subject: [PATCH 021/269] Use render targets in a similar fashion to Nuke + set houdini parms according to render target value --- .../plugins/create/create_arnold_rop.py | 30 +++++++-------- .../plugins/create/create_karma_rop.py | 23 +++++++----- .../plugins/create/create_mantra_rop.py | 37 +++++++------------ .../plugins/create/create_redshift_rop.py | 33 +++++++---------- .../houdini/plugins/create/create_vray_rop.py | 32 +++++++--------- .../plugins/publish/collect_farm_instances.py | 34 +++++++++++++++-- .../publish/collect_local_render_instances.py | 14 ++++--- .../plugins/publish/extract_local_render.py | 21 ++++++++++- 8 files changed, 128 insertions(+), 96 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index c65c425a45..07c1c98a28 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -1,5 +1,5 @@ from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import EnumDef, BoolDef, UISeparatorDef, UILabelDef +from ayon_core.lib import EnumDef class CreateArnoldRop(plugin.HoudiniCreator): @@ -13,8 +13,8 @@ class CreateArnoldRop(plugin.HoudiniCreator): # Default extension ext = "exr" - # Default to split export and render jobs - split_render = True + # Default render target + render_target = "farm_split" def create(self, product_name, instance_data, pre_create_data): import hou @@ -49,7 +49,7 @@ class CreateArnoldRop(plugin.HoudiniCreator): "ar_exr_half_precision": 1 # half precision } - if pre_create_data.get("split_render"): + if pre_create_data.get("render_target") == "farm_split": ass_filepath = \ "{export_dir}{product_name}/{product_name}.$F4.ass".format( export_dir=hou.text.expandString("$HIP/pyblish/ass/"), @@ -69,24 +69,22 @@ class CreateArnoldRop(plugin.HoudiniCreator): "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", "rad", "rat", "rta", "sgi", "tga", "tif", ] + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + "farm_split": "Farm Rendering - Split export & render jobs", + } return [ - BoolDef("farm", - label="Submitting to Farm", - default=True), - BoolDef("split_render", - label="Split export and render jobs", - default=self.split_render), + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target), EnumDef("image_format", image_format_enum, default=self.ext, label="Image Format Options"), - UISeparatorDef(key="2"), - UILabelDef(label="Local Render Options:"), - BoolDef("skip_render", - label="Skip Render", - tooltip="Enable this option to skip render which publish existing frames.", - default=False), ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index c791cfe647..5d56150df9 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Creator plugin to create Karma ROP.""" from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import BoolDef, EnumDef, NumberDef, UISeparatorDef, UILabelDef +from ayon_core.lib import BoolDef, EnumDef, NumberDef class CreateKarmaROP(plugin.HoudiniCreator): @@ -11,6 +11,9 @@ class CreateKarmaROP(plugin.HoudiniCreator): product_type = "karma_rop" icon = "magic" + # Default render target + render_target = "farm" + def create(self, product_name, instance_data, pre_create_data): import hou # noqa @@ -89,11 +92,17 @@ class CreateKarmaROP(plugin.HoudiniCreator): "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", "rad", "rat", "rta", "sgi", "tga", "tif", ] + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } return [ - BoolDef("farm", - label="Submitting to Farm", - default=True), + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target), EnumDef("image_format", image_format_enum, default="exr", @@ -109,12 +118,6 @@ class CreateKarmaROP(plugin.HoudiniCreator): BoolDef("cam_res", label="Camera Resolution", default=False), - UISeparatorDef(key="2"), - UILabelDef(label="Local Render Options:"), - BoolDef("skip_render", - label="Skip Render", - tooltip="Enable this option to skip render which publish existing frames.", - default=False), ] diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 58aadfd26c..6705621f58 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Creator plugin to create Mantra ROP.""" from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import EnumDef, BoolDef, UISeparatorDef, UILabelDef +from ayon_core.lib import EnumDef, BoolDef class CreateMantraROP(plugin.HoudiniCreator): @@ -11,8 +11,8 @@ class CreateMantraROP(plugin.HoudiniCreator): product_type = "mantra_rop" icon = "magic" - # Default to split export and render jobs - split_render = True + # Default render target + render_target = "farm_split" def create(self, product_name, instance_data, pre_create_data): import hou # noqa @@ -21,10 +21,6 @@ class CreateMantraROP(plugin.HoudiniCreator): instance_data.update({"node_type": "ifd"}) # Add chunk size attribute instance_data["chunkSize"] = 10 - # Submit for job publishing - creator_attributes = instance_data.setdefault( - "creator_attributes", dict()) - creator_attributes["farm"] = pre_create_data.get("farm") instance = super(CreateMantraROP, self).create( product_name, @@ -48,7 +44,7 @@ class CreateMantraROP(plugin.HoudiniCreator): "vm_picture": filepath, } - if pre_create_data.get("split_render"): + if pre_create_data.get("render_target") == "farm_split": ifd_filepath = \ "{export_dir}{product_name}/{product_name}.$F4.ifd".format( export_dir=hou.text.expandString("$HIP/pyblish/ifd/"), @@ -84,9 +80,18 @@ class CreateMantraROP(plugin.HoudiniCreator): "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", "rad", "rat", "rta", "sgi", "tga", "tif", ] + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + "farm_split": "Farm Rendering - Split export & render jobs", + } return [ - UILabelDef(label="Mantra Render Settings:"), + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target), EnumDef("image_format", image_format_enum, default="exr", @@ -96,20 +101,6 @@ class CreateMantraROP(plugin.HoudiniCreator): tooltip="Override the current camera " "resolution, recommended for IPR.", default=False), - UISeparatorDef(key="1"), - UILabelDef(label="Farm Render Options:"), - BoolDef("farm", - label="Submitting to Farm", - default=True), - BoolDef("split_render", - label="Split export and render jobs", - default=self.split_render), - UISeparatorDef(key="2"), - UILabelDef(label="Local Render Options:"), - BoolDef("skip_render", - label="Skip Render", - tooltip="Enable this option to skip render which publish existing frames.", - default=False), ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index f6d42419f9..02c3ed2fc0 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -4,7 +4,7 @@ import hou # noqa from ayon_core.pipeline import CreatorError from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import EnumDef, BoolDef, UISeparatorDef, UILabelDef +from ayon_core.lib import EnumDef class CreateRedshiftROP(plugin.HoudiniCreator): @@ -17,8 +17,8 @@ class CreateRedshiftROP(plugin.HoudiniCreator): ext = "exr" multi_layered_mode = "No Multi-Layered EXR File" - # Default to split export and render jobs - split_render = True + # Default render target + render_target = "farm_split" def create(self, product_name, instance_data, pre_create_data): @@ -97,7 +97,7 @@ class CreateRedshiftROP(plugin.HoudiniCreator): rs_filepath = f"{export_dir}{product_name}/{product_name}.$F4.rs" parms["RS_archive_file"] = rs_filepath - if pre_create_data.get("split_render", self.split_render): + if pre_create_data.get("render_target") == "farm_split": parms["RS_archive_enable"] = 1 instance_node.setParms(parms) @@ -124,9 +124,18 @@ class CreateRedshiftROP(plugin.HoudiniCreator): "No Multi-Layered EXR File", "Full Multi-Layered EXR File" ] + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + "farm_split": "Farm Rendering - Split export & render jobs", + } return [ - UILabelDef(label="RedShift Render Settings:"), + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target), EnumDef("image_format", image_format_enum, default=self.ext, @@ -135,20 +144,6 @@ class CreateRedshiftROP(plugin.HoudiniCreator): multi_layered_mode, default=self.multi_layered_mode, label="Multi-Layered EXR"), - UISeparatorDef(key="1"), - UILabelDef(label="Farm Render Options:"), - BoolDef("farm", - label="Submitting to Farm", - default=True), - BoolDef("split_render", - label="Split export and render jobs", - default=self.split_render), - UISeparatorDef(key="2"), - UILabelDef(label="Local Render Options:"), - BoolDef("skip_render", - label="Skip Render", - tooltip="Enable this option to skip render which publish existing frames.", - default=False), ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 682eec379e..147a34191f 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -4,7 +4,7 @@ import hou from ayon_core.hosts.houdini.api import plugin from ayon_core.pipeline import CreatorError -from ayon_core.lib import EnumDef, BoolDef, UISeparatorDef, UILabelDef +from ayon_core.lib import EnumDef, BoolDef class CreateVrayROP(plugin.HoudiniCreator): @@ -16,8 +16,8 @@ class CreateVrayROP(plugin.HoudiniCreator): icon = "magic" ext = "exr" - # Default to split export and render jobs - split_render = True + # Default render target + render_target = "farm_split" def create(self, product_name, instance_data, pre_create_data): @@ -53,7 +53,7 @@ class CreateVrayROP(plugin.HoudiniCreator): "SettingsEXR_bits_per_channel": "16" # half precision } - if pre_create_data.get("split_render"): + if pre_create_data.get("render_target") == "farm_split": scene_filepath = \ "{export_dir}{product_name}/{product_name}.$F4.vrscene".format( export_dir=hou.text.expandString("$HIP/pyblish/vrscene/"), @@ -146,8 +146,18 @@ class CreateVrayROP(plugin.HoudiniCreator): "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", "rad", "rat", "rta", "sgi", "tga", "tif", ] + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + "farm_split": "Farm Rendering - Split export & render jobs", + } return [ + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target), EnumDef("image_format", image_format_enum, default=self.ext, @@ -162,20 +172,6 @@ class CreateVrayROP(plugin.HoudiniCreator): tooltip="Create Render Element Node " "if enabled", default=False), - UISeparatorDef(key="1"), - UILabelDef(label="Farm Render Options:"), - BoolDef("farm", - label="Submitting to Farm", - default=True), - BoolDef("split_render", - label="Split export and render jobs", - default=self.split_render), - UISeparatorDef(key="2"), - UILabelDef(label="Local Render Options:"), - BoolDef("skip_render", - label="Skip Render", - tooltip="Enable this option to skip render which publish existing frames.", - default=False), ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py index 37a979d94b..56a2b42940 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -16,12 +16,40 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): label = "Collect farm instances" def process(self, instance): + import hou + creator_attribute = instance.data["creator_attributes"] - farm_enabled = creator_attribute["farm"] - instance.data["farm"] = farm_enabled - if not farm_enabled: + product_type = instance.data["productType"] + rop_node = hou.node(instance.data.get("instance_node")) + + # Align split parameter value on rop node to the render target. + if creator_attribute.get("render_target") == "farm_split": + if product_type == "arnold_rop": + rop_node.setParms({"ar_ass_export_enable": 1}) + elif product_type == "mantra_rop": + rop_node.setParms({"soho_outputmode": 1}) + elif product_type == "redshift_rop": + rop_node.setParms({"RS_archive_enable": 1}) + elif product_type == "vray_rop": + rop_node.setParms({"render_export_mode": "2"}) + else: + if product_type == "arnold_rop": + rop_node.setParms({"ar_ass_export_enable": 0}) + elif product_type == "mantra_rop": + rop_node.setParms({"soho_outputmode": 0}) + elif product_type == "redshift_rop": + rop_node.setParms({"RS_archive_enable": 0}) + elif product_type == "vray_rop": + rop_node.setParms({"render_export_mode": "1"}) + + # Collect Render Target + if creator_attribute.get("render_target") not in { + "farm_split", "farm" + }: + instance.data["farm"] = False self.log.debug("Render on farm is disabled. " "Skipping farm collecting.") return + instance.data["farm"] = True instance.data["families"].append("render.farm.hou") diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 9ad44da978..194a05f42d 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -21,10 +21,8 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): label = "Collect local render instances" def process(self, instance): - creator_attribute = instance.data["creator_attributes"] - farm_enabled = creator_attribute["farm"] - instance.data["farm"] = farm_enabled - if farm_enabled: + + if instance.data["farm"]: self.log.debug("Render on farm is enabled. " "Skipping local render collecting.") return @@ -45,7 +43,13 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): # AOV=aov_name, # productName=instance.data["productName"] # ) - product_name = "render{Task}{productName}_{AOV}".format( + name_template = "render{Task}{productName}_{AOV}" + if not aov_name: + # This is done to remove the trailing `_` + # if aov name is an empty string. + name_template = "render{Task}{productName}" + + product_name = name_template.format( Task=self._capitalize(instance.data["task"]), productName=self._capitalize(instance.data["productName"]), AOV=aov_name diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py index 5e89e760ab..120e5563e9 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py @@ -23,11 +23,28 @@ class ExtractLocalRender(publish.Extractor): return creator_attribute = instance.data["creator_attributes"] - skip_render = creator_attribute["skip_render"] - if skip_render: + if creator_attribute.get("render_target") == "local_no_render": self.log.debug("Skip render is enabled, skipping rendering.") return + # Make sure split parameter is turned off. + # Otherwise, render nodes will generate intermediate + # render files instead of render. + product_type = instance.data["productType"] + rop_node = hou.node(instance.data.get("instance_node")) + + if product_type == "arnold_rop": + rop_node.setParms({"ar_ass_export_enable": 0}) + elif product_type == "mantra_rop": + rop_node.setParms({"soho_outputmode": 0}) + elif product_type == "redshift_rop": + rop_node.setParms({"RS_archive_enable": 0}) + elif product_type == "vray_rop": + rop_node.setParms({"render_export_mode": "1"}) + ropnode = hou.node(instance.data.get("instance_node")) render_rop(ropnode) + + # TODO: Check for missing frames. + # self.log.debug(instance.data["expectedFiles"]) From bca10c7c7d0d4d8457a2ba25730dd37ebd5bbff9 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 2 Apr 2024 21:43:36 +0200 Subject: [PATCH 022/269] remove unnecessary validator --- .../validate_split_render_is_disabled.py | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py deleted file mode 100644 index 72ccb90e86..0000000000 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_split_render_is_disabled.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- -import pyblish.api -import hou -from ayon_core.pipeline import PublishValidationError -from ayon_core.pipeline.publish import RepairAction - - -class DisableSplitExportAction(RepairAction): - label = "Disable Split Export" - - -class ValidateSplitExportIsDisabled(pyblish.api.InstancePlugin): - """Validate the Instance has no current cooking errors.""" - - order = pyblish.api.ValidatorOrder - hosts = ["houdini"] - families = ["mantra_rop", - "redshift_rop", - "arnold_rop", - "vray_rop"] - label = "Validate Split Export Is Disabled" - actions = [DisableSplitExportAction] - - def process(self, instance): - - invalid = self.get_invalid(instance) - if invalid: - nodes = [n.path() for n in invalid] - raise PublishValidationError( - "See log for details. " - "Invalid nodes: {0}".format(nodes) - ) - - - @classmethod - def get_invalid(cls, instance): - - invalid = [] - rop_node = hou.node(instance.data["instance_node"]) - - creator_attribute = instance.data["creator_attributes"] - farm_enabled = creator_attribute["farm"] - if farm_enabled: - cls.log.debug( - "Farm is enabled, skipping validation." - ) - return - - - split_enabled = creator_attribute["split_render"] - if split_enabled: - invalid.append(rop_node) - cls.log.error( - "Split Export must be disabled in local render instances." - ) - - return invalid - - @classmethod - def repair(cls, instance): - - create_context = instance.context.data["create_context"] - created_instance = create_context.get_instance_by_id( - instance.data["instance_id"]) - creator_attributes = created_instance["creator_attributes"] - # Disable split_render - creator_attributes["split_render"] = False - create_context.save_changes() From 4a5f0ebc92113f2dafd263ac3b771fb2f194563b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 2 Apr 2024 21:44:54 +0200 Subject: [PATCH 023/269] set rsnode parms according to render target value before collecting expected files --- .../plugins/publish/collect_redshift_rop.py | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py index 55a55bb12a..191a9c1ebc 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -60,11 +60,27 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): instance.data["ifdFile"] = beauty_export_product instance.data["exportFiles"] = list(export_products) - full_exr_mode = (rop.evalParm("RS_outputMultilayerMode") == "2") - if full_exr_mode: - # Ignore beauty suffix if full mode is enabled - # As this is what the rop does. - beauty_suffix = "" + # Set MultiLayer Mode. + creator_attribute = instance.data["creator_attributes"] + ext = creator_attribute.get("image_format") + multi_layered_mode = creator_attribute.get("multi_layered_mode") + full_exr_mode = False + if ext == "exr": + if multi_layered_mode == "No Multi-Layered EXR File": + rop.setParms({ + "RS_outputMultilayerMode": "1", + "RS_aovMultipart": False + }) + full_exr_mode = True + # Ignore beauty suffix if full mode is enabled + # As this is what the rop does. + beauty_suffix = "" + + elif multi_layered_mode == "Full Multi-Layered EXR File": + rop.setParms({ + "RS_outputMultilayerMode": "2", + "RS_aovMultipart": True + }) # Default beauty/main layer AOV beauty_product = self.get_render_product_name( @@ -75,7 +91,7 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): beauty_suffix: self.generate_expected_files(instance, beauty_product) } - + aovs_rop = rop.parm("RS_aovGetFromNode").evalAsNode() if aovs_rop: rop = aovs_rop @@ -98,7 +114,7 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): if rop.parm(f"RS_aovID_{i}").evalAsString() == "CRYPTOMATTE" or \ not full_exr_mode: - + aov_product = self.get_render_product_name(aov_prefix, aov_suffix) render_products.append(aov_product) From 7f703585f12d47bc7d6044faf3641fc61cbdab55 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Thu, 4 Apr 2024 10:51:51 +0200 Subject: [PATCH 024/269] remove targets class attribute. Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- .../houdini/plugins/publish/collect_local_render_instances.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 194a05f42d..1fd4129ee1 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -17,7 +17,6 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): "vray_rop"] hosts = ["houdini"] - targets = ["local", "remote"] label = "Collect local render instances" def process(self, instance): From 4e6bd3d3361708fa7cf84ef69e0e5715ed451df2 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 4 Apr 2024 12:32:57 +0200 Subject: [PATCH 025/269] remove the un-necessary 'render.farm.hou' intermidate family --- .../plugins/publish/collect_farm_instances.py | 1 - .../plugins/publish/increment_current_file.py | 6 +++++- .../deadline/plugins/publish/collect_pools.py | 6 +++++- .../publish/submit_houdini_render_deadline.py | 12 +++++++++++- .../deadline/plugins/publish/submit_publish_job.py | 6 +++++- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py index 56a2b42940..391afe7387 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -52,4 +52,3 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): return instance.data["farm"] = True - instance.data["families"].append("render.farm.hou") diff --git a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py index acb66afa4e..ffd9a75620 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/increment_current_file.py @@ -19,7 +19,11 @@ class IncrementCurrentFile(pyblish.api.ContextPlugin): hosts = ["houdini"] families = ["workfile", "usdrender", - "render.farm.hou", + "mantra_rop", + "karma_rop", + "redshift_rop", + "arnold_rop", + "vray_rop", "render.local.hou", "publish.hou"] optional = True 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 76b397eee0..6b7449b8f8 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -41,7 +41,11 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, "renderlayer", "maxrender", "usdrender", - "render.farm.hou", + "mantra_rop", + "karma_rop", + "redshift_rop", + "arnold_rop", + "vray_rop", "publish.hou"] primary_pool = None diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 404c7ade04..b562e2848b 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -71,7 +71,12 @@ class HoudiniSubmitDeadline( order = pyblish.api.IntegratorOrder hosts = ["houdini"] families = ["usdrender", - "render.farm.hou"] + "mantra_rop", + "karma_rop", + "redshift_rop", + "arnold_rop", + "vray_rop"] + targets = ["local"] use_published = True @@ -314,6 +319,11 @@ class HoudiniSubmitDeadline( return attr.asdict(plugin_info) def process(self, instance): + if not instance.data["farm"]: + self.log.debug("Render on farm is disabled. " + "Skipping deadline submission.") + return + super(HoudiniSubmitDeadline, self).process(instance) # TODO: Avoid the need for this logic here, needed for submit publish diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index f8df1b4d4c..773532e5c0 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -92,7 +92,11 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "prerender.farm", "prerender.frames_farm", "renderlayer", "imagesequence", "vrayscene", "maxrender", - "render.farm.hou"] + "mantra_rop", + "karma_rop", + "redshift_rop", + "arnold_rop", + "vray_rop"] aov_filter = [ { From 05bdbb2aa6ff99eed01848ce2e53a3fbe3ff9341 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 4 Apr 2024 12:58:29 +0200 Subject: [PATCH 026/269] Abort publishing if there are missing frames. --- .../plugins/publish/extract_local_render.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py index 120e5563e9..23a64945aa 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py @@ -3,6 +3,7 @@ import pyblish.api from ayon_core.pipeline import publish from ayon_core.hosts.houdini.api.lib import render_rop import hou +import os class ExtractLocalRender(publish.Extractor): @@ -46,5 +47,17 @@ class ExtractLocalRender(publish.Extractor): ropnode = hou.node(instance.data.get("instance_node")) render_rop(ropnode) - # TODO: Check for missing frames. - # self.log.debug(instance.data["expectedFiles"]) + # Check missing frames. + # Frames won't exist if user cancels the render. + expected_files = next(iter(instance.data["expectedFiles"]), {}) + expected_files = sum(expected_files.values(), []) + missing_frames = [ + frame + for frame in expected_files + if not os.path.exists(frame) + ] + if missing_frames: + # TODO: Use user friendly error reporting. + raise RuntimeError("Failed to complete render extraction. " + "Missing output files: {}".format( + missing_frames)) From 78da85398d2ffb86673acf0f88dba94c54ad140a Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 4 Apr 2024 15:39:04 +0200 Subject: [PATCH 027/269] Refactor filename since it's now not only Alembic but also USD --- .../hosts/blender/plugins/load/{load_abc.py => load_cache.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/ayon_core/hosts/blender/plugins/load/{load_abc.py => load_cache.py} (100%) diff --git a/client/ayon_core/hosts/blender/plugins/load/load_abc.py b/client/ayon_core/hosts/blender/plugins/load/load_cache.py similarity index 100% rename from client/ayon_core/hosts/blender/plugins/load/load_abc.py rename to client/ayon_core/hosts/blender/plugins/load/load_cache.py From fe6c1fc9f5efa2c0e5c73d397c8584443ae7cd94 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Thu, 4 Apr 2024 15:54:38 +0200 Subject: [PATCH 028/269] remove targets class attribute. Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com> --- .../hosts/houdini/plugins/publish/extract_local_render.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py index 23a64945aa..cf94019947 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py @@ -16,7 +16,6 @@ class ExtractLocalRender(publish.Extractor): "redshift_rop", "arnold_rop", "vray_rop"] - targets = ["local", "remote"] def process(self, instance): if instance.data.get("farm"): From eca60b00068b891d0f5c9a80d632f7854a454e43 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 5 Apr 2024 17:34:28 +0100 Subject: [PATCH 029/269] 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 a6ca1488997950044ebddc69b418f5605b9103ab Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 8 Apr 2024 14:24:06 +0200 Subject: [PATCH 030/269] Houdini local render: support single frame --- .../plugins/publish/collect_local_render_instances.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 1fd4129ee1..1dc26e1322 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -62,6 +62,13 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): staging_dir = os.path.dirname(aov_filepaths[0]) ext = aov_filepaths[0].split(".")[-1] + # Support Single frame. + # The integrator wants single files to be a single + # filename instead of a list. + # More info: https://github.com/ynput/ayon-core/issues/238 + if len(aov_filenames) == 1: + aov_filenames = aov_filenames[0] + aov_instance.data.update({ # 'label': label, "task": instance.data["task"], @@ -85,6 +92,7 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): } ] }) + self.log.debug(aov_instance.data) # Remove Mantra instance # I can't remove it here as I still need it to trigger the render. From d7b1f3a3f7a82be99e325201b14dcffbafab4614 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 8 Apr 2024 16:34:38 +0200 Subject: [PATCH 031/269] Houdini local render: support adding review family to the render --- .../publish/collect_local_render_instances.py | 5 ++--- .../plugins/publish/collect_review_data.py | 20 +++++++++++++++++-- .../houdini/plugins/publish/extract_opengl.py | 4 ++++ .../publish/validate_review_colorspace.py | 8 +++++++- .../plugins/publish/validate_scene_review.py | 4 ++++ 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 1dc26e1322..e221990f2b 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -78,21 +78,20 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): "productType": product_type, "productName": product_name, "productGroup": product_group, - "tags": [], - "families": ["render.local.hou"], + "families": ["render.local.hou", "review"], "instance_node": instance.data["instance_node"], "representations": [ { "stagingDir": staging_dir, "ext": ext, "name": ext, + "tags": ["review"], "files": aov_filenames, "frameStart": instance.data["frameStartHandle"], "frameEnd": instance.data["frameEndHandle"] } ] }) - self.log.debug(aov_instance.data) # Remove Mantra instance # I can't remove it here as I still need it to trigger the render. diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_review_data.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_review_data.py index 9671945b9a..7714ed0954 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_review_data.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_review_data.py @@ -8,7 +8,8 @@ class CollectHoudiniReviewData(pyblish.api.InstancePlugin): label = "Collect Review Data" # This specific order value is used so that # this plugin runs after CollectRopFrameRange - order = pyblish.api.CollectorOrder + 0.1 + # Also after CollectLocalRenderInstances + order = pyblish.api.CollectorOrder + 0.13 hosts = ["houdini"] families = ["review"] @@ -28,7 +29,8 @@ class CollectHoudiniReviewData(pyblish.api.InstancePlugin): ropnode_path = instance.data["instance_node"] ropnode = hou.node(ropnode_path) - camera_path = ropnode.parm("camera").eval() + # Get camera based on the instance_node type. + camera_path = self._get_camera_path(ropnode) camera_node = hou.node(camera_path) if not camera_node: self.log.warning("No valid camera node found on review node: " @@ -55,3 +57,17 @@ class CollectHoudiniReviewData(pyblish.api.InstancePlugin): # Store focal length in `burninDataMembers` burnin_members = instance.data.setdefault("burninDataMembers", {}) burnin_members["focalLength"] = focal_length + + def _get_camera_path(self, ropnode): + if ropnode.type().name() in { + "opengl", "karma", "ifd", "arnold" + }: + return ropnode.parm("camera").eval() + + elif ropnode.type().name() == "Redshift_ROP": + return ropnode.parm("RS_renderCamera").eval() + + elif ropnode.type().name() == "vray_renderer": + return ropnode.parm("render_camera").eval() + + return "" diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_opengl.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_opengl.py index fabdfd9a9d..69bbb22340 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_opengl.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_opengl.py @@ -17,6 +17,10 @@ class ExtractOpenGL(publish.Extractor): def process(self, instance): ropnode = hou.node(instance.data.get("instance_node")) + if ropnode.type().name() != "opengl": + self.log.debug("Skipping OpenGl extraction. Rop node {} " + "is not an OpenGl node.".format(ropnode.path())) + return output = ropnode.evalParm("picture") staging_dir = os.path.normpath(os.path.dirname(output)) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_review_colorspace.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_review_colorspace.py index 031138e21d..e02ce93f0d 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_review_colorspace.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_review_colorspace.py @@ -33,6 +33,13 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin, def process(self, instance): + rop_node = hou.node(instance.data["instance_node"]) + + if rop_node.type().name() != "opengl": + self.log.debug("Skipping Validation. Rop node {} " + "is not an OpenGl node.".format(rop_node.path())) + return + if not self.is_active(instance.data): return @@ -43,7 +50,6 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin, ) return - rop_node = hou.node(instance.data["instance_node"]) if rop_node.evalParm("colorcorrect") != 2: # any colorspace settings other than default requires # 'Color Correct' parm to be set to 'OpenColorIO' diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_scene_review.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_scene_review.py index b6007d3f0f..9b81f0f8ed 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_scene_review.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_scene_review.py @@ -19,6 +19,10 @@ class ValidateSceneReview(pyblish.api.InstancePlugin): report = [] instance_node = hou.node(instance.data.get("instance_node")) + if instance_node.type().name() != "opengl": + self.log.debug("Skipping Validation. Rop node {} " + "is not an OpenGl node.".format(instance_node.path())) + return invalid = self.get_invalid_scene_path(instance_node) if invalid: From c5df561c970bc1cfc0498f8b1adf52392f5fe969 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Tue, 9 Apr 2024 20:20:33 +0800 Subject: [PATCH 032/269] Transfer settings from pre create to instance --- .../hosts/houdini/plugins/create/create_arnold_rop.py | 6 ++++++ .../hosts/houdini/plugins/create/create_karma_rop.py | 6 ++++++ .../hosts/houdini/plugins/create/create_mantra_rop.py | 6 ++++++ .../hosts/houdini/plugins/create/create_redshift_rop.py | 6 ++++++ .../hosts/houdini/plugins/create/create_vray_rop.py | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 07c1c98a28..08ed1bc91a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -18,6 +18,12 @@ class CreateArnoldRop(plugin.HoudiniCreator): def create(self, product_name, instance_data, pre_create_data): import hou + # Transfer settings from pre create to instance + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + for key in ["render_target"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] # Remove the active, we are checking the bypass flag of the nodes instance_data.pop("active", None) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index 5d56150df9..a3a557791e 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -16,6 +16,12 @@ class CreateKarmaROP(plugin.HoudiniCreator): def create(self, product_name, instance_data, pre_create_data): import hou # noqa + # Transfer settings from pre create to instance + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + for key in ["render_target"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] instance_data.pop("active", None) instance_data.update({"node_type": "karma"}) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 6705621f58..1b177563bc 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -16,6 +16,12 @@ class CreateMantraROP(plugin.HoudiniCreator): def create(self, product_name, instance_data, pre_create_data): import hou # noqa + # Transfer settings from pre create to instance + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + for key in ["render_target"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] instance_data.pop("active", None) instance_data.update({"node_type": "ifd"}) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index 02c3ed2fc0..942d321b92 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -21,6 +21,12 @@ class CreateRedshiftROP(plugin.HoudiniCreator): render_target = "farm_split" def create(self, product_name, instance_data, pre_create_data): + # Transfer settings from pre create to instance + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + for key in ["render_target"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] instance_data.pop("active", None) instance_data.update({"node_type": "Redshift_ROP"}) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 147a34191f..ad181e4f89 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -20,6 +20,12 @@ class CreateVrayROP(plugin.HoudiniCreator): render_target = "farm_split" def create(self, product_name, instance_data, pre_create_data): + # Transfer settings from pre create to instance + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + for key in ["render_target"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] instance_data.pop("active", None) instance_data.update({"node_type": "vray_renderer"}) From 76e4b77845bb34737840680d0e5a15ff56733e30 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 9 Apr 2024 20:25:41 +0200 Subject: [PATCH 033/269] transfer all precreate settings to instance --- .../hosts/houdini/plugins/create/create_arnold_rop.py | 4 +--- .../hosts/houdini/plugins/create/create_karma_rop.py | 4 +--- .../hosts/houdini/plugins/create/create_mantra_rop.py | 4 +--- .../hosts/houdini/plugins/create/create_redshift_rop.py | 4 +--- .../ayon_core/hosts/houdini/plugins/create/create_vray_rop.py | 4 +--- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 08ed1bc91a..0e25523123 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -21,9 +21,7 @@ class CreateArnoldRop(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - for key in ["render_target"]: - if key in pre_create_data: - creator_attributes[key] = pre_create_data[key] + creator_attributes.update(pre_create_data) # Remove the active, we are checking the bypass flag of the nodes instance_data.pop("active", None) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index a3a557791e..4ddf7af376 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -19,9 +19,7 @@ class CreateKarmaROP(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - for key in ["render_target"]: - if key in pre_create_data: - creator_attributes[key] = pre_create_data[key] + creator_attributes.update(pre_create_data) instance_data.pop("active", None) instance_data.update({"node_type": "karma"}) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 1b177563bc..7d481d0dbf 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -19,9 +19,7 @@ class CreateMantraROP(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - for key in ["render_target"]: - if key in pre_create_data: - creator_attributes[key] = pre_create_data[key] + creator_attributes.update(pre_create_data) instance_data.pop("active", None) instance_data.update({"node_type": "ifd"}) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index 942d321b92..dd5325c23c 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -24,9 +24,7 @@ class CreateRedshiftROP(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - for key in ["render_target"]: - if key in pre_create_data: - creator_attributes[key] = pre_create_data[key] + creator_attributes.update(pre_create_data) instance_data.pop("active", None) instance_data.update({"node_type": "Redshift_ROP"}) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index ad181e4f89..5587f0151b 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -23,9 +23,7 @@ class CreateVrayROP(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - for key in ["render_target"]: - if key in pre_create_data: - creator_attributes[key] = pre_create_data[key] + creator_attributes.update(pre_create_data) instance_data.pop("active", None) instance_data.update({"node_type": "vray_renderer"}) From 90e2c1f1b5235e0d6fd408588a74f69f9cb7ac51 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 9 Apr 2024 21:58:31 +0200 Subject: [PATCH 034/269] use get_product_name instead of hardcoded productname --- .../publish/collect_local_render_instances.py | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index e221990f2b..4622f2d9cd 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -1,5 +1,6 @@ import os import pyblish.api +from ayon_core.pipeline.create import get_product_name class CollectLocalRenderInstances(pyblish.api.InstancePlugin): @@ -28,31 +29,24 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): # Create Instance for each AOV. context = instance.context + self.log.debug(instance.data["expectedFiles"]) expectedFiles = next(iter(instance.data["expectedFiles"]), {}) product_type = "render" # is always render - product_group = "render{Task}{productName}".format( - Task=self._capitalize(instance.data["task"]), - productName=self._capitalize(instance.data["productName"]) - ) # is always the group + product_group = get_product_name( + context.data["projectName"], + context.data["taskEntity"]["name"], + context.data["taskEntity"]["taskType"], + context.data["hostName"], + product_type, + instance.data["productName"] + ) for aov_name, aov_filepaths in expectedFiles.items(): - # Some AOV instance data - # label = "{productName}_{AOV}".format( - # AOV=aov_name, - # productName=instance.data["productName"] - # ) - name_template = "render{Task}{productName}_{AOV}" - if not aov_name: - # This is done to remove the trailing `_` - # if aov name is an empty string. - name_template = "render{Task}{productName}" + product_name = product_group - product_name = name_template.format( - Task=self._capitalize(instance.data["task"]), - productName=self._capitalize(instance.data["productName"]), - AOV=aov_name - ) + if aov_name: + product_name = "{}_{}".format(product_name, aov_name) # Create instance for each AOV aov_instance = context.create_instance(product_name) @@ -96,7 +90,3 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): # Remove Mantra instance # I can't remove it here as I still need it to trigger the render. # context.remove(instance) - - @staticmethod - def _capitalize(word): - return word[:1].upper() + word[1:] From 95757c6b68776884d481f03e2890b9c0a2ee8107 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 9 Apr 2024 22:16:53 +0200 Subject: [PATCH 035/269] add doc string to _get_camera_path --- .../houdini/plugins/publish/collect_review_data.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_review_data.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_review_data.py index 7714ed0954..ed2de785a2 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_review_data.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_review_data.py @@ -59,6 +59,18 @@ class CollectHoudiniReviewData(pyblish.api.InstancePlugin): burnin_members["focalLength"] = focal_length def _get_camera_path(self, ropnode): + """Get the camera path associated with the given rop node. + + This function evaluates the camera parameter according to the + type of the given rop node. + + Returns: + Union[str, None]: Camera path or None. + + This function can return empty string if the camera + path is empty i.e. no camera path. + """ + if ropnode.type().name() in { "opengl", "karma", "ifd", "arnold" }: @@ -70,4 +82,4 @@ class CollectHoudiniReviewData(pyblish.api.InstancePlugin): elif ropnode.type().name() == "vray_renderer": return ropnode.parm("render_camera").eval() - return "" + return None From 75879f54be31e293cad18a1c4a8a60005d62ba70 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 9 Apr 2024 22:28:53 +0200 Subject: [PATCH 036/269] revert changes --- .../deadline/plugins/publish/collect_pools.py | 4 ++-- .../publish/submit_houdini_render_deadline.py | 21 ++++++------------- .../plugins/publish/submit_publish_job.py | 8 +++---- 3 files changed, 11 insertions(+), 22 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 6b7449b8f8..6923c2b16b 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -41,10 +41,10 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, "renderlayer", "maxrender", "usdrender", - "mantra_rop", - "karma_rop", "redshift_rop", "arnold_rop", + "mantra_rop", + "karma_rop", "vray_rop", "publish.hou"] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index b562e2848b..64a7423e8d 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -71,12 +71,11 @@ class HoudiniSubmitDeadline( order = pyblish.api.IntegratorOrder hosts = ["houdini"] families = ["usdrender", - "mantra_rop", - "karma_rop", "redshift_rop", "arnold_rop", + "mantra_rop", + "karma_rop", "vray_rop"] - targets = ["local"] use_published = True @@ -266,23 +265,20 @@ class HoudiniSubmitDeadline( # Output driver to render if job_type == "render": product_type = instance.data.get("productType") - rop_node = hou.node(instance.data.get("instance_node")) - node_type = rop_node.type().name() - - if node_type == "arnold": + if product_type == "arnold_rop": plugin_info = ArnoldRenderDeadlinePluginInfo( InputFile=instance.data["ifdFile"] ) - elif node_type == "ifd": + elif product_type == "mantra_rop": plugin_info = MantraRenderDeadlinePluginInfo( SceneFile=instance.data["ifdFile"], Version=hou_major_minor, ) - elif node_type == "vray_renderer": + elif product_type == "vray_rop": plugin_info = VrayRenderPluginInfo( InputFilename=instance.data["ifdFile"], ) - elif node_type == "Redshift_ROP": + elif product_type == "redshift_rop": plugin_info = RedshiftRenderPluginInfo( SceneFile=instance.data["ifdFile"] ) @@ -319,11 +315,6 @@ class HoudiniSubmitDeadline( return attr.asdict(plugin_info) def process(self, instance): - if not instance.data["farm"]: - self.log.debug("Render on farm is disabled. " - "Skipping deadline submission.") - return - super(HoudiniSubmitDeadline, self).process(instance) # TODO: Avoid the need for this logic here, needed for submit publish diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 87693522c3..8def9cc63c 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -92,11 +92,9 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "prerender.farm", "prerender.frames_farm", "renderlayer", "imagesequence", "vrayscene", "maxrender", - "mantra_rop", - "karma_rop", - "redshift_rop", - "arnold_rop", - "vray_rop"] + "arnold_rop", "mantra_rop", + "karma_rop", "vray_rop", + "redshift_rop"] aov_filter = [ { From 6151ff57e2dc9f5574cb3ddbb8685d4ec69752f0 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 9 Apr 2024 22:30:01 +0200 Subject: [PATCH 037/269] skip submission if farm is disabled --- .../plugins/publish/submit_houdini_render_deadline.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 64a7423e8d..4c517d7848 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -315,6 +315,11 @@ class HoudiniSubmitDeadline( return attr.asdict(plugin_info) def process(self, instance): + if not instance.data["farm"]: + self.log.debug("Render on farm is disabled. " + "Skipping deadline submission.") + return + super(HoudiniSubmitDeadline, self).process(instance) # TODO: Avoid the need for this logic here, needed for submit publish From c49c9016bfdafa27a67f7693b72d0a340a909fa1 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 9 Apr 2024 22:35:06 +0200 Subject: [PATCH 038/269] add a TODO about enhancing code readability --- .../hosts/houdini/plugins/publish/extract_local_render.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py index cf94019947..3f332acc55 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py @@ -49,7 +49,8 @@ class ExtractLocalRender(publish.Extractor): # Check missing frames. # Frames won't exist if user cancels the render. expected_files = next(iter(instance.data["expectedFiles"]), {}) - expected_files = sum(expected_files.values(), []) + # TODO: enhance the readability. + expected_files = sum(expected_files.values(), []) missing_frames = [ frame for frame in expected_files From 3b6c3bb5e5fe61361dd2774b1aa07f9a80a0384b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 9 Apr 2024 22:49:34 +0200 Subject: [PATCH 039/269] remove redundant attr_defs --- .../hosts/houdini/plugins/create/create_arnold_rop.py | 3 +-- .../ayon_core/hosts/houdini/plugins/create/create_karma_rop.py | 3 +-- .../hosts/houdini/plugins/create/create_mantra_rop.py | 3 +-- .../hosts/houdini/plugins/create/create_redshift_rop.py | 3 +-- .../ayon_core/hosts/houdini/plugins/create/create_vray_rop.py | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 0e25523123..0965ee59ca 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -92,6 +92,5 @@ class CreateArnoldRop(plugin.HoudiniCreator): ] def get_pre_create_attr_defs(self): - attrs = super(CreateArnoldRop, self).get_pre_create_attr_defs() - return attrs + self.get_instance_attr_defs() + return self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index 4ddf7af376..c795512469 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -126,6 +126,5 @@ class CreateKarmaROP(plugin.HoudiniCreator): def get_pre_create_attr_defs(self): - attrs = super(CreateKarmaROP, self).get_pre_create_attr_defs() - return attrs + self.get_instance_attr_defs() + return self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 7d481d0dbf..d0fc79f608 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -108,6 +108,5 @@ class CreateMantraROP(plugin.HoudiniCreator): ] def get_pre_create_attr_defs(self): - attrs = super(CreateMantraROP, self).get_pre_create_attr_defs() - return attrs + self.get_instance_attr_defs() + return self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index dd5325c23c..0094269f47 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -151,6 +151,5 @@ class CreateRedshiftROP(plugin.HoudiniCreator): ] def get_pre_create_attr_defs(self): - attrs = super(CreateRedshiftROP, self).get_pre_create_attr_defs() - return attrs + self.get_instance_attr_defs() + return self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 5587f0151b..8c4084cf9f 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -179,6 +179,5 @@ class CreateVrayROP(plugin.HoudiniCreator): ] def get_pre_create_attr_defs(self): - attrs = super(CreateVrayROP, self).get_pre_create_attr_defs() - return attrs + self.get_instance_attr_defs() + return self.get_instance_attr_defs() From 85140058ee6d4397485b33974abb78f7509a88f0 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 12 Apr 2024 15:34:47 +0100 Subject: [PATCH 040/269] 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 041/269] 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 042/269] 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 043/269] 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 044/269] 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 bedebd8f8e871665d6b117f5c13c8a20a63ad24a Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 15 Apr 2024 12:28:31 +0200 Subject: [PATCH 045/269] add 'Mark as reviewable' todo --- .../plugins/publish/collect_local_render_instances.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 4622f2d9cd..f3ad5862a6 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -63,6 +63,8 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): if len(aov_filenames) == 1: aov_filenames = aov_filenames[0] + # TODO: Add some option to allow users to mark + # aov_instances as reviewable. aov_instance.data.update({ # 'label': label, "task": instance.data["task"], @@ -72,14 +74,14 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): "productType": product_type, "productName": product_name, "productGroup": product_group, - "families": ["render.local.hou", "review"], + "families": ["render.local.hou"], "instance_node": instance.data["instance_node"], "representations": [ { "stagingDir": staging_dir, "ext": ext, "name": ext, - "tags": ["review"], + "tags": [], "files": aov_filenames, "frameStart": instance.data["frameStartHandle"], "frameEnd": instance.data["frameEndHandle"] From 16c8c859b32c186559e526cbb941842e1fb0b972 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 15 Apr 2024 12:29:58 +0200 Subject: [PATCH 046/269] update a comment --- .../houdini/plugins/publish/collect_local_render_instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index f3ad5862a6..ae98e6ed87 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -89,6 +89,6 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): ] }) - # Remove Mantra instance + # Remove original render instance # I can't remove it here as I still need it to trigger the render. # context.remove(instance) From b6a5eadf96828d3a84ff680ccbd590ce90ea11f6 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Mon, 15 Apr 2024 12:26:22 +0100 Subject: [PATCH 047/269] 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 6ef55adaf044a2c3ece228688fdae2cafcb7e5ec Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 15 Apr 2024 21:01:19 +0200 Subject: [PATCH 048/269] add missing key --- .../houdini/plugins/publish/collect_local_render_instances.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index ae98e6ed87..ea1eeb62af 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -72,6 +72,7 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): "frameStart": instance.data["frameStartHandle"], "frameEnd": instance.data["frameEndHandle"], "productType": product_type, + "family": product_type, "productName": product_name, "productGroup": product_group, "families": ["render.local.hou"], From 409c243516c498164cd115de8daea4cdf72d5206 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 15 Apr 2024 21:47:13 +0200 Subject: [PATCH 049/269] update node parameter in the extractor instead of the collector --- .../plugins/publish/collect_arnold_rop.py | 4 +- .../plugins/publish/collect_farm_instances.py | 26 +------ .../plugins/publish/collect_mantra_rop.py | 4 +- .../plugins/publish/collect_redshift_rop.py | 4 +- .../plugins/publish/collect_vray_rop.py | 4 +- .../plugins/publish/extract_local_render.py | 63 ----------------- .../houdini/plugins/publish/extract_render.py | 67 +++++++++++++++++++ 7 files changed, 74 insertions(+), 98 deletions(-) delete mode 100644 client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py create mode 100644 client/ayon_core/hosts/houdini/plugins/publish/extract_render.py diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py index 7fe38555a3..c373d94653 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -41,11 +41,9 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): render_products = [] # Store whether we are splitting the render job (export + render) - split_render = bool(rop.parm("ar_ass_export_enable").eval()) - instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if split_render: + if instance.data["splitRender"]: export_prefix = evalParmNoFrame( rop, "ar_ass_file", pad_character="0" ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py index 391afe7387..c5a982996b 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -16,31 +16,8 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): label = "Collect farm instances" def process(self, instance): - import hou creator_attribute = instance.data["creator_attributes"] - product_type = instance.data["productType"] - rop_node = hou.node(instance.data.get("instance_node")) - - # Align split parameter value on rop node to the render target. - if creator_attribute.get("render_target") == "farm_split": - if product_type == "arnold_rop": - rop_node.setParms({"ar_ass_export_enable": 1}) - elif product_type == "mantra_rop": - rop_node.setParms({"soho_outputmode": 1}) - elif product_type == "redshift_rop": - rop_node.setParms({"RS_archive_enable": 1}) - elif product_type == "vray_rop": - rop_node.setParms({"render_export_mode": "2"}) - else: - if product_type == "arnold_rop": - rop_node.setParms({"ar_ass_export_enable": 0}) - elif product_type == "mantra_rop": - rop_node.setParms({"soho_outputmode": 0}) - elif product_type == "redshift_rop": - rop_node.setParms({"RS_archive_enable": 0}) - elif product_type == "vray_rop": - rop_node.setParms({"render_export_mode": "1"}) # Collect Render Target if creator_attribute.get("render_target") not in { @@ -52,3 +29,6 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): return instance.data["farm"] = True + instance.data["splitRender"] = ( + creator_attribute.get("render_target") == "farm_split" + ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py index df9acc4b61..9894e2beda 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -45,11 +45,9 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): render_products = [] # Store whether we are splitting the render job (export + render) - split_render = bool(rop.parm("soho_outputmode").eval()) - instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if split_render: + if instance.data["splitRender"]: export_prefix = evalParmNoFrame( rop, "soho_diskfile", pad_character="0" ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py index 191a9c1ebc..bd01f929c3 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -43,10 +43,8 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): default_prefix = evalParmNoFrame(rop, "RS_outputFileNamePrefix") beauty_suffix = rop.evalParm("RS_outputBeautyAOVSuffix") # Store whether we are splitting the render job (export + render) - split_render = bool(rop.parm("RS_archive_enable").eval()) - instance.data["splitRender"] = split_render export_products = [] - if split_render: + if instance.data["splitRender"]: export_prefix = evalParmNoFrame( rop, "RS_archive_file", pad_character="0" ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py index 62b7dcdd5d..63e16d541d 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -46,11 +46,9 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): # TODO: add render elements if render element # Store whether we are splitting the render job in an export + render - split_render = rop.parm("render_export_mode").eval() == "2" - instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if split_render: + if instance.data["splitRender"]: export_prefix = evalParmNoFrame( rop, "render_export_filepath", pad_character="0" ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py deleted file mode 100644 index 3f332acc55..0000000000 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_local_render.py +++ /dev/null @@ -1,63 +0,0 @@ -import pyblish.api - -from ayon_core.pipeline import publish -from ayon_core.hosts.houdini.api.lib import render_rop -import hou -import os - - -class ExtractLocalRender(publish.Extractor): - - order = pyblish.api.ExtractorOrder - label = "Extract Local Render" - hosts = ["houdini"] - families = ["mantra_rop", - "karma_rop", - "redshift_rop", - "arnold_rop", - "vray_rop"] - - def process(self, instance): - if instance.data.get("farm"): - self.log.debug("Should be processed on farm, skipping.") - return - - creator_attribute = instance.data["creator_attributes"] - - if creator_attribute.get("render_target") == "local_no_render": - self.log.debug("Skip render is enabled, skipping rendering.") - return - - # Make sure split parameter is turned off. - # Otherwise, render nodes will generate intermediate - # render files instead of render. - product_type = instance.data["productType"] - rop_node = hou.node(instance.data.get("instance_node")) - - if product_type == "arnold_rop": - rop_node.setParms({"ar_ass_export_enable": 0}) - elif product_type == "mantra_rop": - rop_node.setParms({"soho_outputmode": 0}) - elif product_type == "redshift_rop": - rop_node.setParms({"RS_archive_enable": 0}) - elif product_type == "vray_rop": - rop_node.setParms({"render_export_mode": "1"}) - - ropnode = hou.node(instance.data.get("instance_node")) - render_rop(ropnode) - - # Check missing frames. - # Frames won't exist if user cancels the render. - expected_files = next(iter(instance.data["expectedFiles"]), {}) - # TODO: enhance the readability. - expected_files = sum(expected_files.values(), []) - missing_frames = [ - frame - for frame in expected_files - if not os.path.exists(frame) - ] - if missing_frames: - # TODO: Use user friendly error reporting. - raise RuntimeError("Failed to complete render extraction. " - "Missing output files: {}".format( - missing_frames)) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py new file mode 100644 index 0000000000..7ea276a94d --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py @@ -0,0 +1,67 @@ +import pyblish.api + +from ayon_core.pipeline import publish +from ayon_core.hosts.houdini.api.lib import render_rop +import hou +import os + + +class ExtractRender(publish.Extractor): + + order = pyblish.api.ExtractorOrder + label = "Extract Render" + hosts = ["houdini"] + families = ["mantra_rop", + "karma_rop", + "redshift_rop", + "arnold_rop", + "vray_rop"] + + def process(self, instance): + creator_attribute = instance.data["creator_attributes"] + product_type = instance.data["productType"] + rop_node = hou.node(instance.data.get("instance_node")) + + # Align split parameter value on rop node to the render target. + if creator_attribute.get("render_target") == "farm_split": + if product_type == "arnold_rop": + rop_node.setParms({"ar_ass_export_enable": 1}) + elif product_type == "mantra_rop": + rop_node.setParms({"soho_outputmode": 1}) + elif product_type == "redshift_rop": + rop_node.setParms({"RS_archive_enable": 1}) + elif product_type == "vray_rop": + rop_node.setParms({"render_export_mode": "2"}) + else: + if product_type == "arnold_rop": + rop_node.setParms({"ar_ass_export_enable": 0}) + elif product_type == "mantra_rop": + rop_node.setParms({"soho_outputmode": 0}) + elif product_type == "redshift_rop": + rop_node.setParms({"RS_archive_enable": 0}) + elif product_type == "vray_rop": + rop_node.setParms({"render_export_mode": "1"}) + + if instance.data.get("farm"): + self.log.debug("Render should be processed on farm, skipping local render.") + return + + if creator_attribute.get("render_target") == "local": + ropnode = hou.node(instance.data.get("instance_node")) + render_rop(ropnode) + + # Check missing frames. + # Frames won't exist if user cancels the render. + expected_files = next(iter(instance.data["expectedFiles"]), {}) + # TODO: enhance the readability. + expected_files = sum(expected_files.values(), []) + missing_frames = [ + frame + for frame in expected_files + if not os.path.exists(frame) + ] + if missing_frames: + # TODO: Use user friendly error reporting. + raise RuntimeError("Failed to complete render extraction. " + "Missing output files: {}".format( + missing_frames)) From ca3f3910232fc4077574c8272b222c9014ecd2fe Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 16 Apr 2024 17:55:59 +0200 Subject: [PATCH 050/269] add review support on farm render --- .../plugins/create/create_arnold_rop.py | 6 ++++- .../plugins/create/create_karma_rop.py | 4 ++++ .../plugins/create/create_mantra_rop.py | 4 ++++ .../plugins/create/create_redshift_rop.py | 6 ++++- .../houdini/plugins/create/create_vray_rop.py | 4 ++++ .../plugins/publish/collect_arnold_rop.py | 11 ++++++++++ .../plugins/publish/collect_karma_rop.py | 6 +++++ .../plugins/publish/collect_mantra_rop.py | 10 +++++++++ .../plugins/publish/collect_redshift_rop.py | 11 ++++++++++ .../publish/collect_reviewable_instances.py | 22 +++++++++++++++++++ .../plugins/publish/collect_vray_rop.py | 10 +++++++++ 11 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 client/ayon_core/hosts/houdini/plugins/publish/collect_reviewable_instances.py diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 0f2fc89764..d3254a28dd 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -1,5 +1,5 @@ from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import EnumDef +from ayon_core.lib import EnumDef, BoolDef class CreateArnoldRop(plugin.HoudiniCreator): @@ -81,6 +81,10 @@ class CreateArnoldRop(plugin.HoudiniCreator): } return [ + BoolDef("review", + label="Review", + tooltip="Mark as reviewable", + default=True), EnumDef("render_target", items=render_target_items, label="Render target", diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index c795512469..0af2fe8aeb 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -103,6 +103,10 @@ class CreateKarmaROP(plugin.HoudiniCreator): } return [ + BoolDef("review", + label="Review", + tooltip="Mark as reviewable", + default=True), EnumDef("render_target", items=render_target_items, label="Render target", diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index d0fc79f608..eac7f06b90 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -92,6 +92,10 @@ class CreateMantraROP(plugin.HoudiniCreator): } return [ + BoolDef("review", + label="Review", + tooltip="Mark as reviewable", + default=True), EnumDef("render_target", items=render_target_items, label="Render target", diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index 0094269f47..2a87d2b35c 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -4,7 +4,7 @@ import hou # noqa from ayon_core.pipeline import CreatorError from ayon_core.hosts.houdini.api import plugin -from ayon_core.lib import EnumDef +from ayon_core.lib import EnumDef, BoolDef class CreateRedshiftROP(plugin.HoudiniCreator): @@ -136,6 +136,10 @@ class CreateRedshiftROP(plugin.HoudiniCreator): } return [ + BoolDef("review", + label="Review", + tooltip="Mark as reviewable", + default=True), EnumDef("render_target", items=render_target_items, label="Render target", diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 8788af4748..cdaee7db06 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -158,6 +158,10 @@ class CreateVrayROP(plugin.HoudiniCreator): } return [ + BoolDef("review", + label="Review", + tooltip="Mark as reviewable", + default=True), EnumDef("render_target", items=render_target_items, label="Render target", diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py index c373d94653..fa9a1eea0f 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -66,6 +66,9 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): "": self.generate_expected_files(instance, beauty_product) } + # Assume it's a multipartExr Render. + multipartExr = True + num_aovs = rop.evalParm("ar_aovs") for index in range(1, num_aovs + 1): # Skip disabled AOVs @@ -83,6 +86,14 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): files_by_aov[label] = self.generate_expected_files(instance, aov_product) + # Set to False as soon as we have a separated aov. + multipartExr = False + + # Review Logic expects this key to exist and be True + # if render is a multipart Exr. + # As long as we have one AOV then multipartExr should be True. + instance.data["multipartExr"] = multipartExr + for product in render_products: self.log.debug("Found render product: {}".format(product)) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_karma_rop.py index 78651b0c69..662ed7ae30 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_karma_rop.py @@ -55,6 +55,12 @@ class CollectKarmaROPRenderProducts(pyblish.api.InstancePlugin): beauty_product) } + # Review Logic expects this key to exist and be True + # if render is a multipart Exr. + # As long as we have one AOV then multipartExr should be True. + # By default karma render is a multipart Exr. + instance.data["multipartExr"] = True + filenames = list(render_products) instance.data["files"] = filenames instance.data["renderProducts"] = colorspace.ARenderProduct() diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py index 9894e2beda..e85751c08a 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -72,6 +72,8 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): beauty_product) } + # Assume it's a multipartExr Render. + multipartExr = True aov_numbers = rop.evalParm("vm_numaux") if aov_numbers > 0: # get the filenames of the AOVs @@ -83,6 +85,9 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): aov_enabled = rop.evalParm(aov_boolean) has_aov_path = rop.evalParm(aov_name) if has_aov_path and aov_enabled == 1: + # Set to False as soon as we have a separated aov. + multipartExr = False + aov_prefix = evalParmNoFrame(rop, aov_name) aov_product = self.get_render_product_name( prefix=aov_prefix, suffix=None @@ -91,6 +96,11 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): files_by_aov[var] = self.generate_expected_files(instance, aov_product) # noqa + # Review Logic expects this key to exist and be True + # if render is a multipart Exr. + # As long as we have one AOV then multipartExr should be True. + instance.data["multipartExr"] = multipartExr + for product in render_products: self.log.debug("Found render product: %s" % product) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py index bd01f929c3..aff9269fa5 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -80,6 +80,9 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): "RS_aovMultipart": True }) + # Assume it's a multipartExr Render. + multipartExr = True + # Default beauty/main layer AOV beauty_product = self.get_render_product_name( prefix=default_prefix, suffix=beauty_suffix @@ -119,6 +122,14 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): files_by_aov[aov_suffix] = self.generate_expected_files(instance, aov_product) # noqa + # Set to False as soon as we have a separated aov. + multipartExr = False + + # Review Logic expects this key to exist and be True + # if render is a multipart Exr. + # As long as we have one AOV then multipartExr should be True. + instance.data["multipartExr"] = multipartExr + for product in render_products: self.log.debug("Found render product: %s" % product) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_reviewable_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_reviewable_instances.py new file mode 100644 index 0000000000..78dc5fe11a --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_reviewable_instances.py @@ -0,0 +1,22 @@ +import pyblish.api + + +class CollectReviewableInstances(pyblish.api.InstancePlugin): + """Collect Reviewable Instances. + + Basically, all instances of the specified families + with creator_attribure["review"] + """ + + order = pyblish.api.CollectorOrder + label = "Collect Reviewable Instances" + families = ["mantra_rop", + "karma_rop", + "redshift_rop", + "arnold_rop", + "vray_rop"] + + def process(self, instance): + creator_attribute = instance.data["creator_attributes"] + + instance.data["review"] = creator_attribute.get("review", False) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py index 63e16d541d..2eb5e3164a 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -68,6 +68,9 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): "": self.generate_expected_files(instance, beauty_product)} + # Assume it's a multipartExr Render. + multipartExr = True + if instance.data.get("RenderElement", True): render_element = self.get_render_element_name(rop, default_prefix) if render_element: @@ -76,6 +79,13 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): files_by_aov[aov] = self.generate_expected_files( instance, renderpass) + # Set to False as soon as we have a separated aov. + multipartExr = False + + # Review Logic expects this key to exist and be True + # if render is a multipart Exr. + # As long as we have one AOV then multipartExr should be True. + instance.data["multipartExr"] = multipartExr for product in render_products: self.log.debug("Found render product: %s" % product) From 1ddf28c752f03752c22066a4714e752bcb5379c7 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 16 Apr 2024 18:18:52 +0200 Subject: [PATCH 051/269] add missing key --- .../hosts/houdini/plugins/publish/collect_farm_instances.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py index c5a982996b..586aa2da57 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_farm_instances.py @@ -24,6 +24,7 @@ class CollectFarmInstances(pyblish.api.InstancePlugin): "farm_split", "farm" }: instance.data["farm"] = False + instance.data["splitRender"] = False self.log.debug("Render on farm is disabled. " "Skipping farm collecting.") return From 205fc0ed21f6a2623d2cc38fc82b7dc1c7a3a216 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 16 Apr 2024 18:19:19 +0200 Subject: [PATCH 052/269] add review support on local render --- .../publish/collect_local_render_instances.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index ea1eeb62af..5918366f06 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -63,8 +63,18 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): if len(aov_filenames) == 1: aov_filenames = aov_filenames[0] - # TODO: Add some option to allow users to mark - # aov_instances as reviewable. + preview = False + if instance.data.get("multipartExr", False): + self.log.debug( + "Adding preview tag because its multipartExr" + ) + preview = True + else: + # TODO: set Preview to True if aov_name matched some regex. + # Also, I'm not sure where that regex is defined. + pass + + preview = preview and instance.data.get("review", False) aov_instance.data.update({ # 'label': label, "task": instance.data["task"], @@ -75,14 +85,14 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): "family": product_type, "productName": product_name, "productGroup": product_group, - "families": ["render.local.hou"], + "families": ["render.local.hou", "review"], "instance_node": instance.data["instance_node"], "representations": [ { "stagingDir": staging_dir, "ext": ext, "name": ext, - "tags": [], + "tags": ["review"] if preview else [], "files": aov_filenames, "frameStart": instance.data["frameStartHandle"], "frameEnd": instance.data["frameEndHandle"] From d7d91b62a9d91e72dde457ed0503692e37fb0445 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 17 Apr 2024 15:18:00 +0200 Subject: [PATCH 053/269] add settings for CollectLocalRenderInstances --- .../houdini/server/settings/publish.py | 36 ++++++++++++++++++- server_addon/houdini/server/version.py | 2 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 8e0e7f7795..0912ecd997 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -1,4 +1,7 @@ -from ayon_server.settings import BaseSettingsModel, SettingsField +from ayon_server.settings import ( + BaseSettingsModel, + SettingsField +) # Publish Plugins @@ -20,6 +23,25 @@ class CollectChunkSizeModel(BaseSettingsModel): title="Frames Per Task") +class AOVFilterSubmodel(BaseSettingsModel): + value: list[str] = SettingsField( + default_factory=list, + title="AOV regex" + ) + +class CollectLocalRenderInstancesModel(BaseSettingsModel): + + override_deadline_aov_filter: bool = SettingsField( + False, + title="Override Deadline AOV Filter" + ) + + aov_filter: AOVFilterSubmodel = SettingsField( + default_factory=AOVFilterSubmodel, + title="Reviewable products filter" + ) + + class ValidateWorkfilePathsModel(BaseSettingsModel): enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") @@ -49,6 +71,10 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=CollectChunkSizeModel, title="Collect Chunk Size." ) + CollectLocalRenderInstances: CollectLocalRenderInstancesModel = SettingsField( + default_factory=CollectLocalRenderInstancesModel, + title="Collect Local Render Instances." + ) ValidateContainers: BasicValidateModel = SettingsField( default_factory=BasicValidateModel, title="Validate Latest Containers.", @@ -82,6 +108,14 @@ DEFAULT_HOUDINI_PUBLISH_SETTINGS = { "optional": True, "chunk_size": 999999 }, + "CollectLocalRenderInstances": { + "override_deadline_aov_filter": False, + "aov_filter" : { + "value": [ + ".*([Bb]eauty).*" + ] + } + }, "ValidateContainers": { "enabled": True, "optional": True, diff --git a/server_addon/houdini/server/version.py b/server_addon/houdini/server/version.py index b5c9b6cb71..11ef092868 100644 --- a/server_addon/houdini/server/version.py +++ b/server_addon/houdini/server/version.py @@ -1 +1 @@ -__version__ = "0.2.12" +__version__ = "0.2.13" From 885cfcb203d9874b5ec267c0d8bdd7b228194266 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 17 Apr 2024 16:24:20 +0200 Subject: [PATCH 054/269] apply aov_filter in Houdini local render --- .../publish/collect_local_render_instances.py | 57 ++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 5918366f06..073053188c 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -1,6 +1,11 @@ import os import pyblish.api from ayon_core.pipeline.create import get_product_name +from ayon_core.pipeline.farm.patterning import match_aov_pattern +from ayon_core.pipeline.publish import ( + get_plugin_settings, + apply_plugin_settings_automatically +) class CollectLocalRenderInstances(pyblish.api.InstancePlugin): @@ -20,6 +25,32 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): hosts = ["houdini"] label = "Collect local render instances" + override_deadline_aov_filter = False + aov_filter = {} + + @classmethod + def apply_settings(cls, project_settings): + # Preserve automatic settings applying logic + settings = get_plugin_settings(plugin=cls, + project_settings=project_settings, + log=cls.log, + category="houdini") + apply_plugin_settings_automatically(cls, settings, logger=cls.log) + + if not cls.override_deadline_aov_filter: + # get aov_filter from collector settings + # and restructure it as match_aov_pattern requires. + cls.aov_filter = { + "houdini": cls.aov_filter["value"] + } + else: + # get aov_filter from deadline settings + cls.aov_filter = project_settings["deadline"]["publish"]["ProcessSubmittedJobOnFarm"]["aov_filter"] + cls.aov_filter = { + item["name"]: item["value"] + for item in cls.aov_filter + } + def process(self, instance): if instance.data["farm"]: @@ -29,7 +60,6 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): # Create Instance for each AOV. context = instance.context - self.log.debug(instance.data["expectedFiles"]) expectedFiles = next(iter(instance.data["expectedFiles"]), {}) product_type = "render" # is always render @@ -56,6 +86,19 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): staging_dir = os.path.dirname(aov_filepaths[0]) ext = aov_filepaths[0].split(".")[-1] + # Decide if instance is reviewable + preview = False + if instance.data.get("multipartExr", False): + # Add preview tag because its multipartExr. + preview = True + else: + # Add Preview tag if the AOV matches the filter. + preview = match_aov_pattern( + "houdini", self.aov_filter, aov_filenames[0] + ) + + preview = preview and instance.data.get("review", False) + # Support Single frame. # The integrator wants single files to be a single # filename instead of a list. @@ -63,18 +106,6 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): if len(aov_filenames) == 1: aov_filenames = aov_filenames[0] - preview = False - if instance.data.get("multipartExr", False): - self.log.debug( - "Adding preview tag because its multipartExr" - ) - preview = True - else: - # TODO: set Preview to True if aov_name matched some regex. - # Also, I'm not sure where that regex is defined. - pass - - preview = preview and instance.data.get("review", False) aov_instance.data.update({ # 'label': label, "task": instance.data["task"], From d094f83efbb7e2f2d4c158dafc3ba6cee93a914e Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 18 Apr 2024 17:22:39 +0800 Subject: [PATCH 055/269] make sure the bake animation is boolean option --- client/ayon_core/hosts/maya/api/fbx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/maya/api/fbx.py b/client/ayon_core/hosts/maya/api/fbx.py index 939da4011b..3f1395cb40 100644 --- a/client/ayon_core/hosts/maya/api/fbx.py +++ b/client/ayon_core/hosts/maya/api/fbx.py @@ -47,7 +47,7 @@ class FBXExtractor: "smoothMesh": bool, "instances": bool, # "referencedContainersContent": bool, # deprecated in Maya 2016+ - "bakeComplexAnimation": int, + "bakeComplexAnimation": bool, "bakeComplexStart": int, "bakeComplexEnd": int, "bakeComplexStep": int, From 60468e4d7410ff5021d771a09b1e2e16494e6380 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 19 Apr 2024 16:09:18 +0200 Subject: [PATCH 056/269] enhance the readability of checking missing frames in expectedFiles --- .../houdini/plugins/publish/extract_render.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py index 7ea276a94d..8a666541cb 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py @@ -50,14 +50,21 @@ class ExtractRender(publish.Extractor): ropnode = hou.node(instance.data.get("instance_node")) render_rop(ropnode) + # `ExpectedFiles` is a list that includes one dict. + expected_files = instance.data["expectedFiles"][0] + # Each key in that dict is a list of files. + # Combine lists of files into one big list. + all_frames = [] + for value in expected_files.values(): + if isinstance(value, str): + all_frames.append(value) + elif isinstance(value, list): + all_frames.extend(value) # Check missing frames. # Frames won't exist if user cancels the render. - expected_files = next(iter(instance.data["expectedFiles"]), {}) - # TODO: enhance the readability. - expected_files = sum(expected_files.values(), []) missing_frames = [ frame - for frame in expected_files + for frame in all_frames if not os.path.exists(frame) ] if missing_frames: From 13fbc5b74f3bc83157bd927ab6d5ff0cd69b9c5f Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:13:37 +0200 Subject: [PATCH 057/269] added folder type to template data --- client/ayon_core/pipeline/template_data.py | 5 ++-- .../publish/collect_anatomy_instance_data.py | 28 +++++++------------ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/client/ayon_core/pipeline/template_data.py b/client/ayon_core/pipeline/template_data.py index 526c7d35c5..02bccb5f49 100644 --- a/client/ayon_core/pipeline/template_data.py +++ b/client/ayon_core/pipeline/template_data.py @@ -73,8 +73,8 @@ def get_folder_template_data(folder_entity, project_name): - 'parent' - direct parent name, project name used if is under project - Required document fields: - Folder: 'path' -> Plan to require: 'folderType' + Required entity fields: + Folder: 'path', 'folderType' Args: folder_entity (Dict[str, Any]): Folder entity. @@ -101,6 +101,7 @@ def get_folder_template_data(folder_entity, project_name): return { "folder": { "name": folder_name, + "type": folder_entity["folderType"], }, "asset": folder_name, "hierarchy": hierarchy, diff --git a/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py b/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py index f8cc81e718..f0119ef42e 100644 --- a/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py +++ b/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py @@ -33,6 +33,7 @@ import collections import pyblish.api import ayon_api +from ayon_core.pipeline.template_data import get_folder_template_data from ayon_core.pipeline.version_start import get_versioning_start @@ -383,24 +384,11 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin): # - 'folder', 'hierarchy', 'parent', 'folder' folder_entity = instance.data.get("folderEntity") if folder_entity: - folder_name = folder_entity["name"] - folder_path = folder_entity["path"] - hierarchy_parts = folder_path.split("/") - hierarchy_parts.pop(0) - hierarchy_parts.pop(-1) - parent_name = project_entity["name"] - if hierarchy_parts: - parent_name = hierarchy_parts[-1] - - hierarchy = "/".join(hierarchy_parts) - anatomy_data.update({ - "asset": folder_name, - "hierarchy": hierarchy, - "parent": parent_name, - "folder": { - "name": folder_name, - }, - }) + folder_data = get_folder_template_data( + folder_entity, + project_entity["name"] + ) + anatomy_data.update(folder_data) return if instance.data.get("newAssetPublishing"): @@ -418,6 +406,10 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin): "parent": parent_name, "folder": { "name": folder_name, + # TODO get folder type from hierarchy + # Using 'Shot' is current default behavior of editorial + # (or 'newAssetPublishing') publishing. + "type": "Shot", }, }) From 6e548a83c9d40be1012201160bb794eec50da6d5 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 23 Apr 2024 21:21:30 +0200 Subject: [PATCH 058/269] expose 'render_target' and 'review' creator attributes in publish tab only --- .../plugins/create/create_arnold_rop.py | 28 ++++++++----- .../plugins/create/create_karma_rop.py | 35 +++++++++++------ .../plugins/create/create_mantra_rop.py | 32 ++++++++++----- .../plugins/create/create_redshift_rop.py | 39 ++++++++++++------- .../houdini/plugins/create/create_vray_rop.py | 35 +++++++++++------ 5 files changed, 115 insertions(+), 54 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index d3254a28dd..1208cfc1ea 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -21,7 +21,9 @@ class CreateArnoldRop(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes.update(pre_create_data) + for key in ["render_target", "review"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] # Remove the active, we are checking the bypass flag of the nodes instance_data.pop("active", None) @@ -69,10 +71,12 @@ class CreateArnoldRop(plugin.HoudiniCreator): self.lock_parameters(instance_node, to_lock) def get_instance_attr_defs(self): - image_format_enum = [ - "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", - "rad", "rat", "rta", "sgi", "tga", "tif", - ] + """get instance attribute definitions. + + Attributes defined in this method are exposed in + publish tab in the publisher UI. + """ + render_target_items = { "local": "Local machine rendering", "local_no_render": "Use existing frames (local)", @@ -89,12 +93,18 @@ class CreateArnoldRop(plugin.HoudiniCreator): items=render_target_items, label="Render target", default=self.render_target), + ] + + def get_pre_create_attr_defs(self): + image_format_enum = [ + "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", + "rad", "rat", "rta", "sgi", "tga", "tif", + ] + + attrs = [ EnumDef("image_format", image_format_enum, default=self.ext, label="Image Format Options"), ] - - def get_pre_create_attr_defs(self): - - return self.get_instance_attr_defs() + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index 0af2fe8aeb..48cf5057ab 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -19,7 +19,10 @@ class CreateKarmaROP(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes.update(pre_create_data) + + for key in ["render_target", "review"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] instance_data.pop("active", None) instance_data.update({"node_type": "karma"}) @@ -92,10 +95,12 @@ class CreateKarmaROP(plugin.HoudiniCreator): self.lock_parameters(instance_node, to_lock) def get_instance_attr_defs(self): - image_format_enum = [ - "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", - "rad", "rat", "rta", "sgi", "tga", "tif", - ] + """get instance attribute definitions. + + Attributes defined in this method are exposed in + publish tab in the publisher UI. + """ + render_target_items = { "local": "Local machine rendering", "local_no_render": "Use existing frames (local)", @@ -110,7 +115,19 @@ class CreateKarmaROP(plugin.HoudiniCreator): EnumDef("render_target", items=render_target_items, label="Render target", - default=self.render_target), + default=self.render_target) + ] + + + def get_pre_create_attr_defs(self): + image_format_enum = [ + "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", + "rad", "rat", "rta", "sgi", "tga", "tif", + ] + + attrs = super(CreateKarmaROP, self).get_pre_create_attr_defs() + + attrs += [ EnumDef("image_format", image_format_enum, default="exr", @@ -127,8 +144,4 @@ class CreateKarmaROP(plugin.HoudiniCreator): label="Camera Resolution", default=False), ] - - - def get_pre_create_attr_defs(self): - - return self.get_instance_attr_defs() + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index eac7f06b90..05b4431aba 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -19,7 +19,9 @@ class CreateMantraROP(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes.update(pre_create_data) + for key in ["render_target", "review"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] instance_data.pop("active", None) instance_data.update({"node_type": "ifd"}) @@ -80,10 +82,12 @@ class CreateMantraROP(plugin.HoudiniCreator): self.lock_parameters(instance_node, to_lock) def get_instance_attr_defs(self): - image_format_enum = [ - "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", - "rad", "rat", "rta", "sgi", "tga", "tif", - ] + """get instance attribute definitions. + + Attributes defined in this method are exposed in + publish tab in the publisher UI. + """ + render_target_items = { "local": "Local machine rendering", "local_no_render": "Use existing frames (local)", @@ -99,7 +103,18 @@ class CreateMantraROP(plugin.HoudiniCreator): EnumDef("render_target", items=render_target_items, label="Render target", - default=self.render_target), + default=self.render_target) + ] + + def get_pre_create_attr_defs(self): + image_format_enum = [ + "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", + "rad", "rat", "rta", "sgi", "tga", "tif", + ] + + attrs = super(CreateMantraROP, self).get_pre_create_attr_defs() + + attrs += [ EnumDef("image_format", image_format_enum, default="exr", @@ -110,7 +125,4 @@ class CreateMantraROP(plugin.HoudiniCreator): "resolution, recommended for IPR.", default=False), ] - - def get_pre_create_attr_defs(self): - - return self.get_instance_attr_defs() + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index 2a87d2b35c..3ecb09ee9b 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -24,7 +24,9 @@ class CreateRedshiftROP(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes.update(pre_create_data) + for key in ["render_target", "review"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] instance_data.pop("active", None) instance_data.update({"node_type": "Redshift_ROP"}) @@ -121,13 +123,12 @@ class CreateRedshiftROP(plugin.HoudiniCreator): return super(CreateRedshiftROP, self).remove_instances(instances) def get_instance_attr_defs(self): - image_format_enum = [ - "exr", "tif", "jpg", "png", - ] - multi_layered_mode = [ - "No Multi-Layered EXR File", - "Full Multi-Layered EXR File" - ] + """get instance attribute definitions. + + Attributes defined in this method are exposed in + publish tab in the publisher UI. + """ + render_target_items = { "local": "Local machine rendering", "local_no_render": "Use existing frames (local)", @@ -143,7 +144,22 @@ class CreateRedshiftROP(plugin.HoudiniCreator): EnumDef("render_target", items=render_target_items, label="Render target", - default=self.render_target), + default=self.render_target) + ] + + def get_pre_create_attr_defs(self): + + image_format_enum = [ + "exr", "tif", "jpg", "png", + ] + + multi_layered_mode = [ + "No Multi-Layered EXR File", + "Full Multi-Layered EXR File" + ] + + attrs = super(CreateRedshiftROP, self).get_pre_create_attr_defs() + attrs += [ EnumDef("image_format", image_format_enum, default=self.ext, @@ -153,7 +169,4 @@ class CreateRedshiftROP(plugin.HoudiniCreator): default=self.multi_layered_mode, label="Multi-Layered EXR"), ] - - def get_pre_create_attr_defs(self): - - return self.get_instance_attr_defs() + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index cdaee7db06..9e4633e745 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -23,7 +23,9 @@ class CreateVrayROP(plugin.HoudiniCreator): # Transfer settings from pre create to instance creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes.update(pre_create_data) + for key in ["render_target", "review"]: + if key in pre_create_data: + creator_attributes[key] = pre_create_data[key] instance_data.pop("active", None) instance_data.update({"node_type": "vray_renderer"}) @@ -146,10 +148,13 @@ class CreateVrayROP(plugin.HoudiniCreator): return super(CreateVrayROP, self).remove_instances(instances) def get_instance_attr_defs(self): - image_format_enum = [ - "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", - "rad", "rat", "rta", "sgi", "tga", "tif", - ] + """get instance attribute definitions. + + Attributes defined in this method are exposed in + publish tab in the publisher UI. + """ + + render_target_items = { "local": "Local machine rendering", "local_no_render": "Use existing frames (local)", @@ -165,7 +170,18 @@ class CreateVrayROP(plugin.HoudiniCreator): EnumDef("render_target", items=render_target_items, label="Render target", - default=self.render_target), + default=self.render_target) + ] + + def get_pre_create_attr_defs(self): + image_format_enum = [ + "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", + "rad", "rat", "rta", "sgi", "tga", "tif", + ] + + attrs = super(CreateVrayROP, self).get_pre_create_attr_defs() + + attrs += [ EnumDef("image_format", image_format_enum, default=self.ext, @@ -179,9 +195,6 @@ class CreateVrayROP(plugin.HoudiniCreator): label="Render Element", tooltip="Create Render Element Node " "if enabled", - default=False), + default=False) ] - - def get_pre_create_attr_defs(self): - - return self.get_instance_attr_defs() + return attrs + self.get_instance_attr_defs() From 74fe21a2b3b6db779390966c3041fe6aef0b6bfa Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 23 Apr 2024 21:30:38 +0200 Subject: [PATCH 059/269] revert changes - add only 'multipartExr' flag --- .../plugins/publish/collect_arnold_rop.py | 6 +++- .../plugins/publish/collect_mantra_rop.py | 13 +++++--- .../plugins/publish/collect_redshift_rop.py | 30 +++++-------------- .../plugins/publish/collect_vray_rop.py | 5 ++-- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py index fa9a1eea0f..3a65b8d026 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -41,9 +41,11 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): render_products = [] # Store whether we are splitting the render job (export + render) + split_render = bool(rop.parm("ar_ass_export_enable").eval()) + instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if instance.data["splitRender"]: + if split_render: export_prefix = evalParmNoFrame( rop, "ar_ass_file", pad_character="0" ) @@ -70,6 +72,8 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): multipartExr = True num_aovs = rop.evalParm("ar_aovs") + # TODO: Check the following logic. + # as it always assumes that all AOV are not merged. for index in range(1, num_aovs + 1): # Skip disabled AOVs if not rop.evalParm("ar_enable_aov{}".format(index)): diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py index e85751c08a..6112f0a581 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -45,9 +45,11 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): render_products = [] # Store whether we are splitting the render job (export + render) + split_render = bool(rop.parm("soho_outputmode").eval()) + instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if instance.data["splitRender"]: + if split_render: export_prefix = evalParmNoFrame( rop, "soho_diskfile", pad_character="0" ) @@ -74,6 +76,9 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): # Assume it's a multipartExr Render. multipartExr = True + + # TODO: This logic doesn't take into considerations + # cryptomatte defined in 'Images > Cryptomatte' aov_numbers = rop.evalParm("vm_numaux") if aov_numbers > 0: # get the filenames of the AOVs @@ -85,9 +90,6 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): aov_enabled = rop.evalParm(aov_boolean) has_aov_path = rop.evalParm(aov_name) if has_aov_path and aov_enabled == 1: - # Set to False as soon as we have a separated aov. - multipartExr = False - aov_prefix = evalParmNoFrame(rop, aov_name) aov_product = self.get_render_product_name( prefix=aov_prefix, suffix=None @@ -96,6 +98,9 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): files_by_aov[var] = self.generate_expected_files(instance, aov_product) # noqa + # Set to False as soon as we have a separated aov. + multipartExr = False + # Review Logic expects this key to exist and be True # if render is a multipart Exr. # As long as we have one AOV then multipartExr should be True. diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py index aff9269fa5..89868b1c33 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -43,8 +43,10 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): default_prefix = evalParmNoFrame(rop, "RS_outputFileNamePrefix") beauty_suffix = rop.evalParm("RS_outputBeautyAOVSuffix") # Store whether we are splitting the render job (export + render) + split_render = bool(rop.parm("RS_archive_enable").eval()) + instance.data["splitRender"] = split_render export_products = [] - if instance.data["splitRender"]: + if split_render: export_prefix = evalParmNoFrame( rop, "RS_archive_file", pad_character="0" ) @@ -58,27 +60,11 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): instance.data["ifdFile"] = beauty_export_product instance.data["exportFiles"] = list(export_products) - # Set MultiLayer Mode. - creator_attribute = instance.data["creator_attributes"] - ext = creator_attribute.get("image_format") - multi_layered_mode = creator_attribute.get("multi_layered_mode") - full_exr_mode = False - if ext == "exr": - if multi_layered_mode == "No Multi-Layered EXR File": - rop.setParms({ - "RS_outputMultilayerMode": "1", - "RS_aovMultipart": False - }) - full_exr_mode = True - # Ignore beauty suffix if full mode is enabled - # As this is what the rop does. - beauty_suffix = "" - - elif multi_layered_mode == "Full Multi-Layered EXR File": - rop.setParms({ - "RS_outputMultilayerMode": "2", - "RS_aovMultipart": True - }) + full_exr_mode = (rop.evalParm("RS_outputMultilayerMode") == "2") + if full_exr_mode: + # Ignore beauty suffix if full mode is enabled + # As this is what the rop does. + beauty_suffix = "" # Assume it's a multipartExr Render. multipartExr = True diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py index 2eb5e3164a..13478a9d2b 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -46,9 +46,11 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): # TODO: add render elements if render element # Store whether we are splitting the render job in an export + render + split_render = rop.parm("render_export_mode").eval() == "2" + instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if instance.data["splitRender"]: + if split_render: export_prefix = evalParmNoFrame( rop, "render_export_filepath", pad_character="0" ) @@ -78,7 +80,6 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): render_products.append(renderpass) files_by_aov[aov] = self.generate_expected_files( instance, renderpass) - # Set to False as soon as we have a separated aov. multipartExr = False From effedd82c8ddb511d844dcdef8724c4c63c2355f Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 23 Apr 2024 21:30:58 +0200 Subject: [PATCH 060/269] fix bug with aov_filter --- .../plugins/publish/collect_local_render_instances.py | 9 +++++---- server_addon/houdini/server/settings/publish.py | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 073053188c..5a446fa0d3 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -25,8 +25,9 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): hosts = ["houdini"] label = "Collect local render instances" - override_deadline_aov_filter = False - aov_filter = {} + use_deadline_aov_filter = False + aov_filter = {"host_name": "houdini", + "value": [".*([Bb]eauty).*"]} @classmethod def apply_settings(cls, project_settings): @@ -37,11 +38,11 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): category="houdini") apply_plugin_settings_automatically(cls, settings, logger=cls.log) - if not cls.override_deadline_aov_filter: + if not cls.use_deadline_aov_filter: # get aov_filter from collector settings # and restructure it as match_aov_pattern requires. cls.aov_filter = { - "houdini": cls.aov_filter["value"] + cls.aov_filter["host_name"]: cls.aov_filter["value"] } else: # get aov_filter from deadline settings diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 0912ecd997..9e8e796aff 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -24,6 +24,8 @@ class CollectChunkSizeModel(BaseSettingsModel): class AOVFilterSubmodel(BaseSettingsModel): + """You should use the same host name you are using for Houdini.""" + host_name: str = SettingsField("", title="Houdini Host name") value: list[str] = SettingsField( default_factory=list, title="AOV regex" @@ -31,9 +33,9 @@ class AOVFilterSubmodel(BaseSettingsModel): class CollectLocalRenderInstancesModel(BaseSettingsModel): - override_deadline_aov_filter: bool = SettingsField( + use_deadline_aov_filter: bool = SettingsField( False, - title="Override Deadline AOV Filter" + title="Use Deadline AOV Filter" ) aov_filter: AOVFilterSubmodel = SettingsField( @@ -109,8 +111,9 @@ DEFAULT_HOUDINI_PUBLISH_SETTINGS = { "chunk_size": 999999 }, "CollectLocalRenderInstances": { - "override_deadline_aov_filter": False, + "use_deadline_aov_filter": False, "aov_filter" : { + "host_name": "houdini", "value": [ ".*([Bb]eauty).*" ] From 47b27ce009ee2c8c5b50e10ac3ee32c91f292a8e Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 23 Apr 2024 22:16:24 +0200 Subject: [PATCH 061/269] use 'creator_attributes' as the source of truth - use extract render to adjust parameters accordingly --- .../hosts/houdini/plugins/publish/collect_arnold_rop.py | 5 +---- .../hosts/houdini/plugins/publish/collect_mantra_rop.py | 5 +---- .../hosts/houdini/plugins/publish/collect_redshift_rop.py | 6 ++---- .../hosts/houdini/plugins/publish/collect_vray_rop.py | 5 +---- .../hosts/houdini/plugins/publish/extract_render.py | 2 +- 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py index 3a65b8d026..53a3e52717 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_arnold_rop.py @@ -40,12 +40,9 @@ class CollectArnoldROPRenderProducts(pyblish.api.InstancePlugin): default_prefix = evalParmNoFrame(rop, "ar_picture") render_products = [] - # Store whether we are splitting the render job (export + render) - split_render = bool(rop.parm("ar_ass_export_enable").eval()) - instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if split_render: + if instance.data["splitRender"]: export_prefix = evalParmNoFrame( rop, "ar_ass_file", pad_character="0" ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py index 6112f0a581..7b247768fc 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_mantra_rop.py @@ -44,12 +44,9 @@ class CollectMantraROPRenderProducts(pyblish.api.InstancePlugin): default_prefix = evalParmNoFrame(rop, "vm_picture") render_products = [] - # Store whether we are splitting the render job (export + render) - split_render = bool(rop.parm("soho_outputmode").eval()) - instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if split_render: + if instance.data["splitRender"]: export_prefix = evalParmNoFrame( rop, "soho_diskfile", pad_character="0" ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py index 89868b1c33..ce90ae2413 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_redshift_rop.py @@ -42,11 +42,9 @@ class CollectRedshiftROPRenderProducts(pyblish.api.InstancePlugin): default_prefix = evalParmNoFrame(rop, "RS_outputFileNamePrefix") beauty_suffix = rop.evalParm("RS_outputBeautyAOVSuffix") - # Store whether we are splitting the render job (export + render) - split_render = bool(rop.parm("RS_archive_enable").eval()) - instance.data["splitRender"] = split_render + export_products = [] - if split_render: + if instance.data["splitRender"]: export_prefix = evalParmNoFrame( rop, "RS_archive_file", pad_character="0" ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py index 13478a9d2b..c39b1db103 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_vray_rop.py @@ -45,12 +45,9 @@ class CollectVrayROPRenderProducts(pyblish.api.InstancePlugin): render_products = [] # TODO: add render elements if render element - # Store whether we are splitting the render job in an export + render - split_render = rop.parm("render_export_mode").eval() == "2" - instance.data["splitRender"] = split_render export_prefix = None export_products = [] - if split_render: + if instance.data["splitRender"]: export_prefix = evalParmNoFrame( rop, "render_export_filepath", pad_character="0" ) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py index 8a666541cb..7b4762a25f 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py @@ -23,7 +23,7 @@ class ExtractRender(publish.Extractor): rop_node = hou.node(instance.data.get("instance_node")) # Align split parameter value on rop node to the render target. - if creator_attribute.get("render_target") == "farm_split": + if instance.data["splitRender"]: if product_type == "arnold_rop": rop_node.setParms({"ar_ass_export_enable": 1}) elif product_type == "mantra_rop": From e04c9285f1a1dcc4eaa3560ad964b057d9dc3478 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 23 Apr 2024 22:32:04 +0200 Subject: [PATCH 062/269] add a TODO about running plugins over wrong isntances --- .../hosts/houdini/plugins/publish/extract_opengl.py | 6 ++++++ .../houdini/plugins/publish/validate_review_colorspace.py | 5 +++++ .../hosts/houdini/plugins/publish/validate_scene_review.py | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_opengl.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_opengl.py index 69bbb22340..d3b4b094b2 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_opengl.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_opengl.py @@ -17,6 +17,12 @@ class ExtractOpenGL(publish.Extractor): def process(self, instance): ropnode = hou.node(instance.data.get("instance_node")) + + # This plugin is triggered when marking render as reviewable. + # Therefore, this plugin will run on over wrong instances. + # TODO: Don't run this plugin on wrong instances. + # This plugin should run only on review product type + # with instance node of opengl type. if ropnode.type().name() != "opengl": self.log.debug("Skipping OpenGl extraction. Rop node {} " "is not an OpenGl node.".format(ropnode.path())) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_review_colorspace.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_review_colorspace.py index e02ce93f0d..691b54ac05 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_review_colorspace.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_review_colorspace.py @@ -35,6 +35,11 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin, rop_node = hou.node(instance.data["instance_node"]) + # This plugin is triggered when marking render as reviewable. + # Therefore, this plugin will run on over wrong instances. + # TODO: Don't run this plugin on wrong instances. + # This plugin should run only on review product type + # with instance node of opengl type. if rop_node.type().name() != "opengl": self.log.debug("Skipping Validation. Rop node {} " "is not an OpenGl node.".format(rop_node.path())) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_scene_review.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_scene_review.py index 9b81f0f8ed..0b09306b0d 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_scene_review.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_scene_review.py @@ -19,6 +19,12 @@ class ValidateSceneReview(pyblish.api.InstancePlugin): report = [] instance_node = hou.node(instance.data.get("instance_node")) + + # This plugin is triggered when marking render as reviewable. + # Therefore, this plugin will run on over wrong instances. + # TODO: Don't run this plugin on wrong instances. + # This plugin should run only on review product type + # with instance node of opengl type. if instance_node.type().name() != "opengl": self.log.debug("Skipping Validation. Rop node {} " "is not an OpenGl node.".format(instance_node.path())) From e194652f65d122f769c028e3df5aca539f186018 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 24 Apr 2024 10:59:16 +0200 Subject: [PATCH 063/269] add path to folder keys --- client/ayon_core/pipeline/template_data.py | 1 + .../ayon_core/plugins/publish/collect_anatomy_instance_data.py | 1 + 2 files changed, 2 insertions(+) diff --git a/client/ayon_core/pipeline/template_data.py b/client/ayon_core/pipeline/template_data.py index 02bccb5f49..d5f06d6a59 100644 --- a/client/ayon_core/pipeline/template_data.py +++ b/client/ayon_core/pipeline/template_data.py @@ -102,6 +102,7 @@ def get_folder_template_data(folder_entity, project_name): "folder": { "name": folder_name, "type": folder_entity["folderType"], + "path": path, }, "asset": folder_name, "hierarchy": hierarchy, diff --git a/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py b/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py index f0119ef42e..ad5a5d43fc 100644 --- a/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py +++ b/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py @@ -406,6 +406,7 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin): "parent": parent_name, "folder": { "name": folder_name, + "path": instance.data["folderPath"], # TODO get folder type from hierarchy # Using 'Shot' is current default behavior of editorial # (or 'newAssetPublishing') publishing. From 8110a601bbc0d114c1bcd22be8122cc591ef51a7 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 25 Apr 2024 11:02:31 +0200 Subject: [PATCH 064/269] add CollectLocalRenderInstances setting --- server_addon/houdini/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 4b72af2a89..4e441c76ae 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,3 +1,3 @@ name = "houdini" title = "Houdini" -version = "0.2.12" +version = "0.2.13" From 767bbf070fb1a389f217d9e8b37d3c07a5e85f5f Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 29 Apr 2024 10:39:16 +0300 Subject: [PATCH 065/269] add CollectLocalRenderInstances setting --- server_addon/houdini/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 4e441c76ae..6c81eba439 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,3 +1,3 @@ name = "houdini" title = "Houdini" -version = "0.2.13" +version = "0.2.14" From cf9707db85f637b3549a3b84ec30aca2ddeea400 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 30 Apr 2024 11:25:04 +0200 Subject: [PATCH 066/269] Refactor OCIO config settings and profiles Added new OCIO config profile types and paths for built-in and custom configurations. Updated default values accordingly. --- server/settings/main.py | 138 +++++++++++++++++++++++++++------------- 1 file changed, 95 insertions(+), 43 deletions(-) diff --git a/server/settings/main.py b/server/settings/main.py index 28a69e182d..85c1779999 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -54,9 +54,66 @@ class CoreImageIOFileRulesModel(BaseSettingsModel): return value -class CoreImageIOConfigModel(BaseSettingsModel): - filepath: list[str] = SettingsField( - default_factory=list, title="Config path" +_ocio_config_profile_types = [ + {"value": "buildin_path", "label": "Ayon built-in OCIO config"}, + {"value": "custom_path", "label": "Path to OCIO config"}, + {"value": "product", "label": "Published product"}, +] + + +def _ocio_build_in_paths(): + return [ + { + "value": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", + "label": "ACES 1.2", + "description": "Aces 1.2 OCIO config file." + }, + { + "value": "{BUILTIN_OCIO_ROOT}/nuke-default/config.ocio", + "label": "Nuke default", + }, + ] + + +class CoreImageIOConfigProfilesModel(BaseSettingsModel): + host_names: list[str] = SettingsField( + default_factory=list, + title="Host names" + ) + task_types: list[str] = SettingsField( + default_factory=list, + title="Task types", + enum_resolver=task_types_enum + ) + task_names: list[str] = SettingsField( + default_factory=list, + title="Task names" + ) + type: str = SettingsField( + title="Profile type", + enum_resolver=lambda: _ocio_config_profile_types, + conditionalEnum=True, + default="buildin_path", + section="---", + ) + + buildin_path: str = SettingsField( + "ACES 1.2", + title="Built-in OCIO config", + enum_resolver=_ocio_build_in_paths, + ) + custom_path: str = SettingsField( + "", + title="OCIO config path", + description="Path to OCIO config. Anatomy formatting is supported.", + ) + product: str = SettingsField( + "", + title="Product name", + description=( + "Published product name to get OCIO config from. " + "Partial match is supported." + ), ) @@ -65,9 +122,8 @@ class CoreImageIOBaseModel(BaseSettingsModel): False, title="Enable Color Management" ) - ocio_config: CoreImageIOConfigModel = SettingsField( - default_factory=CoreImageIOConfigModel, - title="OCIO config" + ocio_config_profiles: list[CoreImageIOConfigProfilesModel] = SettingsField( + default_factory=list, title="OCIO config profiles" ) file_rules: CoreImageIOFileRulesModel = SettingsField( default_factory=CoreImageIOFileRulesModel, @@ -186,12 +242,17 @@ class CoreSettings(BaseSettingsModel): DEFAULT_VALUES = { "imageio": { "activate_global_color_management": False, - "ocio_config": { - "filepath": [ - "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", - "{BUILTIN_OCIO_ROOT}/nuke-default/config.ocio" - ] - }, + "ocio_config_profiles": [ + { + "host_names": [], + "task_types": [], + "task_names": [], + "type": "buildin_path", + "buildin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", + "custom_path": "", + "product": "", + } + ], "file_rules": { "activate_global_file_rules": False, "rules": [ @@ -199,42 +260,33 @@ DEFAULT_VALUES = { "name": "example", "pattern": ".*(beauty).*", "colorspace": "ACES - ACEScg", - "ext": "exr" + "ext": "exr", } - ] - } + ], + }, }, "studio_name": "", "studio_code": "", - "environments": "{\n\"STUDIO_SW\": {\n \"darwin\": \"/mnt/REPO_SW\",\n \"linux\": \"/mnt/REPO_SW\",\n \"windows\": \"P:/REPO_SW\"\n }\n}", + "environments": '{\n"STUDIO_SW": {\n "darwin": "/mnt/REPO_SW",\n "linux": "/mnt/REPO_SW",\n "windows": "P:/REPO_SW"\n }\n}', "tools": DEFAULT_TOOLS_VALUES, - "version_start_category": { - "profiles": [] - }, + "version_start_category": {"profiles": []}, "publish": DEFAULT_PUBLISH_VALUES, - "project_folder_structure": json.dumps({ - "__project_root__": { - "prod": {}, - "resources": { - "footage": { - "plates": {}, - "offline": {} + "project_folder_structure": json.dumps( + { + "__project_root__": { + "prod": {}, + "resources": { + "footage": {"plates": {}, "offline": {}}, + "audio": {}, + "art_dept": {}, }, - "audio": {}, - "art_dept": {} - }, - "editorial": {}, - "assets": { - "characters": {}, - "locations": {} - }, - "shots": {} - } - }, indent=4), - "project_plugins": { - "windows": [], - "darwin": [], - "linux": [] - }, - "project_environments": "{}" + "editorial": {}, + "assets": {"characters": {}, "locations": {}}, + "shots": {}, + } + }, + indent=4, + ), + "project_plugins": {"windows": [], "darwin": [], "linux": []}, + "project_environments": "{}", } From 7b86da34ae86b0f866f610b0eb048511ddf1c743 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:59:04 +0200 Subject: [PATCH 067/269] fix buildin to builtin --- server/settings/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/settings/main.py b/server/settings/main.py index 85c1779999..8bbe13da30 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -55,13 +55,13 @@ class CoreImageIOFileRulesModel(BaseSettingsModel): _ocio_config_profile_types = [ - {"value": "buildin_path", "label": "Ayon built-in OCIO config"}, + {"value": "builtin_path", "label": "Ayon built-in OCIO config"}, {"value": "custom_path", "label": "Path to OCIO config"}, {"value": "product", "label": "Published product"}, ] -def _ocio_build_in_paths(): +def _ocio_built_in_paths(): return [ { "value": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", @@ -93,14 +93,14 @@ class CoreImageIOConfigProfilesModel(BaseSettingsModel): title="Profile type", enum_resolver=lambda: _ocio_config_profile_types, conditionalEnum=True, - default="buildin_path", + default="builtin_path", section="---", ) - buildin_path: str = SettingsField( + builtin_path: str = SettingsField( "ACES 1.2", title="Built-in OCIO config", - enum_resolver=_ocio_build_in_paths, + enum_resolver=_ocio_built_in_paths, ) custom_path: str = SettingsField( "", @@ -247,8 +247,8 @@ DEFAULT_VALUES = { "host_names": [], "task_types": [], "task_names": [], - "type": "buildin_path", - "buildin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", + "type": "builtin_path", + "builtin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", "custom_path": "", "product": "", } From 8c525987e58991d770208f93bedcc6ed1bcd3bde Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:59:16 +0200 Subject: [PATCH 068/269] change Ayon to AYON --- server/settings/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/settings/main.py b/server/settings/main.py index 8bbe13da30..d6a38a90e6 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -55,7 +55,7 @@ class CoreImageIOFileRulesModel(BaseSettingsModel): _ocio_config_profile_types = [ - {"value": "builtin_path", "label": "Ayon built-in OCIO config"}, + {"value": "builtin_path", "label": "AYON built-in OCIO config"}, {"value": "custom_path", "label": "Path to OCIO config"}, {"value": "product", "label": "Published product"}, ] From c0d9edad758559c15790c4cfd09f7c357ca84362 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:59:33 +0200 Subject: [PATCH 069/269] _ocio_config_profile_types is function --- server/settings/main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/settings/main.py b/server/settings/main.py index d6a38a90e6..230414ffe7 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -54,11 +54,12 @@ class CoreImageIOFileRulesModel(BaseSettingsModel): return value -_ocio_config_profile_types = [ - {"value": "builtin_path", "label": "AYON built-in OCIO config"}, - {"value": "custom_path", "label": "Path to OCIO config"}, - {"value": "product", "label": "Published product"}, -] +def _ocio_config_profile_types(): + return [ + {"value": "builtin_path", "label": "AYON built-in OCIO config"}, + {"value": "custom_path", "label": "Path to OCIO config"}, + {"value": "product", "label": "Published product"}, + ] def _ocio_built_in_paths(): @@ -91,7 +92,7 @@ class CoreImageIOConfigProfilesModel(BaseSettingsModel): ) type: str = SettingsField( title="Profile type", - enum_resolver=lambda: _ocio_config_profile_types, + enum_resolver=_ocio_config_profile_types, conditionalEnum=True, default="builtin_path", section="---", From feb73842c377c401f2acdd1dc18c6852b3b23de7 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:07:17 +0200 Subject: [PATCH 070/269] rename 'product' attribute to 'product_name' --- server/settings/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/settings/main.py b/server/settings/main.py index 230414ffe7..c9c86bdd0d 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -97,7 +97,6 @@ class CoreImageIOConfigProfilesModel(BaseSettingsModel): default="builtin_path", section="---", ) - builtin_path: str = SettingsField( "ACES 1.2", title="Built-in OCIO config", @@ -108,7 +107,7 @@ class CoreImageIOConfigProfilesModel(BaseSettingsModel): title="OCIO config path", description="Path to OCIO config. Anatomy formatting is supported.", ) - product: str = SettingsField( + product_name: str = SettingsField( "", title="Product name", description=( @@ -251,7 +250,7 @@ DEFAULT_VALUES = { "type": "builtin_path", "builtin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", "custom_path": "", - "product": "", + "product_name": "", } ], "file_rules": { From acacf15723e8cf99fcc3cbe194e49612b6dcb53d Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 30 Apr 2024 15:24:34 +0100 Subject: [PATCH 071/269] 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 3812f229240f7dc7eb4c71979973a355c831a0fa Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 2 May 2024 10:33:32 +0200 Subject: [PATCH 072/269] implemented 'get_imageio_config_preset' with new profiles handling --- client/ayon_core/pipeline/colorspace.py | 317 ++++++++++++++++++++---- 1 file changed, 272 insertions(+), 45 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index efa3bbf968..8dcbaeb877 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -8,14 +8,19 @@ import tempfile import warnings from copy import deepcopy +import ayon_api + from ayon_core import AYON_CORE_ROOT from ayon_core.settings import get_project_settings from ayon_core.lib import ( + filter_profiles, StringTemplate, run_ayon_launcher_process, - Logger + Logger, ) from ayon_core.pipeline import Anatomy +from ayon_core.pipeline.template_data import get_template_data +from ayon_core.pipeline.load import get_representation_path_with_anatomy from ayon_core.lib.transcoding import VIDEO_EXTENSIONS, IMAGE_EXTENSIONS @@ -758,6 +763,9 @@ def get_imageio_config( Config path is formatted in `path` key and original settings input is saved into `template` key. + Deprecated: + Deprecated since '0.3.1' . Use `get_imageio_config_preset` instead. + Args: project_name (str): project name host_name (str): host name @@ -768,88 +776,307 @@ def get_imageio_config( Returns: dict: config path data or empty dict - """ - project_settings = project_settings or get_project_settings(project_name) - anatomy = anatomy or Anatomy(project_name) + """ if not anatomy_data: from ayon_core.pipeline.context_tools import ( get_current_context_template_data) anatomy_data = get_current_context_template_data() - formatting_data = deepcopy(anatomy_data) + task_name = anatomy_data["task"]["name"] + folder_path = anatomy_data["folder"]["path"] + return get_imageio_config_preset( + project_name, + folder_path, + task_name, + host_name, + anatomy=anatomy, + project_settings=project_settings, + template_data=anatomy_data, + env=env, + ) - # Add project roots to anatomy data - formatting_data["root"] = anatomy.roots - formatting_data["platform"] = platform.system().lower() + +def _get_global_config_data( + project_name, + host_name, + anatomy, + template_data, + imageio_global, + folder_id, + log, +): + """Get global config data. + + Global config from core settings is using profiles that are based on + host name, task name and task type. The filtered profile can define 3 + types of config sources: + 1. AYON ocio addon configs. + 2. Custom path to ocio config. + 3. Path to 'ocioconfig' representation on product. Name of product can be + defined in settings. Product name can be regex but exact match is + always preferred. + + None is returned when no profile is found, when path + + Args: + project_name (str): Project name. + host_name (str): Host name. + anatomy (Anatomy): Project anatomy object. + template_data (dict[str, Any]): Template data. + imageio_global (dict[str, Any]): Core imagio settings. + folder_id (Union[dict[str, Any], None]): Folder id. + log (logging.Logger): Logger object. + + Returns: + Union[dict[str, str], None]: Config data with path and template + or None. + + """ + task_name = task_type = None + task_data = template_data.get("task") + if task_data: + task_name = task_data["name"] + task_type = task_data["type"] + + filter_values = { + "task_names": task_name, + "task_types": task_type, + "host_names": host_name, + } + profile = filter_profiles( + imageio_global["ocio_config_profiles"], filter_values + ) + if profile is None: + log.info(f"No config profile matched filters {str(filter_values)}") + return None + + profile_type = profile["type"] + if profile_type in ("builtin_path", "custom_path"): + template = profile[profile_type] + result = StringTemplate.format_strict_template( + template, template_data + ) + normalized_path = str(result.normalized()) + if not os.path.exists(normalized_path): + log.warning(f"Path was not found '{normalized_path}'.") + return None + + return { + "path": normalized_path, + "template": template + } + + # TODO decide if this is the right name for representation + repre_name = "ocioconfig" + + folder_info = template_data.get("folder") + if not folder_info: + log.warning("Folder info is missing.") + return None + folder_path = folder_info["path"] + + product_name = profile["product_name"] + if folder_id is None: + folder_entity = ayon_api.get_folder_by_path( + project_name, folder_path, fields={"id"} + ) + if not folder_entity: + log.warning(f"Folder entity '{folder_path}' was not found..") + return None + folder_id = folder_entity["id"] + + product_entities_by_name = { + product_entity["name"]: product_entity + for product_entity in ayon_api.get_products( + project_name, + folder_ids={folder_id}, + product_name_regex=product_name, + fields={"id", "name"} + ) + } + if not product_entities_by_name: + log.debug( + f"No product entities were found for folder '{folder_path}' with" + f" product name filter '{product_name}'." + ) + return None + + # Try to use exact match first, otherwise use first available product + product_entity = product_entities_by_name.get(product_name) + if product_entity is None: + product_entity = next(iter(product_entities_by_name.values())) + + product_name = product_entity["name"] + # Find last product version + version_entity = ayon_api.get_last_version_by_product_id( + project_name, + product_id=product_entity["id"], + fields={"id"} + ) + if not version_entity: + log.info( + f"Product '{product_name}' does not have available any versions." + ) + return None + + # Find 'ocioconfig' representation entity + repre_entity = ayon_api.get_representation_by_name( + project_name, + representation_name=repre_name, + version_id=version_entity["id"], + ) + if not repre_entity: + log.debug( + f"Representation '{repre_name}'" + f" not found on product '{product_name}'." + ) + return None + + path = get_representation_path_with_anatomy(repre_entity, anatomy) + template = repre_entity["attrib"]["template"] + return { + "path": path, + "template": template, + } + + +def get_imageio_config_preset( + project_name, + folder_path, + task_name, + host_name, + anatomy=None, + project_settings=None, + template_data=None, + env=None, + folder_id=None, +): + """Returns config data from settings + + Output contains 'path' key and 'template' key holds its template. + + Template data can be prepared with 'get_template_data'. + + Args: + project_name (str): Project name. + folder_path (str): Folder path. + task_name (str): Task name. + host_name (str): Host name. + anatomy (Optional[Anatomy]): Project anatomy object. + project_settings (Optional[dict]): Project settings. + template_data (Optional[dict]): Template data used for + template formatting. + env (Optional[dict]): Environment variables. Environments are used + for template formatting too. Values from 'os.environ' are used + when not provided. + folder_id (Optional[str]): Folder id. Is used only when config path + is received from published representation. Is autofilled when + not provided. + + Returns: + dict: config path data or empty dict + + """ + if not project_settings: + project_settings = get_project_settings(project_name) # Get colorspace settings imageio_global, imageio_host = _get_imageio_settings( - project_settings, host_name) + project_settings, host_name + ) + # Global color management must be enabled to be able to use host settings + if not imageio_global["activate_global_color_management"]: + log.info("Colorspace management is disabled globally.") + return {} # Host 'ocio_config' is optional host_ocio_config = imageio_host.get("ocio_config") or {} - - # Global color management must be enabled to be able to use host settings - activate_color_management = imageio_global.get( - "activate_global_color_management") - # TODO: remove this in future - backward compatibility - # For already saved overrides from previous version look for 'enabled' - # on host settings. - if activate_color_management is None: - activate_color_management = host_ocio_config.get("enabled", False) - - if not activate_color_management: - # if global settings are disabled return empty dict because - # it is expected that no colorspace management is needed - log.info("Colorspace management is disabled globally.") - return {} + # TODO remove + # - backward compatibility when host settings had only 'enabled' flag + # the flag was split into 'activate_global_color_management' + # and 'override_global_config' + host_ocio_config_enabled = host_ocio_config.get("enabled", False) # Check if host settings group is having 'activate_host_color_management' # - if it does not have activation key then default it to True so it uses # global settings - # This is for backward compatibility. - # TODO: in future rewrite this to be more explicit activate_host_color_management = imageio_host.get( - "activate_host_color_management") - - # TODO: remove this in future - backward compatibility + "activate_host_color_management" + ) if activate_host_color_management is None: - activate_host_color_management = host_ocio_config.get("enabled", False) + activate_host_color_management = host_ocio_config_enabled if not activate_host_color_management: # if host settings are disabled return False because # it is expected that no colorspace management is needed log.info( - "Colorspace management for host '{}' is disabled.".format( - host_name) + f"Colorspace management for host '{host_name}' is disabled." ) return {} - # get config path from either global or host settings - # depending on override flag + project_entity = None + if anatomy is None: + project_entity = ayon_api.get_project(project_name) + anatomy = Anatomy(project_name, project_entity) + + if env is None: + env = dict(os.environ.items()) + + if template_data: + template_data = deepcopy(template_data) + else: + if not project_entity: + project_entity = ayon_api.get_project(project_name) + + folder_entity = ayon_api.get_folder_by_path( + project_name, folder_path + ) + folder_id = folder_entity["id"] + task_entity = ayon_api.get_task_by_name( + project_name, folder_id, task_name + ) + template_data = get_template_data( + project_entity, + folder_entity, + task_entity, + host_name, + project_settings, + ) + + # Add project roots to anatomy data + template_data["root"] = anatomy.roots + template_data["platform"] = platform.system().lower() + + # Add environment variables to template data + template_data.update(env) + + # Get config path from core or host settings + # - based on override flag in host settings # TODO: in future rewrite this to be more explicit override_global_config = host_ocio_config.get("override_global_config") if override_global_config is None: - # for already saved overrides from previous version - # TODO: remove this in future - backward compatibility - override_global_config = host_ocio_config.get("enabled") + override_global_config = host_ocio_config_enabled - if override_global_config: - config_data = _get_config_data( - host_ocio_config["filepath"], formatting_data, env + if not override_global_config: + config_data = _get_global_config_data( + project_name, + host_name, + anatomy, + template_data, + imageio_global, + folder_id, + log, ) else: - # get config path from global - config_global = imageio_global["ocio_config"] config_data = _get_config_data( - config_global["filepath"], formatting_data, env + host_ocio_config["filepath"], template_data, env ) if not config_data: raise FileExistsError( - "No OCIO config found in settings. It is " - "either missing or there is typo in path inputs" + "No OCIO config found in settings. It is" + " either missing or there is typo in path inputs" ) return config_data From 71f2c074c55938672025f6ed7af450a32d3584b8 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 2 May 2024 10:58:51 +0200 Subject: [PATCH 073/269] implemented conversion of settings overrides --- server/__init__.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/server/__init__.py b/server/__init__.py index 152cc77218..f6f89f2049 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -1,3 +1,5 @@ +from typing import Any + from ayon_server.addons import BaseServerAddon from .settings import CoreSettings, DEFAULT_VALUES @@ -9,3 +11,46 @@ class CoreAddon(BaseServerAddon): async def get_default_settings(self): settings_model_cls = self.get_settings_model() return settings_model_cls(**DEFAULT_VALUES) + + async def convert_settings_overrides( + self, + source_version: str, + overrides: dict[str, Any], + ) -> dict[str, Any]: + self._convert_imagio_configs_0_3_1(overrides) + # Use super conversion + return await super().convert_settings_overrides( + source_version, overrides + ) + + def _convert_imagio_configs_0_3_1(self, overrides): + """Imageio config settings did change to profiles since 0.3.1. .""" + imageio_overrides = overrides.get("imageio") or {} + if "ocio_config" not in imageio_overrides: + return + + ocio_config = imageio_overrides.pop("ocio_config") + filepath = ocio_config["filepath"] + if not filepath: + return + first_filepath = filepath[0] + ocio_config_profiles = imageio_overrides.setdefault( + "ocio_config_profiles", [] + ) + base_value = { + "type": "builtin_path", + "product": "", + "host_names": [], + "task_names": [], + "task_types": [], + "custom_path": "", + "builtin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio" + } + if first_filepath not in ( + "{BUILTIN_OCIO_ROOT}/aces_1.2/config.oci", + "{BUILTIN_OCIO_ROOT}/nuke-default/config.ocio", + ): + base_value["type"] = "custom_path" + base_value["custom_path"] = first_filepath + + ocio_config_profiles.append(base_value) From 0462d38445f9b4a66635e0ba3bcd9dfd4cf28a46 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 2 May 2024 15:11:56 +0100 Subject: [PATCH 074/269] 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 075/269] 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 076/269] 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 077/269] 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 078/269] 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 230611e91c6a89f73b8fc9c80a9414107018a0ac Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 3 May 2024 15:58:26 +0200 Subject: [PATCH 079/269] AY-4801 - new creator for editorial_pckg Should publish folder with otio file and (.mov) resources. --- .../create/create_editorial_package.py | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py new file mode 100644 index 0000000000..6a581b59d1 --- /dev/null +++ b/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py @@ -0,0 +1,66 @@ +from pathlib import Path + +from ayon_core.pipeline import ( + CreatedInstance, +) + +from ayon_core.lib.attribute_definitions import FileDef +from ayon_core.hosts.traypublisher.api.plugin import TrayPublishCreator + + +class EditorialPackageCreator(TrayPublishCreator): + """Creates instance for OTIO file from published folder. + + Folder contains OTIO file and exported .mov files. Process should publish + whole folder as single `editorial_pckg` product type and (possibly) convert + .mov files into different format and copy them into `publish` `resources` + subfolder. + """ + identifier = "editorial_pckg" + label = "Editorial package" + product_type = "editorial_pckg" + description = "Publish folder with OTIO file and resources" + + # Position batch creator after simple creators + order = 120 + + + def get_icon(self): + return "fa.folder" + + def create(self, product_name, instance_data, pre_create_data): + folder_path = pre_create_data.get("folder_path") + if not folder_path: + return + + instance_data["creator_attributes"] = { + "path": (Path(folder_path["directory"]) / + Path(folder_path["filenames"][0])).as_posix() + } + + # Create new instance + new_instance = CreatedInstance(self.product_type, product_name, + instance_data, self) + self._store_new_instance(new_instance) + + def get_pre_create_attr_defs(self): + # Use same attributes as for instance attributes + return [ + FileDef( + "folder_path", + folders=True, + single_item=True, + extensions=[], + allow_sequences=False, + label="Folder path" + ) + ] + + def get_detail_description(self): + return """# Publish folder with OTIO file and video clips + + Folder contains OTIO file and exported .mov files. Process should + publish whole folder as single `editorial_pckg` product type and + (possibly) convert .mov files into different format and copy them into + `publish` `resources` subfolder. + """ From 4318218881c6d4c0ad0f83bd23395b1c8936f5b7 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 3 May 2024 16:02:56 +0200 Subject: [PATCH 080/269] AY-4801 - new collector for editorial_pckg Collects otio_path and resource_paths from folder. Doesn't parse and collect otio_data yet, to not carry too much data over.(Might be changed) --- .../publish/collect_editorial_package.py | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py new file mode 100644 index 0000000000..101f58b6d1 --- /dev/null +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py @@ -0,0 +1,58 @@ +"""Produces instance.data["editorial_pckg"] data used during integration. + +Requires: + instance.data["creator_attributes"]["path"] - from creator + +Provides: + instance -> editorial_pckg (dict): + folder_path (str) + otio_path (str) - from dragged folder + resource_paths (list) + +""" +import os + +import pyblish.api + +from ayon_core.lib.transcoding import VIDEO_EXTENSIONS + + +class CollectEditorialPackage(pyblish.api.InstancePlugin): + """Collects path to OTIO file and resources""" + + label = "Collect Editorial Package" + order = pyblish.api.CollectorOrder - 0.1 + + hosts = ["traypublisher"] + families = ["editorial_pckg"] + + def process(self, instance): + folder_path = instance.data["creator_attributes"].get("path") + if not folder_path or not os.path.exists(folder_path): + self.log.info(( + "Instance doesn't contain collected existing folder path." + )) + return + + instance.data["editorial_pckg"] = {} + instance.data["editorial_pckg"]["folder_path"] = folder_path + + otio_path, resource_paths = ( + self._get_otio_and_resource_paths(folder_path)) + + instance.data["editorial_pckg"]["otio_path"] = otio_path + instance.data["editorial_pckg"]["resource_paths"] = resource_paths + + def _get_otio_and_resource_paths(self, folder_path): + otio_path = None + resource_paths = [] + + file_names = os.listdir(folder_path) + for filename in file_names: + _, ext = os.path.splitext(filename) + file_path = os.path.join(folder_path, filename) + if ext == ".otio": + otio_path = file_path + elif ext in VIDEO_EXTENSIONS: + resource_paths.append(file_path) + return otio_path, resource_paths From 1ff4d63091fbcbdcabc434317181fd19f00a916d Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 3 May 2024 16:11:12 +0200 Subject: [PATCH 081/269] AY-4801 - new validator for editorial_pckg Currently checks only by file names and expects flat structure. It ignores path to resources in otio file as folder might be dragged in and published from different location than it was created. --- .../publish/validate_editorial_package.py | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py new file mode 100644 index 0000000000..869dc73811 --- /dev/null +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py @@ -0,0 +1,70 @@ +import os +import opentimelineio + +import pyblish.api +from ayon_core.pipeline import PublishValidationError + + +class ValidateEditorialPackage(pyblish.api.InstancePlugin): + """Checks that published folder contains all resources from otio + + Currently checks only by file names and expects flat structure. + It ignores path to resources in otio file as folder might be dragged in and + published from different location than it was created. + """ + + label = "Validate Editorial Package" + order = pyblish.api.ValidatorOrder - 0.49 + + hosts = ["traypublisher"] + families = ["editorial_pckg"] + + def process(self, instance): + editorial_pckg_data = instance.data.get("editorial_pckg") + if not editorial_pckg_data: + raise PublishValidationError( + f"Editorial package not collected") + + folder_path = editorial_pckg_data["folder_path"] + + otio_path = editorial_pckg_data["otio_path"] + if not otio_path: + raise PublishValidationError( + f"Folder {folder_path} missing otio file") + + resource_paths = editorial_pckg_data["resource_paths"] + + resource_file_names = {os.path.basename(path) + for path in resource_paths} + + otio_data = opentimelineio.adapters.read_from_file(otio_path) + + target_urls = self._get_all_target_urls(otio_data) + missing_files = set() + for target_url in target_urls: + target_basename = os.path.basename(target_url) + if target_basename not in resource_file_names: + missing_files.add(target_basename) + + if missing_files: + raise PublishValidationError("Otio file contains missing files " + f"'{missing_files}'.") + + instance.data["editorial_pckg"]["otio_data"] = otio_data + + def _get_all_target_urls(self, otio_data): + target_urls = [] + + # Iterate through tracks, clips, or other elements + for track in otio_data.tracks: + for clip in track: + # Check if the clip has a media reference + if clip.media_reference is not None: + # Access the target_url from the media reference + target_url = clip.media_reference.target_url + if target_url: + target_urls.append(target_url) + + return target_urls + + From 20dad59947e4fb13d026670baa73820e9e378ecd Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 3 May 2024 18:31:40 +0200 Subject: [PATCH 082/269] AY-4801 - added editorial_pckg to integrate --- client/ayon_core/plugins/publish/integrate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/plugins/publish/integrate.py b/client/ayon_core/plugins/publish/integrate.py index 764168edd3..5a9d8eae2b 100644 --- a/client/ayon_core/plugins/publish/integrate.py +++ b/client/ayon_core/plugins/publish/integrate.py @@ -169,6 +169,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin): "yeticacheUE", "tycache", "csv_ingest_file", + "editorial_pckg" ] default_template_name = "publish" From 345f5f31f1a395c4f4d468166bc343933be9974e Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 3 May 2024 18:44:48 +0200 Subject: [PATCH 083/269] AY-4801 - added editorial_pckg extractor Modifies otio file with rootless publish paths, prepares for integration. --- .../plugins/publish/extract_editorial_pckg.py | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py new file mode 100644 index 0000000000..dc8163e1ff --- /dev/null +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py @@ -0,0 +1,122 @@ +import os.path +import opentimelineio + +import pyblish.api + +from ayon_core.pipeline import publish + + +class ExtractEditorialPackage(publish.Extractor): + """Replaces movie paths in otio file with publish rootless + + Prepares movie resources for integration. + TODO introduce conversion to .mp4 + """ + + label = "Extract Editorial Package" + order = pyblish.api.ExtractorOrder - 0.45 + hosts = ["traypublisher"] + families = ["editorial_pckg"] + + def process(self, instance): + editorial_pckg_data = instance.data.get("editorial_pckg") + + otio_path = editorial_pckg_data["otio_path"] + otio_basename = os.path.basename(otio_path) + staging_dir = self.staging_dir(instance) + + editorial_pckg_repre = { + 'name': "editorial_pckg", + 'ext': "otio", + 'files': otio_basename, + "stagingDir": staging_dir, + } + otio_staging_path = os.path.join(staging_dir, otio_basename) + + instance.data["representations"].append(editorial_pckg_repre) + + publish_path = self._get_published_path(instance) + publish_folder = os.path.dirname(publish_path) + publish_resource_folder = os.path.join(publish_folder, "resources") + + resource_paths = editorial_pckg_data["resource_paths"] + transfers = self._get_transfers(resource_paths, + publish_resource_folder) + if not "transfers" in instance.data: + instance.data["transfers"] = [] + instance.data["transfers"] = transfers + + source_to_rootless = self._get_resource_path_mapping(instance, + transfers) + + otio_data = editorial_pckg_data["otio_data"] + otio_data = self._replace_target_urls(otio_data, source_to_rootless) + + opentimelineio.adapters.write_to_file(otio_data, otio_staging_path) + + self.log.info("Added Editorial Package representation: {}".format( + editorial_pckg_repre)) + + def _get_resource_path_mapping(self, instance, transfers): + """Returns dict of {source_mov_path: rootless_published_path}.""" + replace_paths = {} + anatomy = instance.context.data["anatomy"] + for source, destination in transfers: + rootless_path = self._get_rootless(anatomy, destination) + source_file_name = os.path.basename(source) + replace_paths[source_file_name] = rootless_path + return replace_paths + + def _get_transfers(self, resource_paths, publish_resource_folder): + """Returns list of tuples (source, destination) movie paths.""" + transfers = [] + for res_path in resource_paths: + res_basename = os.path.basename(res_path) + pub_res_path = os.path.join(publish_resource_folder, res_basename) + transfers.append((res_path, pub_res_path)) + return transfers + + def _replace_target_urls(self, otio_data, replace_paths): + """Replace original movie paths with published rootles ones.""" + for track in otio_data.tracks: + for clip in track: + # Check if the clip has a media reference + if clip.media_reference is not None: + # Access the target_url from the media reference + target_url = clip.media_reference.target_url + if not target_url: + continue + file_name = os.path.basename(target_url) + replace_value = replace_paths.get(file_name) + if replace_value: + clip.media_reference.target_url = replace_value + + return otio_data + + def _get_rootless(self, anatomy, path): + """Try to find rootless {root[work]} path from `path`""" + success, rootless_path = anatomy.find_root_template_from_path( + path) + if not success: + # `rootless_path` is not set to `output_dir` if none of roots match + self.log.warning( + f"Could not find root path for remapping '{path}'." + ) + rootless_path = path + + return rootless_path + + def _get_published_path(self, instance): + """Calculates expected `publish` folder""" + # determine published path from Anatomy. + template_data = instance.data.get("anatomyData") + rep = instance.data["representations"][0] + template_data["representation"] = rep.get("name") + template_data["ext"] = rep.get("ext") + template_data["comment"] = None + + anatomy = instance.context.data["anatomy"] + template_data["root"] = anatomy.roots + template = anatomy.get_template_item("publish", "default", "path") + template_filled = template.format_strict(template_data) + return os.path.normpath(template_filled) From 6bb585c6a92b62f70fbfb2355ed45e3ff70f0d9a Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 3 May 2024 20:31:40 +0200 Subject: [PATCH 084/269] Change label to `Load Cache` --- client/ayon_core/hosts/blender/plugins/load/load_cache.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/blender/plugins/load/load_cache.py b/client/ayon_core/hosts/blender/plugins/load/load_cache.py index 65d45e6fc4..30c847f89d 100644 --- a/client/ayon_core/hosts/blender/plugins/load/load_cache.py +++ b/client/ayon_core/hosts/blender/plugins/load/load_cache.py @@ -29,8 +29,7 @@ class CacheModelLoader(plugin.AssetLoader): product_types = {"model", "pointcache", "animation", "usd"} representations = {"abc", "usd"} - # TODO: Should USD loader be a separate loader instead? - label = "Load Alembic/USD" + label = "Load Cache" icon = "code-fork" color = "orange" From bd0509a2c64d9488e5c79dbf9ea27e1b885b064d Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 3 May 2024 20:42:16 +0200 Subject: [PATCH 085/269] Allow publishing USD from `model` family and expose it in settings --- .../hosts/blender/plugins/publish/extract_usd.py | 11 +++++++++++ .../blender/server/settings/publish_plugins.py | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py b/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py index 70092ded7b..1d4fa3d7ac 100644 --- a/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py +++ b/client/ayon_core/hosts/blender/plugins/publish/extract_usd.py @@ -77,3 +77,14 @@ class ExtractUSD(publish.Extractor): instance.data.setdefault("representations", []).append(representation) self.log.debug("Extracted instance '%s' to: %s", instance.name, representation) + + +class ExtractModelUSD(ExtractUSD): + """Extract model as USD.""" + + label = "Extract USD (Model)" + hosts = ["blender"] + families = ["model"] + + # Driven by settings + optional = True diff --git a/server_addon/blender/server/settings/publish_plugins.py b/server_addon/blender/server/settings/publish_plugins.py index e998d7b057..8db8c5be46 100644 --- a/server_addon/blender/server/settings/publish_plugins.py +++ b/server_addon/blender/server/settings/publish_plugins.py @@ -151,6 +151,10 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=ExtractPlayblastModel, title="Extract Playblast" ) + ExtractModelUSD: ValidatePluginModel = SettingsField( + default_factory=ValidatePluginModel, + title="Extract Model USD" + ) DEFAULT_BLENDER_PUBLISH_SETTINGS = { @@ -348,5 +352,10 @@ DEFAULT_BLENDER_PUBLISH_SETTINGS = { }, indent=4 ) + }, + "ExtractModelUSD": { + "enabled": True, + "optional": True, + "active": True } } From 8131b53983301b0d5f4e3a5a6a8fd42eff0eedbb Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 3 May 2024 20:42:41 +0200 Subject: [PATCH 086/269] Bump blender server addon version --- server_addon/blender/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/blender/package.py b/server_addon/blender/package.py index 667076e533..d2c02a4909 100644 --- a/server_addon/blender/package.py +++ b/server_addon/blender/package.py @@ -1,3 +1,3 @@ name = "blender" title = "Blender" -version = "0.1.8" +version = "0.1.9" From ade52e789702f7d7f57a6898d13e75e79537653c Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 3 May 2024 23:16:34 +0300 Subject: [PATCH 087/269] add model product type creator --- .../houdini/plugins/create/create_model.py | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 client/ayon_core/hosts/houdini/plugins/create/create_model.py diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_model.py b/client/ayon_core/hosts/houdini/plugins/create/create_model.py new file mode 100644 index 0000000000..1f32ccde45 --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/create/create_model.py @@ -0,0 +1,144 @@ +# -*- coding: utf-8 -*- +"""Creator plugin for creating Model product type. + +Note: + Currently, This creator plugin is the same as 'create_pointcache.py' + But renaming the product type to 'model'. + + It's purpose to support + Maya (load/publish model from maya to/from houdini). + + It's considered to support multiple representations in the future. +""" + +from ayon_core.hosts.houdini.api import plugin +from ayon_core.lib import BoolDef + +import hou + + + +class CreateModel(plugin.HoudiniCreator): + """Create Model""" + identifier = "io.openpype.creators.houdini.model" + label = "Model" + product_type = "model" + icon = "cube" + + def get_publish_families(self): + return ["model", "abc"] + + def create(self, product_name, instance_data, pre_create_data): + instance_data.pop("active", None) + instance_data.update({"node_type": "alembic"}) + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + creator_attributes["farm"] = pre_create_data["farm"] + + instance = super(CreateModel, self).create( + product_name, + instance_data, + pre_create_data) + + instance_node = hou.node(instance.get("instance_node")) + parms = { + "use_sop_path": True, + "build_from_path": True, + "path_attrib": "path", + "prim_to_detail_pattern": "cbId", + "format": 2, + "facesets": 0, + "filename": hou.text.expandString( + "$HIP/pyblish/{}.abc".format(product_name)) + } + + if self.selected_nodes: + selected_node = self.selected_nodes[0] + + # Although Houdini allows ObjNode path on `sop_path` for the + # the ROP node we prefer it set to the SopNode path explicitly + + # Allow sop level paths (e.g. /obj/geo1/box1) + if isinstance(selected_node, hou.SopNode): + parms["sop_path"] = selected_node.path() + self.log.debug( + "Valid SopNode selection, 'SOP Path' in ROP will be set to '%s'." + % selected_node.path() + ) + + # Allow object level paths to Geometry nodes (e.g. /obj/geo1) + # but do not allow other object level nodes types like cameras, etc. + elif isinstance(selected_node, hou.ObjNode) and \ + selected_node.type().name() in ["geo"]: + + # get the output node with the minimum + # 'outputidx' or the node with display flag + sop_path = self.get_obj_output(selected_node) + + if sop_path: + parms["sop_path"] = sop_path.path() + self.log.debug( + "Valid ObjNode selection, 'SOP Path' in ROP will be set to " + "the child path '%s'." + % sop_path.path() + ) + + if not parms.get("sop_path", None): + self.log.debug( + "Selection isn't valid. 'SOP Path' in ROP will be empty." + ) + else: + self.log.debug( + "No Selection. 'SOP Path' in ROP will be empty." + ) + + instance_node.setParms(parms) + instance_node.parm("trange").set(1) + + # Explicitly set f1 and f2 to frame start. + # Which forces the rop node to export one frame. + instance_node.parmTuple('f').deleteAllKeyframes() + fstart = int(hou.hscriptExpression("$FSTART")) + instance_node.parmTuple('f').set((fstart, fstart, 1)) + + # Lock any parameters in this list + to_lock = ["prim_to_detail_pattern"] + self.lock_parameters(instance_node, to_lock) + + def get_network_categories(self): + return [ + hou.ropNodeTypeCategory(), + hou.sopNodeTypeCategory() + ] + + def get_obj_output(self, obj_node): + """Find output node with the smallest 'outputidx'.""" + + outputs = obj_node.subnetOutputs() + + # if obj_node is empty + if not outputs: + return + + # if obj_node has one output child whether its + # sop output node or a node with the render flag + elif len(outputs) == 1: + return outputs[0] + + # if there are more than one, then it have multiple output nodes + # return the one with the minimum 'outputidx' + else: + return min(outputs, + key=lambda node: node.evalParm('outputidx')) + + def get_instance_attr_defs(self): + return [ + BoolDef("farm", + label="Submitting to Farm", + default=False) + ] + + def get_pre_create_attr_defs(self): + attrs = super().get_pre_create_attr_defs() + # Use same attributes as for instance attributes + return attrs + self.get_instance_attr_defs() From ba57d6db6d37f3a8a5d24b02b4f5a3d66530eb7c Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 3 May 2024 23:18:33 +0300 Subject: [PATCH 088/269] add essential publish plugins for model product type --- .../plugins/publish/collect_cache_farm.py | 7 +-- .../plugins/publish/collect_chunk_size.py | 2 +- .../plugins/publish/collect_output_node.py | 3 +- .../validate_export_is_a_single_frame.py | 60 +++++++++++++++++++ .../publish/validate_mesh_is_static.py | 6 +- .../publish/validate_mkpaths_toggled.py | 2 +- .../publish/validate_sop_output_node.py | 2 +- 7 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 client/ayon_core/hosts/houdini/plugins/publish/validate_export_is_a_single_frame.py diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_cache_farm.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_cache_farm.py index 040ad68a1a..dc433f0f58 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_cache_farm.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_cache_farm.py @@ -10,7 +10,7 @@ class CollectDataforCache(pyblish.api.InstancePlugin): order = pyblish.api.CollectorOrder + 0.04 families = ["ass", "pointcache", "mantraifd", "redshiftproxy", - "vdbcache"] + "vdbcache", "model"] hosts = ["houdini"] targets = ["local", "remote"] label = "Collect Data for Cache" @@ -42,10 +42,7 @@ class CollectDataforCache(pyblish.api.InstancePlugin): cache_files = {"_": instance.data["files"]} # Convert instance family to pointcache if it is bgeo or abc # because ??? - for family in instance.data["families"]: - if family == "bgeo" or "abc": - instance.data["productType"] = "pointcache" - break + self.log.debug(instance.data["families"]) instance.data.update({ "plugin": "Houdini", "publish": True diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_chunk_size.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_chunk_size.py index 3e2561dd6f..f0913f2f0a 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_chunk_size.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_chunk_size.py @@ -10,7 +10,7 @@ class CollectChunkSize(pyblish.api.InstancePlugin, order = pyblish.api.CollectorOrder + 0.05 families = ["ass", "pointcache", "vdbcache", "mantraifd", - "redshiftproxy"] + "redshiftproxy", "model"] hosts = ["houdini"] targets = ["local", "remote"] label = "Collect Chunk Size" diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_output_node.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_output_node.py index 26381e065e..289222f32b 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_output_node.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_output_node.py @@ -15,7 +15,8 @@ class CollectOutputSOPPath(pyblish.api.InstancePlugin): "usd", "usdrender", "redshiftproxy", - "staticMesh" + "staticMesh", + "model" ] hosts = ["houdini"] diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_export_is_a_single_frame.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_export_is_a_single_frame.py new file mode 100644 index 0000000000..6775699adf --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_export_is_a_single_frame.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +"""Validator for checking that export is a single frame.""" +import pyblish.api +from ayon_core.pipeline import ( + PublishValidationError, + OptionalPyblishPluginMixin +) +from ayon_core.pipeline.publish import ValidateContentsOrder +from ayon_core.hosts.houdini.api.action import SelectInvalidAction + + +class ValidateSingleFrame(pyblish.api.InstancePlugin, + OptionalPyblishPluginMixin): + """Validate Export is a Single Frame. + + It checks if rop node is exporting one frame. + This is mainly for Model product type. + """ + + families = ["model"] + hosts = ["houdini"] + label = "Validate Single Frame" + order = ValidateContentsOrder + 0.1 + actions = [SelectInvalidAction] + + def process(self, instance): + + invalid = self.get_invalid(instance) + if invalid: + nodes = [n.path() for n in invalid] + raise PublishValidationError( + "See log for details. " + "Invalid nodes: {0}".format(nodes) + ) + + @classmethod + def get_invalid(cls, instance): + + invalid = [] + + frame_start = instance.data.get("frameStartHandle") + frame_end = instance.data.get("frameEndHandle") + + # This happens if instance node has no 'trange' parameter. + if (frame_start or frame_end) is None: + cls.log.debug( + "No frame data, skipping check.." + ) + return + + if frame_start != frame_end: + invalid.append(instance.data["instance_node"]) + cls.log.error( + "Invalid frame range on '%s'." + "You should use the same frame number for 'f1' " + "and 'f2' parameters.", + instance.data["instance_node"].path() + ) + + return invalid diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_mesh_is_static.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_mesh_is_static.py index 289e00339b..9652367bfe 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_mesh_is_static.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_mesh_is_static.py @@ -16,9 +16,13 @@ class ValidateMeshIsStatic(pyblish.api.InstancePlugin, """Validate mesh is static. It checks if output node is time dependent. + this avoids getting different output from ROP node when extracted + from a different frame than the first frame. + (Might be overly restrictive though) """ - families = ["staticMesh"] + families = ["staticMesh", + "model"] hosts = ["houdini"] label = "Validate Mesh is Static" order = ValidateContentsOrder + 0.1 diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py index 38f1c4e176..5e59eb505f 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py @@ -7,7 +7,7 @@ class ValidateIntermediateDirectoriesChecked(pyblish.api.InstancePlugin): """Validate Create Intermediate Directories is enabled on ROP node.""" order = pyblish.api.ValidatorOrder - families = ["pointcache", "camera", "vdbcache"] + families = ["pointcache", "camera", "vdbcache", "model"] hosts = ["houdini"] label = "Create Intermediate Directories Checked" diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_sop_output_node.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_sop_output_node.py index 61cf7596ac..d67192d28e 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_sop_output_node.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_sop_output_node.py @@ -22,7 +22,7 @@ class ValidateSopOutputNode(pyblish.api.InstancePlugin): """ order = pyblish.api.ValidatorOrder - families = ["pointcache", "vdbcache"] + families = ["pointcache", "vdbcache", "model"] hosts = ["houdini"] label = "Validate Output Node (SOP)" actions = [SelectROPAction, SelectInvalidAction] From 5e0ab289293b37a195c3c59bf42221c4e04e823d Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:04:36 +0200 Subject: [PATCH 089/269] renamed 'tools__get_config_data_name' to '_get_host_config_data' --- client/ayon_core/pipeline/colorspace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 8dcbaeb877..f17e9d5f7b 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1069,7 +1069,7 @@ def get_imageio_config_preset( log, ) else: - config_data = _get_config_data( + config_data = _get_host_config_data( host_ocio_config["filepath"], template_data, env ) @@ -1082,7 +1082,7 @@ def get_imageio_config_preset( return config_data -def _get_config_data(path_list, anatomy_data, env=None): +def _get_host_config_data(path_list, anatomy_data, env=None): """Return first existing path in path list. If template is used in path inputs, From 1589ee5c0e9ccf35e723d7f703fad4118470c8bc Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:05:01 +0200 Subject: [PATCH 090/269] simplified '_get_host_config_data' --- client/ayon_core/pipeline/colorspace.py | 43 ++++++++++--------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index f17e9d5f7b..595c50606c 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1082,39 +1082,30 @@ def get_imageio_config_preset( return config_data -def _get_host_config_data(path_list, anatomy_data, env=None): +def _get_host_config_data(templates, template_data): """Return first existing path in path list. - If template is used in path inputs, - then it is formatted by anatomy data - and environment variables + Use template data to fill possible formatting in paths. Args: - path_list (list[str]): list of abs paths - anatomy_data (dict): formatting data - env (Optional[dict]): Environment variables. + templates (list[str]): List of templates to config paths. + template_data (dict): Template data used to format templates. Returns: - dict: config data + Union[dict, None]: Config data or 'None' if templates are empty + or any path exists. + """ - formatting_data = deepcopy(anatomy_data) - - environment_vars = env or dict(**os.environ) - - # format the path for potential env vars - formatting_data.update(environment_vars) - - # first try host config paths - for path_ in path_list: - formatted_path = _format_path(path_, formatting_data) - - if not os.path.exists(formatted_path): - continue - - return { - "path": os.path.normpath(formatted_path), - "template": path_ - } + for template in templates: + formatted_path = StringTemplate.format_strict_template( + template, template_data + ) + path = os.path.abspath(formatted_path) + if os.path.exists(path): + return { + "path": os.path.normpath(path), + "template": template + } def _format_path(template_path, formatting_data): From aaeaa1e7f0c6c977716b5e240b3610090d32190c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:10:14 +0200 Subject: [PATCH 091/269] removed unused '_format_path' --- client/ayon_core/pipeline/colorspace.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 595c50606c..363012dad5 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1108,24 +1108,6 @@ def _get_host_config_data(templates, template_data): } -def _format_path(template_path, formatting_data): - """Single template path formatting. - - Args: - template_path (str): template string - formatting_data (dict): data to be used for - template formatting - - Returns: - str: absolute formatted path - """ - # format path for anatomy keys - formatted_path = StringTemplate(template_path).format( - formatting_data) - - return os.path.abspath(formatted_path) - - def get_imageio_file_rules(project_name, host_name, project_settings=None): """Get ImageIO File rules from project settings From c6b6ca1e3cfbb3d400b65ec3ead9d5bd5518650b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:10:36 +0200 Subject: [PATCH 092/269] use safer option to format template path --- client/ayon_core/pipeline/colorspace.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 363012dad5..1ab93c7844 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1097,9 +1097,12 @@ def _get_host_config_data(templates, template_data): """ for template in templates: - formatted_path = StringTemplate.format_strict_template( + formatted_path = StringTemplate.format_template( template, template_data ) + if not formatted_path.solved: + continue + path = os.path.abspath(formatted_path) if os.path.exists(path): return { From bc01bf08f2a45339b476af61094904551a73a12b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:50:00 +0200 Subject: [PATCH 093/269] updated 'get_colorspace_settings_from_publish_context' to use new function --- client/ayon_core/pipeline/colorspace.py | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 1ab93c7844..5793fd1143 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1236,27 +1236,41 @@ def get_colorspace_settings_from_publish_context(context_data): Returns: tuple | bool: config, file rules or None + """ if "imageioSettings" in context_data and context_data["imageioSettings"]: return context_data["imageioSettings"] project_name = context_data["projectName"] + folder_path = context_data["folderPath"] + task_name = context_data["task"] host_name = context_data["hostName"] - anatomy_data = context_data["anatomyData"] - project_settings_ = context_data["project_settings"] + anatomy = context_data["anatomy"] + template_data = context_data["anatomyData"] + project_settings = context_data["project_settings"] + folder_id = None + folder_entity = context_data.get("folderEntity") + if folder_entity: + folder_id = folder_entity["id"] - config_data = get_imageio_config( - project_name, host_name, - project_settings=project_settings_, - anatomy_data=anatomy_data + config_data = get_imageio_config_preset( + project_name, + folder_path, + task_name, + host_name, + anatomy=anatomy, + project_settings=project_settings, + template_data=template_data, + folder_id=folder_id, ) # caching invalid state, so it's not recalculated all the time file_rules = None if config_data: file_rules = get_imageio_file_rules( - project_name, host_name, - project_settings=project_settings_ + project_name, + host_name, + project_settings=project_settings ) # caching settings for future instance processing From 178e30d8e7fdba1012908f1f7574e824ab03055a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:52:31 +0200 Subject: [PATCH 094/269] fix call of '_get_host_config_data' --- client/ayon_core/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 5793fd1143..906f9f96fa 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1070,7 +1070,7 @@ def get_imageio_config_preset( ) else: config_data = _get_host_config_data( - host_ocio_config["filepath"], template_data, env + host_ocio_config["filepath"], template_data ) if not config_data: From 571658b1290c69b9444ecaabc35247722dd15aca Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:53:12 +0200 Subject: [PATCH 095/269] make context optional --- client/ayon_core/pipeline/colorspace.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 906f9f96fa..a715651f4a 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -783,8 +783,8 @@ def get_imageio_config( get_current_context_template_data) anatomy_data = get_current_context_template_data() - task_name = anatomy_data["task"]["name"] - folder_path = anatomy_data["folder"]["path"] + task_name = anatomy_data.get("task", {}).get("name") + folder_path = anatomy_data.get("folder", {}).get("path") return get_imageio_config_preset( project_name, folder_path, @@ -1029,13 +1029,17 @@ def get_imageio_config_preset( if not project_entity: project_entity = ayon_api.get_project(project_name) - folder_entity = ayon_api.get_folder_by_path( - project_name, folder_path - ) - folder_id = folder_entity["id"] - task_entity = ayon_api.get_task_by_name( - project_name, folder_id, task_name - ) + folder_entity = task_entity = folder_id = None + if folder_path: + folder_entity = ayon_api.get_folder_by_path( + project_name, folder_path + ) + folder_id = folder_entity["id"] + + if folder_id and task_name: + task_entity = ayon_api.get_task_by_name( + project_name, folder_id, task_name + ) template_data = get_template_data( project_entity, folder_entity, From cd857753ae6f24bf066514ecaf26d32bed827217 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:54:00 +0200 Subject: [PATCH 096/269] 'config_data' are now required in other functions --- client/ayon_core/pipeline/colorspace.py | 86 ++++++++++++++----------- 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index a715651f4a..9e33b2e531 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -126,42 +126,48 @@ def get_ocio_config_script_path(): def get_colorspace_name_from_filepath( - filepath, host_name, project_name, - config_data=None, file_rules=None, + filepath, + host_name, + project_name, + config_data, + file_rules=None, project_settings=None, validate=True ): """Get colorspace name from filepath Args: - filepath (str): path string, file rule pattern is tested on it - host_name (str): host name - project_name (str): project name - config_data (Optional[dict]): config path and template in dict. - Defaults to None. - file_rules (Optional[dict]): file rule data from settings. - Defaults to None. - project_settings (Optional[dict]): project settings. Defaults to None. + filepath (str): Path string, file rule pattern is tested on it. + host_name (str): Host name. + project_name (str): Project name. + config_data (dict): Config path and template in dict. + file_rules (Optional[dict]): File rule data from settings. + project_settings (Optional[dict]): Project settings. validate (Optional[bool]): should resulting colorspace be validated - with config file? Defaults to True. + with config file? Defaults to True. Returns: - str: name of colorspace - """ - project_settings, config_data, file_rules = _get_context_settings( - host_name, project_name, - config_data=config_data, file_rules=file_rules, - project_settings=project_settings - ) + Union[str, None]: name of colorspace + """ if not config_data: # in case global or host color management is not enabled return None + if file_rules is None: + if project_settings is None: + project_settings = get_project_settings(project_name) + file_rules = get_imageio_file_rules( + project_name, host_name, project_settings + ) + # use ImageIO file rules colorspace_name = get_imageio_file_rules_colorspace_from_filepath( - filepath, host_name, project_name, - config_data=config_data, file_rules=file_rules, + filepath, + host_name, + project_name, + config_data=config_data, + file_rules=file_rules, project_settings=project_settings ) @@ -187,7 +193,8 @@ def get_colorspace_name_from_filepath( # validate matching colorspace with config if validate: validate_imageio_colorspace_in_config( - config_data["path"], colorspace_name) + config_data["path"], colorspace_name + ) return colorspace_name @@ -226,8 +233,11 @@ def _get_context_settings( def get_imageio_file_rules_colorspace_from_filepath( - filepath, host_name, project_name, - config_data=None, file_rules=None, + filepath, + host_name, + project_name, + config_data, + file_rules=None, project_settings=None ): """Get colorspace name from filepath @@ -235,28 +245,28 @@ def get_imageio_file_rules_colorspace_from_filepath( ImageIO Settings file rules are tested for matching rule. Args: - filepath (str): path string, file rule pattern is tested on it - host_name (str): host name - project_name (str): project name - config_data (Optional[dict]): config path and template in dict. - Defaults to None. - file_rules (Optional[dict]): file rule data from settings. - Defaults to None. - project_settings (Optional[dict]): project settings. Defaults to None. + filepath (str): Path string, file rule pattern is tested on it. + host_name (str): Host name. + project_name (str): Project name. + config_data (dict): Config path and template in dict. + file_rules (Optional[dict]): File rule data from settings. + project_settings (Optional[dict]): Project settings. Returns: - str: name of colorspace - """ - project_settings, config_data, file_rules = _get_context_settings( - host_name, project_name, - config_data=config_data, file_rules=file_rules, - project_settings=project_settings - ) + Union[str, None]: Name of colorspace. + """ if not config_data: # in case global or host color management is not enabled return None + if file_rules is None: + if project_settings is None: + project_settings = get_project_settings(project_name) + file_rules = get_imageio_file_rules( + project_name, host_name, project_settings + ) + # match file rule from path colorspace_name = None for file_rule in file_rules: From 5d6993d1112c7e24285f43b78ae68193abe29e7b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:54:18 +0200 Subject: [PATCH 097/269] removed unused '_get_context_settings' --- client/ayon_core/pipeline/colorspace.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 9e33b2e531..0e745b625f 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -210,28 +210,6 @@ def get_colorspace_from_filepath(*args, **kwargs): return get_imageio_file_rules_colorspace_from_filepath(*args, **kwargs) -def _get_context_settings( - host_name, project_name, - config_data=None, file_rules=None, - project_settings=None -): - project_settings = project_settings or get_project_settings( - project_name - ) - - config_data = config_data or get_imageio_config( - project_name, host_name, project_settings) - - # in case host color management is not enabled - if not config_data: - return (None, None, None) - - file_rules = file_rules or get_imageio_file_rules( - project_name, host_name, project_settings) - - return project_settings, config_data, file_rules - - def get_imageio_file_rules_colorspace_from_filepath( filepath, host_name, From 1586b316c8ab700b1f9e42dc57e813454010356a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:54:47 +0200 Subject: [PATCH 098/269] implemented function for current context --- client/ayon_core/pipeline/colorspace.py | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 0e745b625f..e0fa613ae8 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -23,6 +23,7 @@ from ayon_core.pipeline.template_data import get_template_data from ayon_core.pipeline.load import get_representation_path_with_anatomy from ayon_core.lib.transcoding import VIDEO_EXTENSIONS, IMAGE_EXTENSIONS +from .context_tools import get_current_context, get_current_host_name log = Logger.get_logger(__name__) @@ -1402,3 +1403,37 @@ def get_display_view_colorspace_subprocess(config_path, display, view): # return default view colorspace name with open(tmp_json_path, "r") as f: return json.load(f) + + +# --- Current context functions --- +def get_current_context_imageio_config_preset( + anatomy=None, + project_settings=None, + template_data=None, + env=None, +): + """Get ImageIO config preset for current context. + + Args: + anatomy (Optional[Anatomy]): Current project anatomy. + project_settings (Optional[dict[str, Any]]): Current project settings. + template_data (Optional[dict[str, Any]]): Prepared template data + for current context. + env (Optional[dict[str, str]]): Custom environment variable values. + + Returns: + dict: ImageIO config preset. + + """ + context = get_current_context() + host_name = get_current_host_name() + return get_imageio_config_preset( + context["project_name"], + context["folder_path"], + context["task_name"], + host_name, + anatomy=anatomy, + project_settings=project_settings, + template_data=template_data, + env=env, + ) From 3d1fa6471cbf8be68906a94aacea80bc90dc0a53 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 15:59:50 +0200 Subject: [PATCH 099/269] use 'get_current_context_imageio_config_preset' in host integrations --- client/ayon_core/hosts/hiero/api/lib.py | 5 +--- client/ayon_core/hosts/max/api/lib.py | 11 ++------ .../hosts/maya/plugins/load/load_image.py | 5 ++-- .../plugins/create/create_colorspace_look.py | 7 +----- .../publish/collect_explicit_colorspace.py | 25 +++++++++---------- 5 files changed, 18 insertions(+), 35 deletions(-) diff --git a/client/ayon_core/hosts/hiero/api/lib.py b/client/ayon_core/hosts/hiero/api/lib.py index aaf99546c7..456a68f125 100644 --- a/client/ayon_core/hosts/hiero/api/lib.py +++ b/client/ayon_core/hosts/hiero/api/lib.py @@ -1110,10 +1110,7 @@ def apply_colorspace_project(): ''' # backward compatibility layer # TODO: remove this after some time - config_data = get_imageio_config( - project_name=get_current_project_name(), - host_name="hiero" - ) + config_data = get_current_context_imageio_config_preset() if config_data: presets.update({ diff --git a/client/ayon_core/hosts/max/api/lib.py b/client/ayon_core/hosts/max/api/lib.py index d9a3af3336..4170a992a5 100644 --- a/client/ayon_core/hosts/max/api/lib.py +++ b/client/ayon_core/hosts/max/api/lib.py @@ -372,12 +372,8 @@ def reset_colorspace(): """ if int(get_max_version()) < 2024: return - project_name = get_current_project_name() - colorspace_mgr = rt.ColorPipelineMgr - project_settings = get_project_settings(project_name) - max_config_data = colorspace.get_imageio_config( - project_name, "max", project_settings) + max_config_data = colorspace.get_current_context_imageio_config_preset() if max_config_data: ocio_config_path = max_config_data["path"] colorspace_mgr = rt.ColorPipelineMgr @@ -392,10 +388,7 @@ def check_colorspace(): "because Max main window can't be found.") if int(get_max_version()) >= 2024: color_mgr = rt.ColorPipelineMgr - project_name = get_current_project_name() - project_settings = get_project_settings(project_name) - max_config_data = colorspace.get_imageio_config( - project_name, "max", project_settings) + max_config_data = colorspace.get_current_context_imageio_config_preset() if max_config_data and color_mgr.Mode != rt.Name("OCIO_Custom"): if not is_headless(): from ayon_core.tools.utils import SimplePopup diff --git a/client/ayon_core/hosts/maya/plugins/load/load_image.py b/client/ayon_core/hosts/maya/plugins/load/load_image.py index 5b0858ce70..171920f747 100644 --- a/client/ayon_core/hosts/maya/plugins/load/load_image.py +++ b/client/ayon_core/hosts/maya/plugins/load/load_image.py @@ -8,7 +8,7 @@ from ayon_core.pipeline import ( from ayon_core.pipeline.load.utils import get_representation_path_from_context from ayon_core.pipeline.colorspace import ( get_imageio_file_rules_colorspace_from_filepath, - get_imageio_config, + get_current_context_imageio_config_preset, get_imageio_file_rules ) from ayon_core.settings import get_project_settings @@ -270,8 +270,7 @@ class FileNodeLoader(load.LoaderPlugin): host_name = get_current_host_name() project_settings = get_project_settings(project_name) - config_data = get_imageio_config( - project_name, host_name, + config_data = get_current_context_imageio_config_preset( project_settings=project_settings ) diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_colorspace_look.py b/client/ayon_core/hosts/traypublisher/plugins/create/create_colorspace_look.py index 4d865c1c5c..da05afe86b 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/create/create_colorspace_look.py +++ b/client/ayon_core/hosts/traypublisher/plugins/create/create_colorspace_look.py @@ -156,14 +156,9 @@ This creator publishes color space look file (LUT). ] def apply_settings(self, project_settings): - host = self.create_context.host - host_name = host.name - project_name = host.get_current_project_name() - config_data = colorspace.get_imageio_config( - project_name, host_name, + config_data = colorspace.get_current_context_imageio_config_preset( project_settings=project_settings ) - if not config_data: self.enabled = False return diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_explicit_colorspace.py b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_explicit_colorspace.py index 8e29a0048d..5fbb9a6f4c 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_explicit_colorspace.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_explicit_colorspace.py @@ -1,10 +1,7 @@ import pyblish.api -from ayon_core.pipeline import ( - publish, - registered_host -) from ayon_core.lib import EnumDef from ayon_core.pipeline import colorspace +from ayon_core.pipeline import publish from ayon_core.pipeline.publish import KnownPublishError @@ -19,9 +16,10 @@ class CollectColorspace(pyblish.api.InstancePlugin, families = ["render", "plate", "reference", "image", "online"] enabled = False - colorspace_items = [ + default_colorspace_items = [ (None, "Don't override") ] + colorspace_items = list(default_colorspace_items) colorspace_attr_show = False config_items = None @@ -69,14 +67,13 @@ class CollectColorspace(pyblish.api.InstancePlugin, @classmethod def apply_settings(cls, project_settings): - host = registered_host() - host_name = host.name - project_name = host.get_current_project_name() - config_data = colorspace.get_imageio_config( - project_name, host_name, + config_data = colorspace.get_current_context_imageio_config_preset( project_settings=project_settings ) + enabled = False + colorspace_items = list(cls.default_colorspace_items) + config_items = None if config_data: filepath = config_data["path"] config_items = colorspace.get_ocio_config_colorspaces(filepath) @@ -85,9 +82,11 @@ class CollectColorspace(pyblish.api.InstancePlugin, include_aliases=True, include_roles=True ) - cls.config_items = config_items - cls.colorspace_items.extend(labeled_colorspaces) - cls.enabled = True + colorspace_items.extend(labeled_colorspaces) + + cls.config_items = config_items + cls.colorspace_items = colorspace_items + cls.enabled = enabled @classmethod def get_attribute_defs(cls): From f827dc2060488de74421cd7d0b8fc826a499975e Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 16:55:59 +0200 Subject: [PATCH 100/269] use new function in pre launch hook --- client/ayon_core/hooks/pre_ocio_hook.py | 52 ++++++++++++++----------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/client/ayon_core/hooks/pre_ocio_hook.py b/client/ayon_core/hooks/pre_ocio_hook.py index 0817afec71..6c30b267bc 100644 --- a/client/ayon_core/hooks/pre_ocio_hook.py +++ b/client/ayon_core/hooks/pre_ocio_hook.py @@ -1,7 +1,7 @@ from ayon_applications import PreLaunchHook -from ayon_core.pipeline.colorspace import get_imageio_config -from ayon_core.pipeline.template_data import get_template_data_with_names +from ayon_core.pipeline.colorspace import get_imageio_config_preset +from ayon_core.pipeline.template_data import get_template_data class OCIOEnvHook(PreLaunchHook): @@ -26,32 +26,38 @@ class OCIOEnvHook(PreLaunchHook): def execute(self): """Hook entry method.""" - template_data = get_template_data_with_names( - project_name=self.data["project_name"], - folder_path=self.data["folder_path"], - task_name=self.data["task_name"], + folder_entity = self.data["folder_entity"] + + template_data = get_template_data( + self.data["project_entity"], + folder_entity=folder_entity, + task_entity=self.data["task_entity"], host_name=self.host_name, - settings=self.data["project_settings"] + settings=self.data["project_settings"], ) - config_data = get_imageio_config( - project_name=self.data["project_name"], - host_name=self.host_name, - project_settings=self.data["project_settings"], - anatomy_data=template_data, + config_data = get_imageio_config_preset( + self.data["project_name"], + self.data["folder_path"], + self.data["task_name"], + self.host_name, anatomy=self.data["anatomy"], + project_settings=self.data["project_settings"], + template_data=template_data, env=self.launch_context.env, + folder_id=folder_entity["id"], ) - if config_data: - ocio_path = config_data["path"] - - if self.host_name in ["nuke", "hiero"]: - ocio_path = ocio_path.replace("\\", "/") - - self.log.info( - f"Setting OCIO environment to config path: {ocio_path}") - - self.launch_context.env["OCIO"] = ocio_path - else: + if not config_data: self.log.debug("OCIO not set or enabled") + return + + ocio_path = config_data["path"] + + if self.host_name in ["nuke", "hiero"]: + ocio_path = ocio_path.replace("\\", "/") + + self.log.info( + f"Setting OCIO environment to config path: {ocio_path}") + + self.launch_context.env["OCIO"] = ocio_path From 5a43242bda200a79454fbef579e00156c29fd144 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 16:56:43 +0200 Subject: [PATCH 101/269] use 'get_current_context_imageio_config_preset' in nuke --- client/ayon_core/hosts/nuke/api/lib.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index e3505a16f2..0a4755c166 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -43,7 +43,9 @@ from ayon_core.pipeline import ( from ayon_core.pipeline.context_tools import ( get_current_context_custom_workfile_template ) -from ayon_core.pipeline.colorspace import get_imageio_config +from ayon_core.pipeline.colorspace import ( + get_current_context_imageio_config_preset +) from ayon_core.pipeline.workfile import BuildWorkfile from . import gizmo_menu from .constants import ASSIST @@ -1552,10 +1554,7 @@ class WorkfileSettings(object): imageio_host (dict): host colorspace configurations ''' - config_data = get_imageio_config( - project_name=get_current_project_name(), - host_name="nuke" - ) + config_data = get_current_context_imageio_config_preset() workfile_settings = imageio_host["workfile"] color_management = workfile_settings["color_management"] From 1568d40c98c07919dc90fdffc85f1c9a39af59c8 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 16:57:03 +0200 Subject: [PATCH 102/269] temp json fole wrapper is safe --- client/ayon_core/pipeline/colorspace.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index e0fa613ae8..e985bdfcf5 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -87,28 +87,25 @@ def deprecated(new_destination): def _make_temp_json_file(): """Wrapping function for json temp file """ + temporary_json_file = None try: # Store dumped json to temporary file - temporary_json_file = tempfile.NamedTemporaryFile( + with tempfile.NamedTemporaryFile( mode="w", suffix=".json", delete=False - ) - temporary_json_file.close() - temporary_json_filepath = temporary_json_file.name.replace( - "\\", "/" - ) + ) as tmpfile: + temporary_json_filepath = tmpfile.name.replace("\\", "/") yield temporary_json_filepath - except IOError as _error: + except IOError as exc: raise IOError( - "Unable to create temp json file: {}".format( - _error - ) + "Unable to create temp json file: {}".format(exc) ) finally: # Remove the temporary json - os.remove(temporary_json_filepath) + if temporary_json_file is not None: + os.remove(temporary_json_filepath) def get_ocio_config_script_path(): From c0d5e77177463ca075ee1fed2e9c61416dd6196d Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 16:57:27 +0200 Subject: [PATCH 103/269] simplified 'get_ocio_config_script_path' --- client/ayon_core/pipeline/colorspace.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index e985bdfcf5..cbd63c851f 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -113,13 +113,12 @@ def get_ocio_config_script_path(): Returns: str: path string + """ - return os.path.normpath( - os.path.join( - AYON_CORE_ROOT, - "scripts", - "ocio_wrapper.py" - ) + return os.path.join( + os.path.normpath(AYON_CORE_ROOT), + "scripts", + "ocio_wrapper.py" ) From 0c84c32e15ce1732139afaef5533c8f16e8f0c78 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 18:00:09 +0200 Subject: [PATCH 104/269] pass config data to 'get_imageio_file_rules_colorspace_from_filepath' in nuke loader --- client/ayon_core/hosts/nuke/plugins/load/load_clip.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_clip.py b/client/ayon_core/hosts/nuke/plugins/load/load_clip.py index df8f2ab018..1f707c25cf 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_clip.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_clip.py @@ -9,7 +9,8 @@ from ayon_core.pipeline import ( get_representation_path, ) from ayon_core.pipeline.colorspace import ( - get_imageio_file_rules_colorspace_from_filepath + get_imageio_file_rules_colorspace_from_filepath, + get_current_context_imageio_config_preset, ) from ayon_core.hosts.nuke.api.lib import ( get_imageio_input_colorspace, @@ -547,9 +548,10 @@ class LoadClip(plugin.NukeLoader): f"Colorspace from representation colorspaceData: {colorspace}" ) + config_data = get_current_context_imageio_config_preset() # check if any filerules are not applicable new_parsed_colorspace = get_imageio_file_rules_colorspace_from_filepath( # noqa - filepath, "nuke", project_name + filepath, "nuke", project_name, config_data=config_data ) self.log.debug(f"Colorspace new filerules: {new_parsed_colorspace}") From 5599d773c7f49f4ecee35a6cca1a0c1186b92a2e Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 18:02:21 +0200 Subject: [PATCH 105/269] use 'get_imageio_file_rules_colorspace_from_filepath' instead of 'get_imageio_colorspace_from_filepath' --- client/ayon_core/pipeline/colorspace.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index cbd63c851f..7b0d4c8491 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1328,12 +1328,15 @@ def set_colorspace_data_to_representation( filename = filename[0] # get matching colorspace from rules - colorspace = colorspace or get_imageio_colorspace_from_filepath( - filename, host_name, project_name, - config_data=config_data, - file_rules=file_rules, - project_settings=project_settings - ) + if colorspace is None: + colorspace = get_imageio_file_rules_colorspace_from_filepath( + filename, + host_name, + project_name, + config_data=config_data, + file_rules=file_rules, + project_settings=project_settings + ) # infuse data to representation if colorspace: From bf8b2fb3fafd6d9ee8cd7a868b7b44f26514147a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 18:02:41 +0200 Subject: [PATCH 106/269] 'get_display_view_colorspace_subprocess' is private --- client/ayon_core/pipeline/colorspace.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 7b0d4c8491..4034527282 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1364,15 +1364,16 @@ def get_display_view_colorspace_name(config_path, display, view): if not compatibility_check(): # python environment is not compatible with PyOpenColorIO # needs to be run in subprocess - return get_display_view_colorspace_subprocess(config_path, - display, view) + return _get_display_view_colorspace_subprocess( + config_path, display, view + ) from ayon_core.scripts.ocio_wrapper import _get_display_view_colorspace_name # noqa return _get_display_view_colorspace_name(config_path, display, view) -def get_display_view_colorspace_subprocess(config_path, display, view): +def _get_display_view_colorspace_subprocess(config_path, display, view): """Returns the colorspace attribute of the (display, view) pair via subprocess. From 322e36128a8ed2497fa862e1ad150f834ecd73be Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 18:04:12 +0200 Subject: [PATCH 107/269] space sufficient cache logic --- client/ayon_core/pipeline/colorspace.py | 29 +++++++++++-------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 4034527282..77c830d44a 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -509,16 +509,15 @@ def get_ocio_config_colorspaces(config_path): if not compatibility_check(): # python environment is not compatible with PyOpenColorIO # needs to be run in subprocess - CachedData.ocio_config_colorspaces[config_path] = \ - _get_wrapped_with_subprocess( - "config", "get_colorspace", in_path=config_path + config_colorspaces = _get_wrapped_with_subprocess( + "config", "get_colorspace", in_path=config_path ) else: # TODO: refactor this so it is not imported but part of this file from ayon_core.scripts.ocio_wrapper import _get_colorspace_data - CachedData.ocio_config_colorspaces[config_path] = \ - _get_colorspace_data(config_path) + config_colorspaces = _get_colorspace_data(config_path) + CachedData.ocio_config_colorspaces[config_path] = config_colorspaces return CachedData.ocio_config_colorspaces[config_path] @@ -1160,16 +1159,15 @@ def get_remapped_colorspace_to_native( Union[str, None]: native colorspace name defined in remapping or None """ - CachedData.remapping.setdefault(host_name, {}) - if CachedData.remapping[host_name].get("to_native") is None: + host_mapping = CachedData.remapping.setdefault(host_name, {}) + if "to_native" not in host_mapping: remapping_rules = imageio_host_settings["remapping"]["rules"] - CachedData.remapping[host_name]["to_native"] = { + host_mapping["to_native"] = { rule["ocio_name"]: rule["host_native_name"] for rule in remapping_rules } - return CachedData.remapping[host_name]["to_native"].get( - ocio_colorspace_name) + return host_mapping["to_native"].get(ocio_colorspace_name) def get_remapped_colorspace_from_native( @@ -1184,18 +1182,17 @@ def get_remapped_colorspace_from_native( Returns: Union[str, None]: Ocio colorspace name defined in remapping or None. - """ - CachedData.remapping.setdefault(host_name, {}) - if CachedData.remapping[host_name].get("from_native") is None: + """ + host_mapping = CachedData.remapping.setdefault(host_name, {}) + if "from_native" not in host_mapping: remapping_rules = imageio_host_settings["remapping"]["rules"] - CachedData.remapping[host_name]["from_native"] = { + host_mapping["from_native"] = { rule["host_native_name"]: rule["ocio_name"] for rule in remapping_rules } - return CachedData.remapping[host_name]["from_native"].get( - host_native_colorspace_name) + return host_mapping["from_native"].get(host_native_colorspace_name) def _get_imageio_settings(project_settings, host_name): From b679b06919bfbde31790f920d6fb95555849f675 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 18:04:42 +0200 Subject: [PATCH 108/269] formatting changes --- client/ayon_core/pipeline/colorspace.py | 48 +++++++++++++------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 77c830d44a..ed590758a3 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -334,10 +334,10 @@ def parse_colorspace_from_filepath( pattern = "|".join( # Allow to match spaces also as underscores because the # integrator replaces spaces with underscores in filenames - re.escape(colorspace) for colorspace in + re.escape(colorspace) # Sort by longest first so the regex matches longer matches # over smaller matches, e.g. matching 'Output - sRGB' over 'sRGB' - sorted(colorspaces, key=len, reverse=True) + for colorspace in sorted(colorspaces, key=len, reverse=True) ) return re.compile(pattern) @@ -529,11 +529,12 @@ def convert_colorspace_enumerator_item( """Convert colorspace enumerator item to dictionary Args: - colorspace_item (str): colorspace and family in couple - config_items (dict[str,dict]): colorspace data + colorspace_enum_item (str): Colorspace and family in couple. + config_items (dict[str,dict]): Colorspace data. Returns: dict: colorspace data + """ if "::" not in colorspace_enum_item: return None @@ -1103,13 +1104,13 @@ def get_imageio_file_rules(project_name, host_name, project_settings=None): """Get ImageIO File rules from project settings Args: - project_name (str): project name - host_name (str): host name - project_settings (dict, optional): project settings. - Defaults to None. + project_name (str): Project name. + host_name (str): Host name. + project_settings (Optional[dict]): Project settings. Returns: list[dict[str, Any]]: file rules data + """ project_settings = project_settings or get_project_settings(project_name) @@ -1151,7 +1152,7 @@ def get_remapped_colorspace_to_native( """Return native colorspace name. Args: - ocio_colorspace_name (str | None): ocio colorspace name + ocio_colorspace_name (str | None): OCIO colorspace name. host_name (str): Host name. imageio_host_settings (dict[str, Any]): ImageIO host settings. @@ -1199,12 +1200,12 @@ def _get_imageio_settings(project_settings, host_name): """Get ImageIO settings for global and host Args: - project_settings (dict): project settings. - Defaults to None. - host_name (str): host name + project_settings (dict[str, Any]): Project settings. + host_name (str): Host name. Returns: - tuple[dict, dict]: image io settings for global and host + tuple[dict, dict]: Image io settings for global and host. + """ # get image io from global and host_name imageio_global = project_settings["core"]["imageio"] @@ -1266,18 +1267,13 @@ def get_colorspace_settings_from_publish_context(context_data): def set_colorspace_data_to_representation( - representation, context_data, + representation, + context_data, colorspace=None, log=None ): """Sets colorspace data to representation. - Args: - representation (dict): publishing representation - context_data (publish.Context.data): publishing context data - colorspace (str, optional): colorspace name. Defaults to None. - log (logging.Logger, optional): logger instance. Defaults to None. - Example: ``` { @@ -1292,6 +1288,12 @@ def set_colorspace_data_to_representation( } ``` + Args: + representation (dict): publishing representation + context_data (publish.Context.data): publishing context data + colorspace (Optional[str]): Colorspace name. + log (Optional[logging.Logger]): logger instance. + """ log = log or Logger.get_logger(__name__) @@ -1355,9 +1357,9 @@ def get_display_view_colorspace_name(config_path, display, view): view (str): view name e.g. "sRGB" Returns: - view color space name (str) e.g. "Output - sRGB" - """ + str: View color space name. e.g. "Output - sRGB" + """ if not compatibility_check(): # python environment is not compatible with PyOpenColorIO # needs to be run in subprocess @@ -1381,8 +1383,8 @@ def _get_display_view_colorspace_subprocess(config_path, display, view): Returns: view color space name (str) e.g. "Output - sRGB" - """ + """ with _make_temp_json_file() as tmp_json_path: # Prepare subprocess arguments args = [ From ff05fafb77e5901e34e2dbcb070435f5fc72cd96 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 6 May 2024 18:04:52 +0200 Subject: [PATCH 109/269] mark 'get_imageio_config' as deprecated --- client/ayon_core/pipeline/colorspace.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index ed590758a3..e9da194984 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -735,6 +735,7 @@ def get_views_data_subprocess(config_path): ) +@deprecated("get_imageio_config_preset") def get_imageio_config( project_name, host_name, From 8a971f393c3a2d2f9cecb6afbd910d8f17a76d25 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 7 May 2024 09:25:31 +0100 Subject: [PATCH 110/269] 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 111/269] 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 112/269] 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 113/269] 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 114/269] 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 115/269] 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 116/269] 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 117/269] 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 118/269] 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 2facf91bcb4a5ea5812dc93b3b2c026978a7a7f3 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 7 May 2024 13:51:36 +0200 Subject: [PATCH 119/269] AY-4801-Added conversion of resources Added similar configuration as for ExtractReview to control possible conversion from .mov to target format (.mp4) --- .../plugins/publish/extract_editorial_pckg.py | 151 ++++++++++++++++-- .../server/settings/publish_plugins.py | 89 ++++++++++- 2 files changed, 230 insertions(+), 10 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py index dc8163e1ff..02f953d579 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py @@ -1,16 +1,20 @@ +import copy import os.path +import subprocess + import opentimelineio import pyblish.api +from ayon_core.lib import filter_profiles, get_ffmpeg_tool_args, run_subprocess from ayon_core.pipeline import publish -class ExtractEditorialPackage(publish.Extractor): +class ExtractEditorialPckgConversion(publish.Extractor): """Replaces movie paths in otio file with publish rootless - Prepares movie resources for integration. - TODO introduce conversion to .mp4 + Prepares movie resources for integration (adds them to `transfers`). + Converts .mov files according to output definition. """ label = "Extract Editorial Package" @@ -35,13 +39,22 @@ class ExtractEditorialPackage(publish.Extractor): instance.data["representations"].append(editorial_pckg_repre) - publish_path = self._get_published_path(instance) - publish_folder = os.path.dirname(publish_path) - publish_resource_folder = os.path.join(publish_folder, "resources") - + publish_resource_folder = self._get_publish_resource_folder(instance) resource_paths = editorial_pckg_data["resource_paths"] transfers = self._get_transfers(resource_paths, publish_resource_folder) + + project_settings = instance.context.data["project_settings"] + profiles = (project_settings["traypublisher"] + ["publish"] + ["ExtractEditorialPckgConversion"] + .get("profiles")) + output_def = None + if profiles: + output_def = self._get_output_definition(instance, profiles) + if output_def: + transfers = self._convert_resources(output_def, transfers) + if not "transfers" in instance.data: instance.data["transfers"] = [] instance.data["transfers"] = transfers @@ -57,6 +70,36 @@ class ExtractEditorialPackage(publish.Extractor): self.log.info("Added Editorial Package representation: {}".format( editorial_pckg_repre)) + def _get_publish_resource_folder(self, instance): + """Calculates publish folder and create it.""" + publish_path = self._get_published_path(instance) + publish_folder = os.path.dirname(publish_path) + publish_resource_folder = os.path.join(publish_folder, "resources") + + if not os.path.exists(publish_resource_folder): + os.makedirs(publish_resource_folder, exist_ok=True) + return publish_resource_folder + + def _get_output_definition(self, instance, profiles): + """Return appropriate profile by context information.""" + product_type = instance.data["productType"] + product_name = instance.data["productName"] + task_entity = instance.data["taskEntity"] or {} + task_name = task_entity.get("name") + task_type = task_entity.get("taskType") + filtering_criteria = { + "product_types": product_type, + "product_names": product_name, + "task_names": task_name, + "task_types": task_type, + } + profile = filter_profiles( + profiles, + filtering_criteria, + logger=self.log + ) + return profile + def _get_resource_path_mapping(self, instance, transfers): """Returns dict of {source_mov_path: rootless_published_path}.""" replace_paths = {} @@ -68,7 +111,7 @@ class ExtractEditorialPackage(publish.Extractor): return replace_paths def _get_transfers(self, resource_paths, publish_resource_folder): - """Returns list of tuples (source, destination) movie paths.""" + """Returns list of tuples (source, destination) with movie paths.""" transfers = [] for res_path in resource_paths: res_basename = os.path.basename(res_path) @@ -77,7 +120,7 @@ class ExtractEditorialPackage(publish.Extractor): return transfers def _replace_target_urls(self, otio_data, replace_paths): - """Replace original movie paths with published rootles ones.""" + """Replace original movie paths with published rootless ones.""" for track in otio_data.tracks: for clip in track: # Check if the clip has a media reference @@ -120,3 +163,93 @@ class ExtractEditorialPackage(publish.Extractor): template = anatomy.get_template_item("publish", "default", "path") template_filled = template.format_strict(template_data) return os.path.normpath(template_filled) + + def _convert_resources(self, output_def, transfers): + """Converts all resource files to configured format.""" + outputs = output_def["outputs"] + if not outputs: + self.log.warning("No output configured in " + "ayon+settings://traypublisher/publish/ExtractEditorialPckgConversion/profiles/0/outputs") # noqa + return transfers + + final_transfers = [] + # most likely only single output is expected + for output in outputs: + out_extension = output["ext"] + out_def_ffmpeg_args = output["ffmpeg_args"] + ffmpeg_input_args = [ + value.strip() + for value in out_def_ffmpeg_args["input"] + if value.strip() + ] + ffmpeg_video_filters = [ + value.strip() + for value in out_def_ffmpeg_args["video_filters"] + if value.strip() + ] + ffmpeg_audio_filters = [ + value.strip() + for value in out_def_ffmpeg_args["audio_filters"] + if value.strip() + ] + ffmpeg_output_args = [ + value.strip() + for value in out_def_ffmpeg_args["output"] + if value.strip() + ] + ffmpeg_input_args = self._split_ffmpeg_args(ffmpeg_input_args) + + generic_args = [ + subprocess.list2cmdline(get_ffmpeg_tool_args("ffmpeg")) + ] + generic_args.extend(ffmpeg_input_args) + if ffmpeg_video_filters: + generic_args.append("-filter:v") + generic_args.append( + "\"{}\"".format(",".join(ffmpeg_video_filters))) + + if ffmpeg_audio_filters: + generic_args.append("-filter:a") + generic_args.append( + "\"{}\"".format(",".join(ffmpeg_audio_filters))) + + for source, destination in transfers: + base_name = os.path.basename(destination) + file_name, ext = os.path.splitext(base_name) + dest_path = os.path.join(os.path.dirname(destination), + f"{file_name}.{out_extension}") + final_transfers.append((source, dest_path)) + + all_args = copy.deepcopy(generic_args) + all_args.append(f"-i {source}") + all_args.extend(ffmpeg_output_args) # order matters + all_args.append(f"{dest_path}") + subprcs_cmd = " ".join(all_args) + + # run subprocess + self.log.debug("Executing: {}".format(subprcs_cmd)) + run_subprocess(subprcs_cmd, shell=True, logger=self.log) + return final_transfers + + def _split_ffmpeg_args(self, in_args): + """Makes sure all entered arguments are separated in individual items. + + Split each argument string with " -" to identify if string contains + one or more arguments. + """ + splitted_args = [] + for arg in in_args: + sub_args = arg.split(" -") + if len(sub_args) == 1: + if arg and arg not in splitted_args: + splitted_args.append(arg) + continue + + for idx, arg in enumerate(sub_args): + if idx != 0: + arg = "-" + arg + + if arg and arg not in splitted_args: + splitted_args.append(arg) + return splitted_args + diff --git a/server_addon/traypublisher/server/settings/publish_plugins.py b/server_addon/traypublisher/server/settings/publish_plugins.py index f413c86227..9869f54620 100644 --- a/server_addon/traypublisher/server/settings/publish_plugins.py +++ b/server_addon/traypublisher/server/settings/publish_plugins.py @@ -1,4 +1,11 @@ -from ayon_server.settings import BaseSettingsModel, SettingsField +from pydantic import validator + +from ayon_server.settings import ( + BaseSettingsModel, + SettingsField, + task_types_enum, + ensure_unique_names +) class ValidatePluginModel(BaseSettingsModel): @@ -14,6 +21,74 @@ class ValidateFrameRangeModel(ValidatePluginModel): 'my_asset_to_publish.mov')""" +class ExtractEditorialPckgFFmpegModel(BaseSettingsModel): + video_filters: list[str] = SettingsField( + default_factory=list, + title="Video filters" + ) + audio_filters: list[str] = SettingsField( + default_factory=list, + title="Audio filters" + ) + input: list[str] = SettingsField( + default_factory=list, + title="Input arguments" + ) + output: list[str] = SettingsField( + default_factory=list, + title="Output arguments" + ) + + +class ExtractEditorialPckgOutputDefModel(BaseSettingsModel): + """Set extension and ffmpeg arguments. See `ExtractReview` for example.""" + _layout = "expanded" + name: str = SettingsField("", title="Name") + ext: str = SettingsField("", title="Output extension") + + ffmpeg_args: ExtractEditorialPckgFFmpegModel = SettingsField( + default_factory=ExtractEditorialPckgFFmpegModel, + title="FFmpeg arguments" + ) + + +class ExtractEditorialPckgProfileModel(BaseSettingsModel): + product_types: list[str] = SettingsField( + default_factory=list, + title="Product types" + ) + task_types: list[str] = SettingsField( + default_factory=list, + title="Task types", + enum_resolver=task_types_enum + ) + task_names: list[str] = SettingsField( + default_factory=list, + title="Task names" + ) + product_names: list[str] = SettingsField( + default_factory=list, + title="Product names" + ) + outputs: list[ExtractEditorialPckgOutputDefModel] = SettingsField( + default_factory=list, + title="Output Definitions", + ) + + @validator("outputs") + def validate_unique_outputs(cls, value): + ensure_unique_names(value) + return value + + +class ExtractEditorialPckgConversionModel(BaseSettingsModel): + """Conversion of input movie files into expected format.""" + enabled: bool = SettingsField(True) + profiles: list[ExtractEditorialPckgProfileModel] = SettingsField( + default_factory=list, title="Profiles" + ) + + class TrayPublisherPublishPlugins(BaseSettingsModel): CollectFrameDataFromAssetEntity: ValidatePluginModel = SettingsField( default_factory=ValidatePluginModel, @@ -28,6 +103,13 @@ class TrayPublisherPublishPlugins(BaseSettingsModel): default_factory=ValidatePluginModel, ) + ExtractEditorialPckgConversion: ExtractEditorialPckgConversionModel = ( + SettingsField( + default_factory=ExtractEditorialPckgConversionModel, + title="Extract Editorial Package Conversion" + ) + ) + DEFAULT_PUBLISH_PLUGINS = { "CollectFrameDataFromAssetEntity": { @@ -44,5 +126,10 @@ DEFAULT_PUBLISH_PLUGINS = { "enabled": True, "optional": True, "active": True + }, + "ExtractEditorialPckgConversion": { + "enabled": True, + "optional": True, + "active": True } } From c3910256b117487bff677ff81ef7b4c2c67a07a1 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 7 May 2024 14:40:45 +0200 Subject: [PATCH 120/269] fix circular import --- client/ayon_core/pipeline/colorspace.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index e9da194984..705d1570b0 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -23,7 +23,6 @@ from ayon_core.pipeline.template_data import get_template_data from ayon_core.pipeline.load import get_representation_path_with_anatomy from ayon_core.lib.transcoding import VIDEO_EXTENSIONS, IMAGE_EXTENSIONS -from .context_tools import get_current_context, get_current_host_name log = Logger.get_logger(__name__) @@ -765,8 +764,7 @@ def get_imageio_config( """ if not anatomy_data: - from ayon_core.pipeline.context_tools import ( - get_current_context_template_data) + from .context_tools import get_current_context_template_data anatomy_data = get_current_context_template_data() task_name = anatomy_data.get("task", {}).get("name") @@ -1425,6 +1423,8 @@ def get_current_context_imageio_config_preset( dict: ImageIO config preset. """ + from .context_tools import get_current_context, get_current_host_name + context = get_current_context() host_name = get_current_host_name() return get_imageio_config_preset( From 393897f2a9b2f4af3533ba2f6f00716d2de151d2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 7 May 2024 18:08:55 +0200 Subject: [PATCH 121/269] don't change controller project on close --- client/ayon_core/tools/loader/ui/window.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/ayon_core/tools/loader/ui/window.py b/client/ayon_core/tools/loader/ui/window.py index 3a6f4679fa..8529a53b06 100644 --- a/client/ayon_core/tools/loader/ui/window.py +++ b/client/ayon_core/tools/loader/ui/window.py @@ -335,9 +335,7 @@ class LoaderWindow(QtWidgets.QWidget): def closeEvent(self, event): super(LoaderWindow, self).closeEvent(event) - # Deselect project so current context will be selected - # on next 'showEvent' - self._controller.set_selected_project(None) + self._reset_on_show = True def keyPressEvent(self, event): From 4d502a55481adbfdbd5fe06aeefe2f7ad14d381e Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 8 May 2024 21:42:04 +0800 Subject: [PATCH 122/269] add reset max file and clear undo buffer in the callback of starting new scene --- client/ayon_core/hosts/max/api/lib.py | 3 --- client/ayon_core/hosts/max/api/pipeline.py | 11 +++++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/hosts/max/api/lib.py b/client/ayon_core/hosts/max/api/lib.py index d9a3af3336..0e3abe25ec 100644 --- a/client/ayon_core/hosts/max/api/lib.py +++ b/client/ayon_core/hosts/max/api/lib.py @@ -6,12 +6,9 @@ import json from typing import Any, Dict, Union import six -import ayon_api from ayon_core.pipeline import ( get_current_project_name, - get_current_folder_path, - get_current_task_name, colorspace ) from ayon_core.settings import get_project_settings diff --git a/client/ayon_core/hosts/max/api/pipeline.py b/client/ayon_core/hosts/max/api/pipeline.py index dc13f47795..c6298bf590 100644 --- a/client/ayon_core/hosts/max/api/pipeline.py +++ b/client/ayon_core/hosts/max/api/pipeline.py @@ -52,11 +52,8 @@ class MaxHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost): self._has_been_setup = True - def context_setting(): - return lib.set_context_setting() - rt.callbacks.addScript(rt.Name('systemPostNew'), - context_setting) + on_post_open) rt.callbacks.addScript(rt.Name('filePostOpen'), lib.check_colorspace) @@ -163,6 +160,12 @@ def ls() -> list: yield lib.read(container) +def on_post_open(): + lib.set_context_setting() + rt.resetMaxFile(rt.Name("noPrompt")) + rt.clearUndoBuffer() + + def containerise(name: str, nodes: list, context, namespace=None, loader=None, suffix="_CON"): data = { From 7dadac74ac23db64d89512e792e7725d403a84f7 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 8 May 2024 21:50:43 +0800 Subject: [PATCH 123/269] restore unncessary change --- client/ayon_core/hosts/max/api/lib.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/ayon_core/hosts/max/api/lib.py b/client/ayon_core/hosts/max/api/lib.py index 0e3abe25ec..d9a3af3336 100644 --- a/client/ayon_core/hosts/max/api/lib.py +++ b/client/ayon_core/hosts/max/api/lib.py @@ -6,9 +6,12 @@ import json from typing import Any, Dict, Union import six +import ayon_api from ayon_core.pipeline import ( get_current_project_name, + get_current_folder_path, + get_current_task_name, colorspace ) from ayon_core.settings import get_project_settings From d25e8f508eeef612f99cca12976774fd3e401c5f Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 8 May 2024 22:21:07 +0800 Subject: [PATCH 124/269] use on_new as name of the function --- client/ayon_core/hosts/max/api/pipeline.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/max/api/pipeline.py b/client/ayon_core/hosts/max/api/pipeline.py index c6298bf590..776565bade 100644 --- a/client/ayon_core/hosts/max/api/pipeline.py +++ b/client/ayon_core/hosts/max/api/pipeline.py @@ -52,8 +52,7 @@ class MaxHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost): self._has_been_setup = True - rt.callbacks.addScript(rt.Name('systemPostNew'), - on_post_open) + rt.callbacks.addScript(rt.Name('systemPostNew'), on_new) rt.callbacks.addScript(rt.Name('filePostOpen'), lib.check_colorspace) @@ -160,7 +159,7 @@ def ls() -> list: yield lib.read(container) -def on_post_open(): +def on_new(): lib.set_context_setting() rt.resetMaxFile(rt.Name("noPrompt")) rt.clearUndoBuffer() From 36cbdcfde77580e86a512b292603a5f810c8f77d Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 8 May 2024 22:56:26 +0800 Subject: [PATCH 125/269] only reset max file and clear undo buffer when there is unsaved change before starting new scene --- client/ayon_core/hosts/max/api/pipeline.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/max/api/pipeline.py b/client/ayon_core/hosts/max/api/pipeline.py index 776565bade..4782159ef8 100644 --- a/client/ayon_core/hosts/max/api/pipeline.py +++ b/client/ayon_core/hosts/max/api/pipeline.py @@ -161,8 +161,9 @@ def ls() -> list: def on_new(): lib.set_context_setting() - rt.resetMaxFile(rt.Name("noPrompt")) - rt.clearUndoBuffer() + if rt.checkForSave(): + rt.resetMaxFile(rt.Name("noPrompt")) + rt.clearUndoBuffer() def containerise(name: str, nodes: list, context, From 46ed96cad8ac8fc34804bf52232fa302e1c39071 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 8 May 2024 23:10:44 +0800 Subject: [PATCH 126/269] add redraw views for new scene --- client/ayon_core/hosts/max/api/pipeline.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/hosts/max/api/pipeline.py b/client/ayon_core/hosts/max/api/pipeline.py index 4782159ef8..d9cfc3407f 100644 --- a/client/ayon_core/hosts/max/api/pipeline.py +++ b/client/ayon_core/hosts/max/api/pipeline.py @@ -164,6 +164,7 @@ def on_new(): if rt.checkForSave(): rt.resetMaxFile(rt.Name("noPrompt")) rt.clearUndoBuffer() + rt.redrawViews() def containerise(name: str, nodes: list, context, From 8b9a45e7152bb5c83d3eafaa11c466742ea1df2b Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 9 May 2024 15:20:56 +0800 Subject: [PATCH 127/269] color channel from baking write node should be aligning with that from the write node created from creator --- client/ayon_core/hosts/nuke/api/plugin.py | 3 +++ .../ayon_core/hosts/nuke/plugins/publish/collect_writes.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/nuke/api/plugin.py b/client/ayon_core/hosts/nuke/api/plugin.py index fb56dec833..02f41ff865 100644 --- a/client/ayon_core/hosts/nuke/api/plugin.py +++ b/client/ayon_core/hosts/nuke/api/plugin.py @@ -778,6 +778,7 @@ class ExporterReviewMov(ExporterReview): # deal with now lut defined in viewer lut self.viewer_lut_raw = klass.viewer_lut_raw self.write_colorspace = instance.data["colorspace"] + self.color_channels = instance.data["color_channels"] self.name = name or "baked" self.ext = ext or "mov" @@ -947,6 +948,8 @@ class ExporterReviewMov(ExporterReview): self.log.debug("Path: {}".format(self.path)) write_node["file"].setValue(str(self.path)) write_node["file_type"].setValue(str(self.ext)) + write_node["channels"].setValue(str(self.color_channels)) + # Knobs `meta_codec` and `mov64_codec` are not available on centos. # TODO shouldn't this come from settings on outputs? try: diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_writes.py b/client/ayon_core/hosts/nuke/plugins/publish/collect_writes.py index 745351dc49..27525bcad1 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_writes.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/collect_writes.py @@ -153,6 +153,9 @@ class CollectNukeWrites(pyblish.api.InstancePlugin, # Determine defined file type ext = write_node["file_type"].value() + # determine defined channel type + color_channels = write_node["channels"].value() + # get frame range data handle_start = instance.context.data["handleStart"] handle_end = instance.context.data["handleEnd"] @@ -172,7 +175,8 @@ class CollectNukeWrites(pyblish.api.InstancePlugin, "path": write_file_path, "outputDir": output_dir, "ext": ext, - "colorspace": colorspace + "colorspace": colorspace, + "color_channels": color_channels }) if product_type == "render": From a19350eea9925cb5c8ba6b3af08bbef8bf953fe5 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 12:10:50 +0200 Subject: [PATCH 128/269] implemented helper function to determine if current process is ayon launcher --- client/ayon_core/lib/__init__.py | 2 ++ client/ayon_core/lib/ayon_info.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/client/ayon_core/lib/__init__.py b/client/ayon_core/lib/__init__.py index e436396c6c..e25d3479ee 100644 --- a/client/ayon_core/lib/__init__.py +++ b/client/ayon_core/lib/__init__.py @@ -139,6 +139,7 @@ from .path_tools import ( ) from .ayon_info import ( + is_in_ayon_launcher_process, is_running_from_build, is_using_ayon_console, is_staging_enabled, @@ -248,6 +249,7 @@ __all__ = [ "Logger", + "is_in_ayon_launcher_process", "is_running_from_build", "is_using_ayon_console", "is_staging_enabled", diff --git a/client/ayon_core/lib/ayon_info.py b/client/ayon_core/lib/ayon_info.py index fc09a7c90c..c4333fab95 100644 --- a/client/ayon_core/lib/ayon_info.py +++ b/client/ayon_core/lib/ayon_info.py @@ -1,4 +1,5 @@ import os +import sys import json import datetime import platform @@ -25,6 +26,18 @@ def get_ayon_launcher_version(): return content["__version__"] +def is_in_ayon_launcher_process(): + """Determine if current process is running from AYON launcher. + + Returns: + bool: True if running from AYON launcher. + + """ + ayon_executable_path = os.path.normpath(os.environ["AYON_EXECUTABLE"]) + executable_path = os.path.normpath(sys.executable) + return ayon_executable_path == executable_path + + def is_running_from_build(): """Determine if current process is running from build or code. From fa4569402395e88543796db5903157ea917a9cd5 Mon Sep 17 00:00:00 2001 From: Simone Barbieri Date: Thu, 9 May 2024 12:04:27 +0100 Subject: [PATCH 129/269] Use transform cache to handle camera updates --- .../blender/plugins/load/load_camera_abc.py | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/blender/plugins/load/load_camera_abc.py b/client/ayon_core/hosts/blender/plugins/load/load_camera_abc.py index 6178578081..a49bb40d9a 100644 --- a/client/ayon_core/hosts/blender/plugins/load/load_camera_abc.py +++ b/client/ayon_core/hosts/blender/plugins/load/load_camera_abc.py @@ -43,7 +43,10 @@ class AbcCameraLoader(plugin.AssetLoader): def _process(self, libpath, asset_group, group_name): plugin.deselect_all() - bpy.ops.wm.alembic_import(filepath=libpath) + # Force the creation of the transform cache even if the camera + # doesn't have an animation. We use the cache to update the camera. + bpy.ops.wm.alembic_import( + filepath=libpath, always_add_cache_reader=True) objects = lib.get_selection() @@ -178,12 +181,33 @@ class AbcCameraLoader(plugin.AssetLoader): self.log.info("Library already loaded, not updating...") return - mat = asset_group.matrix_basis.copy() + for obj in asset_group.children: + found = False + for constraint in obj.constraints: + if constraint.type == "TRANSFORM_CACHE": + constraint.cache_file.filepath = libpath.as_posix() + found = True + break + if not found: + # This is to keep compatibility with cameras loaded with + # the old loader + # Create a new constraint for the cache file + constraint = obj.constraints.new("TRANSFORM_CACHE") + bpy.ops.cachefile.open(filepath=libpath.as_posix()) + constraint.cache_file = bpy.data.cache_files[-1] + constraint.cache_file.scale = 1.0 - self._remove(asset_group) - self._process(str(libpath), asset_group, object_name) + # This is a workaround to set the object path. Blender doesn't + # load the list of object paths until the object is evaluated. + # This is a hack to force the object to be evaluated. + # The modifier doesn't need to be removed because camera + # objects don't have modifiers. + obj.modifiers.new( + name='MeshSequenceCache', type='MESH_SEQUENCE_CACHE') + bpy.context.evaluated_depsgraph_get() - asset_group.matrix_basis = mat + constraint.object_path = ( + constraint.cache_file.object_paths[0].path) metadata["libpath"] = str(libpath) metadata["representation"] = repre_entity["id"] From 475d1db69bc518522b57f270f174799842f6d031 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 9 May 2024 15:05:54 +0300 Subject: [PATCH 130/269] add 'model' product type to 'collect_instnaces_type' --- .../hosts/houdini/plugins/create/create_model.py | 3 --- ...intcache_type.py => collect_instances_type.py} | 15 +++++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) rename client/ayon_core/hosts/houdini/plugins/publish/{collect_pointcache_type.py => collect_instances_type.py} (51%) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_model.py b/client/ayon_core/hosts/houdini/plugins/create/create_model.py index 1f32ccde45..74d067b133 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_model.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_model.py @@ -25,9 +25,6 @@ class CreateModel(plugin.HoudiniCreator): product_type = "model" icon = "cube" - def get_publish_families(self): - return ["model", "abc"] - def create(self, product_name, instance_data, pre_create_data): instance_data.pop("active", None) instance_data.update({"node_type": "alembic"}) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_pointcache_type.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_instances_type.py similarity index 51% rename from client/ayon_core/hosts/houdini/plugins/publish/collect_pointcache_type.py rename to client/ayon_core/hosts/houdini/plugins/publish/collect_instances_type.py index 3323e97c20..07851387fe 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_pointcache_type.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_instances_type.py @@ -1,21 +1,24 @@ -"""Collector for pointcache types. +"""Collector for different types. -This will add additional family to pointcache instance based on +This will add additional families to different instance based on the creator_identifier parameter. """ import pyblish.api class CollectPointcacheType(pyblish.api.InstancePlugin): - """Collect data type for pointcache instance.""" + """Collect data type for different instances.""" order = pyblish.api.CollectorOrder hosts = ["houdini"] - families = ["pointcache"] - label = "Collect type of pointcache" + families = ["pointcache", "model"] + label = "Collect instances types" def process(self, instance): if instance.data["creator_identifier"] == "io.openpype.creators.houdini.bgeo": # noqa: E501 instance.data["families"] += ["bgeo"] - elif instance.data["creator_identifier"] == "io.openpype.creators.houdini.pointcache": # noqa: E501 + elif instance.data["creator_identifier"] in { + "io.openpype.creators.houdini.pointcache", + "io.openpype.creators.houdini.model" + }: instance.data["families"] += ["abc"] From 145268e94fe4da3f449ff4e46ca3a4f1d41a2a69 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 14:58:17 +0200 Subject: [PATCH 131/269] skip the plugin logic if all keys are set --- .../publish/collect_frame_data_from_asset_entity.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py index 4d203649c7..76ecc1cd8b 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py @@ -26,6 +26,13 @@ class CollectFrameDataFromAssetEntity(pyblish.api.InstancePlugin): ): if key not in instance.data: missing_keys.append(key) + + # Skip the logic if all keys are already collected. + # NOTE: In editorial is not 'folderEntity' filled, so it would crash + # even if we don't need it. + if not missing_keys: + return + keys_set = [] folder_attributes = instance.data["folderEntity"]["attrib"] for key in missing_keys: From c9ad59525506674ad68a9ec16e8ef0214a9eb62e Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 15:05:31 +0200 Subject: [PATCH 132/269] formatting changes --- .../collect_frame_data_from_asset_entity.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py index 76ecc1cd8b..2e564a2e4e 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py @@ -10,9 +10,13 @@ class CollectFrameDataFromAssetEntity(pyblish.api.InstancePlugin): order = pyblish.api.CollectorOrder + 0.491 label = "Collect Missing Frame Data From Folder" - families = ["plate", "pointcache", - "vdbcache", "online", - "render"] + families = [ + "plate", + "pointcache", + "vdbcache", + "online", + "render", + ] hosts = ["traypublisher"] def process(self, instance): @@ -22,7 +26,7 @@ class CollectFrameDataFromAssetEntity(pyblish.api.InstancePlugin): "frameStart", "frameEnd", "handleStart", - "handleEnd" + "handleEnd", ): if key not in instance.data: missing_keys.append(key) @@ -39,6 +43,9 @@ class CollectFrameDataFromAssetEntity(pyblish.api.InstancePlugin): if key in folder_attributes: instance.data[key] = folder_attributes[key] keys_set.append(key) + if keys_set: - self.log.debug(f"Frame range data {keys_set} " - "has been collected from folder entity.") + self.log.debug( + f"Frame range data {keys_set} " + "has been collected from folder entity." + ) From f343664a3836fb4dfcc0c753335baa80521ae72c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 15:07:19 +0200 Subject: [PATCH 133/269] rename the file --- ...m_asset_entity.py => collect_frame_data_from_folder_entity.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/ayon_core/hosts/traypublisher/plugins/publish/{collect_frame_data_from_asset_entity.py => collect_frame_data_from_folder_entity.py} (100%) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_asset_entity.py b/client/ayon_core/hosts/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_asset_entity.py rename to client/ayon_core/hosts/traypublisher/plugins/publish/collect_frame_data_from_folder_entity.py From 0bba27e4dd97b28be9d47c5aaa08f526b97c928c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 15:16:52 +0200 Subject: [PATCH 134/269] removed unused imports --- client/ayon_core/hosts/max/api/lib.py | 3 --- .../hosts/maya/plugins/create/create_animation_pointcache.py | 1 - client/ayon_core/hosts/traypublisher/csv_publish.py | 2 -- 3 files changed, 6 deletions(-) diff --git a/client/ayon_core/hosts/max/api/lib.py b/client/ayon_core/hosts/max/api/lib.py index d9a3af3336..0e3abe25ec 100644 --- a/client/ayon_core/hosts/max/api/lib.py +++ b/client/ayon_core/hosts/max/api/lib.py @@ -6,12 +6,9 @@ import json from typing import Any, Dict, Union import six -import ayon_api from ayon_core.pipeline import ( get_current_project_name, - get_current_folder_path, - get_current_task_name, colorspace ) from ayon_core.settings import get_project_settings diff --git a/client/ayon_core/hosts/maya/plugins/create/create_animation_pointcache.py b/client/ayon_core/hosts/maya/plugins/create/create_animation_pointcache.py index 08d50a1ab8..069762e4ae 100644 --- a/client/ayon_core/hosts/maya/plugins/create/create_animation_pointcache.py +++ b/client/ayon_core/hosts/maya/plugins/create/create_animation_pointcache.py @@ -6,7 +6,6 @@ from ayon_core.lib import ( BoolDef, NumberDef, ) -from ayon_core.pipeline import CreatedInstance def _get_animation_attr_defs(cls): diff --git a/client/ayon_core/hosts/traypublisher/csv_publish.py b/client/ayon_core/hosts/traypublisher/csv_publish.py index b43792a357..2762172936 100644 --- a/client/ayon_core/hosts/traypublisher/csv_publish.py +++ b/client/ayon_core/hosts/traypublisher/csv_publish.py @@ -1,5 +1,3 @@ -import os - import pyblish.api import pyblish.util From 270921f63eb9a4032cf0f1d04f1056b71eab0071 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 15:18:10 +0200 Subject: [PATCH 135/269] use preferred order in condition --- .../modules/deadline/plugins/publish/validate_deadline_pools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/validate_deadline_pools.py b/client/ayon_core/modules/deadline/plugins/publish/validate_deadline_pools.py index 5094b3deaf..2fb511bf51 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/validate_deadline_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/validate_deadline_pools.py @@ -72,7 +72,7 @@ class ValidateDeadlinePools(OptionalPyblishPluginMixin, auth=auth, log=self.log) # some DL return "none" as a pool name - if not "none" in pools: + if "none" not in pools: pools.append("none") self.log.info("Available pools: {}".format(pools)) self.pools_per_url[deadline_url] = pools From 2e6ee298a7aa87c869af9d5f18a57173b2933aac Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 15:18:25 +0200 Subject: [PATCH 136/269] removed unnecessary check for 'deadline' key --- .../modules/deadline/plugins/publish/submit_publish_job.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 06dd62e18b..0f505dce78 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -467,8 +467,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, # Inject deadline url to instances to query DL for job id for overrides for inst in instances: - if not "deadline" in inst: - inst["deadline"] = {} inst["deadline"] = instance.data["deadline"] # publish job file From b7662645b5c980c09c599ce4d88ad03a77d0d00f Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 9 May 2024 16:15:30 +0200 Subject: [PATCH 137/269] Refactor indentation for better readability Adjusted the indentation in a function to improve code clarity and readability. --- client/ayon_core/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 705d1570b0..3503d0c534 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -873,7 +873,7 @@ def _get_global_config_data( product_entities_by_name = { product_entity["name"]: product_entity for product_entity in ayon_api.get_products( - project_name, + project_name, folder_ids={folder_id}, product_name_regex=product_name, fields={"id", "name"} From 9b2564cfd7049cbaff6670451c9cd6762023bb7f Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 9 May 2024 16:22:21 +0200 Subject: [PATCH 138/269] fixing settings type name key --- server/settings/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/settings/main.py b/server/settings/main.py index c9c86bdd0d..97bd376f47 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -58,7 +58,7 @@ def _ocio_config_profile_types(): return [ {"value": "builtin_path", "label": "AYON built-in OCIO config"}, {"value": "custom_path", "label": "Path to OCIO config"}, - {"value": "product", "label": "Published product"}, + {"value": "product_name", "label": "Published product"}, ] From f70bdc5795a698e8316b064a57720ddb8585ccb7 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 16:59:50 +0200 Subject: [PATCH 139/269] fix product name in base value --- server/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/__init__.py b/server/__init__.py index f6f89f2049..31a6e8dfca 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -39,7 +39,7 @@ class CoreAddon(BaseServerAddon): ) base_value = { "type": "builtin_path", - "product": "", + "product_name": "", "host_names": [], "task_names": [], "task_types": [], From bcd1e864c0b2507080521141c61adbc70c5b4fc8 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 17:00:04 +0200 Subject: [PATCH 140/269] use correct builtin path --- server/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/__init__.py b/server/__init__.py index 31a6e8dfca..50eda35c89 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -46,10 +46,13 @@ class CoreAddon(BaseServerAddon): "custom_path": "", "builtin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio" } - if first_filepath not in ( + if first_filepath in ( "{BUILTIN_OCIO_ROOT}/aces_1.2/config.oci", "{BUILTIN_OCIO_ROOT}/nuke-default/config.ocio", ): + base_value["type"] = "builtin_path" + base_value["builtin_path"] = first_filepath + else: base_value["type"] = "custom_path" base_value["custom_path"] = first_filepath From 925ff8b86f11e595be591b7458b28694608efb91 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 17:04:09 +0200 Subject: [PATCH 141/269] fix value check --- server/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/__init__.py b/server/__init__.py index 50eda35c89..82473927b6 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -47,7 +47,7 @@ class CoreAddon(BaseServerAddon): "builtin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio" } if first_filepath in ( - "{BUILTIN_OCIO_ROOT}/aces_1.2/config.oci", + "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", "{BUILTIN_OCIO_ROOT}/nuke-default/config.ocio", ): base_value["type"] = "builtin_path" From 9570d92411dcd8efa97a93da61e34141a829f049 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 9 May 2024 18:10:58 +0200 Subject: [PATCH 142/269] change layout of profiles --- server/settings/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/server/settings/main.py b/server/settings/main.py index 97bd376f47..d1cee32afa 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -77,6 +77,7 @@ def _ocio_built_in_paths(): class CoreImageIOConfigProfilesModel(BaseSettingsModel): + _layout = "expanded" host_names: list[str] = SettingsField( default_factory=list, title="Host names" From b7be1952e8533a6f794c7604ad4de939060a7495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Thu, 9 May 2024 20:24:54 +0200 Subject: [PATCH 143/269] Update client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py Co-authored-by: Roy Nieterau --- .../traypublisher/plugins/create/create_editorial_package.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py index 6a581b59d1..19ca032a0f 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py +++ b/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py @@ -24,7 +24,6 @@ class EditorialPackageCreator(TrayPublishCreator): # Position batch creator after simple creators order = 120 - def get_icon(self): return "fa.folder" From 4d737790de9d598f7a5b88e7e20b6ca6e738b444 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 9 May 2024 21:04:54 +0100 Subject: [PATCH 144/269] Working version --- client/ayon_core/hosts/nuke/api/plugin.py | 9 +++++++-- .../nuke/plugins/publish/extract_review_intermediates.py | 9 +++++++-- server_addon/nuke/package.py | 2 +- server_addon/nuke/server/settings/publish_plugins.py | 3 +++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/plugin.py b/client/ayon_core/hosts/nuke/api/plugin.py index fb56dec833..ec256ea303 100644 --- a/client/ayon_core/hosts/nuke/api/plugin.py +++ b/client/ayon_core/hosts/nuke/api/plugin.py @@ -834,7 +834,7 @@ class ExporterReviewMov(ExporterReview): self.log.info("Nodes exported...") return path - def generate_mov(self, farm=False, **kwargs): + def generate_mov(self, farm=False, delete=True, **kwargs): # colorspace data colorspace = None # get colorspace settings @@ -987,8 +987,13 @@ class ExporterReviewMov(ExporterReview): self.render(write_node.name()) # ---------- generate representation data + tags = ["review", "need_thumbnail"] + + if delete: + tags.append("delete") + self.get_representation_data( - tags=["review", "need_thumbnail", "delete"] + add_tags, + tags=tags + add_tags, custom_tags=add_custom_tags, range=True, colorspace=colorspace diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py b/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py index 8d7a3ec311..82c7b6e4c5 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py @@ -136,11 +136,16 @@ class ExtractReviewIntermediates(publish.Extractor): self, instance, o_name, o_data["extension"], multiple_presets) + o_data["add_custom_tags"].append("intermediate") + delete = not o_data.get("publish", False) + if instance.data.get("farm"): if "review" in instance.data["families"]: instance.data["families"].remove("review") - data = exporter.generate_mov(farm=True, **o_data) + data = exporter.generate_mov( + farm=True, delete=delete, **o_data + ) self.log.debug( "_ data: {}".format(data)) @@ -154,7 +159,7 @@ class ExtractReviewIntermediates(publish.Extractor): "bakeWriteNodeName": data.get("bakeWriteNodeName") }) else: - data = exporter.generate_mov(**o_data) + data = exporter.generate_mov(delete=delete, **o_data) # add representation generated by exporter generated_repres.extend(data["representations"]) 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" diff --git a/server_addon/nuke/server/settings/publish_plugins.py b/server_addon/nuke/server/settings/publish_plugins.py index d5b05d8715..e67f7be24f 100644 --- a/server_addon/nuke/server/settings/publish_plugins.py +++ b/server_addon/nuke/server/settings/publish_plugins.py @@ -125,6 +125,7 @@ class ReformatNodesConfigModel(BaseSettingsModel): class IntermediateOutputModel(BaseSettingsModel): name: str = SettingsField(title="Output name") + publish: bool = SettingsField(title="Publish") filter: BakingStreamFilterModel = SettingsField( title="Filter", default_factory=BakingStreamFilterModel) read_raw: bool = SettingsField( @@ -346,6 +347,7 @@ DEFAULT_PUBLISH_PLUGIN_SETTINGS = { "outputs": [ { "name": "baking", + "publish": False, "filter": { "task_types": [], "product_types": [], @@ -401,6 +403,7 @@ DEFAULT_PUBLISH_PLUGIN_SETTINGS = { "outputs": [ { "name": "baking", + "publish": False, "filter": { "task_types": [], "product_types": [], From 3bd7c7dddfd3a6e419d34640de4d248fc664396e Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 10 May 2024 11:02:55 +0200 Subject: [PATCH 145/269] Fix after effects launch logic variable for `AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH` -> `AVALON_AFTEREFFECTS_WORKFILES_ON_LAUNCH` --- client/ayon_core/hosts/aftereffects/api/launch_logic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/aftereffects/api/launch_logic.py b/client/ayon_core/hosts/aftereffects/api/launch_logic.py index 5a23f2cb35..da6887668a 100644 --- a/client/ayon_core/hosts/aftereffects/api/launch_logic.py +++ b/client/ayon_core/hosts/aftereffects/api/launch_logic.py @@ -60,7 +60,7 @@ def main(*subprocess_args): ) ) - elif os.environ.get("AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH", True): + elif os.environ.get("AVALON_AFTEREFFECTS_WORKFILES_ON_LAUNCH", True): save = False if os.getenv("WORKFILES_SAVE_AS"): save = True From 39da0bc7a3e23d7a89ed3ed40c1aee094540f2fa Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 10 May 2024 12:33:52 +0200 Subject: [PATCH 146/269] define server version with ayon attributes --- package.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package.py b/package.py index 79450d029f..0f2e855161 100644 --- a/package.py +++ b/package.py @@ -5,7 +5,5 @@ version = "0.3.1-dev.1" client_dir = "ayon_core" plugin_for = ["ayon_server"] -requires = [ - "~ayon_server-1.0.3+<2.0.0", -] +ayon_server_version = ">=1.0.3<2.0.0" From 43bf0b135c4923ce14319f79ca4b39e3be27c7fc Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 10 May 2024 12:34:06 +0200 Subject: [PATCH 147/269] define minimum launcher version --- package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/package.py b/package.py index 0f2e855161..459b0034bd 100644 --- a/package.py +++ b/package.py @@ -7,3 +7,4 @@ client_dir = "ayon_core" plugin_for = ["ayon_server"] ayon_server_version = ">=1.0.3<2.0.0" +ayon_launcher_version = ">=1.0.2" From c4b07146adeea379fbe1d6ff99ae2f7f2c408384 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 10 May 2024 12:34:15 +0200 Subject: [PATCH 148/269] add remaining attributes --- package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.py b/package.py index 459b0034bd..9e644fa310 100644 --- a/package.py +++ b/package.py @@ -8,3 +8,5 @@ plugin_for = ["ayon_server"] ayon_server_version = ">=1.0.3<2.0.0" ayon_launcher_version = ">=1.0.2" +ayon_required_addons = {} +ayon_compatible_addons = {} From 68cfa1a4a1ee7705f43e7999756d0a14dbbbc22b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 10 May 2024 13:54:30 +0200 Subject: [PATCH 149/269] fix server version compatibility --- package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.py b/package.py index 9e644fa310..fa3eaba9bd 100644 --- a/package.py +++ b/package.py @@ -6,7 +6,7 @@ client_dir = "ayon_core" plugin_for = ["ayon_server"] -ayon_server_version = ">=1.0.3<2.0.0" +ayon_server_version = ">=1.0.3,<2.0.0" ayon_launcher_version = ">=1.0.2" ayon_required_addons = {} ayon_compatible_addons = {} From 2a675f51a6db20322b3e1d5e8f537723bc33154d Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 14:38:16 +0200 Subject: [PATCH 150/269] AY-4801-simplified Settings Got rid of profiles, didn't make much sense. Git rid of multiple output definitions, didn't make sense with single otio file. --- .../server/settings/publish_plugins.py | 44 +++---------------- 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/server_addon/traypublisher/server/settings/publish_plugins.py b/server_addon/traypublisher/server/settings/publish_plugins.py index 9869f54620..2afe20c865 100644 --- a/server_addon/traypublisher/server/settings/publish_plugins.py +++ b/server_addon/traypublisher/server/settings/publish_plugins.py @@ -41,9 +41,7 @@ class ExtractEditorialPckgFFmpegModel(BaseSettingsModel): class ExtractEditorialPckgOutputDefModel(BaseSettingsModel): - """Set extension and ffmpeg arguments. See `ExtractReview` for example.""" _layout = "expanded" - name: str = SettingsField("", title="Name") ext: str = SettingsField("", title="Output extension") ffmpeg_args: ExtractEditorialPckgFFmpegModel = SettingsField( @@ -52,40 +50,13 @@ class ExtractEditorialPckgOutputDefModel(BaseSettingsModel): ) -class ExtractEditorialPckgProfileModel(BaseSettingsModel): - product_types: list[str] = SettingsField( - default_factory=list, - title="Product types" - ) - task_types: list[str] = SettingsField( - default_factory=list, - title="Task types", - enum_resolver=task_types_enum - ) - task_names: list[str] = SettingsField( - default_factory=list, - title="Task names" - ) - product_names: list[str] = SettingsField( - default_factory=list, - title="Product names" - ) - outputs: list[ExtractEditorialPckgOutputDefModel] = SettingsField( - default_factory=list, - title="Output Definitions", - ) - - @validator("outputs") - def validate_unique_outputs(cls, value): - ensure_unique_names(value) - return value - - class ExtractEditorialPckgConversionModel(BaseSettingsModel): - """Conversion of input movie files into expected format.""" - enabled: bool = SettingsField(True) - profiles: list[ExtractEditorialPckgProfileModel] = SettingsField( - default_factory=list, title="Profiles" + """Set output definition if resource files should be converted.""" + conversion_enabled: bool = SettingsField(True, + title="Conversion enabled") + output: ExtractEditorialPckgOutputDefModel = SettingsField( + default_factory=ExtractEditorialPckgOutputDefModel, + title="Output Definitions", ) @@ -128,8 +99,7 @@ DEFAULT_PUBLISH_PLUGINS = { "active": True }, "ExtractEditorialPckgConversion": { - "enabled": True, - "optional": True, + "optional": False, "active": True } } From a1d310fad04e210ac1cf60c86473346c5a3061e4 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 14:39:07 +0200 Subject: [PATCH 151/269] AY-4801-exposed state of conversion from Settings in creator Settings have toggle to on/off conversion, this is exposed for Artist to decide ad-hoc. --- .../create/create_editorial_package.py | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py index 6a581b59d1..72a156dfb7 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py +++ b/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py @@ -4,7 +4,12 @@ from ayon_core.pipeline import ( CreatedInstance, ) -from ayon_core.lib.attribute_definitions import FileDef +from ayon_core.lib.attribute_definitions import ( + FileDef, + BoolDef, + TextDef, + HiddenDef +) from ayon_core.hosts.traypublisher.api.plugin import TrayPublishCreator @@ -24,6 +29,16 @@ class EditorialPackageCreator(TrayPublishCreator): # Position batch creator after simple creators order = 120 + conversion_enabled = False + + def apply_settings(self, project_settings): + self.conversion_enabled = ( + project_settings["traypublisher"] + ["publish"] + ["ExtractEditorialPckgConversion"] + ["conversion_enabled"] + ) + print(project_settings) def get_icon(self): return "fa.folder" @@ -34,8 +49,9 @@ class EditorialPackageCreator(TrayPublishCreator): return instance_data["creator_attributes"] = { - "path": (Path(folder_path["directory"]) / - Path(folder_path["filenames"][0])).as_posix() + "folder_path": (Path(folder_path["directory"]) / + Path(folder_path["filenames"][0])).as_posix(), + "conversion_enabled": pre_create_data["conversion_enabled"] } # Create new instance @@ -53,7 +69,23 @@ class EditorialPackageCreator(TrayPublishCreator): extensions=[], allow_sequences=False, label="Folder path" - ) + ), + BoolDef("conversion_enabled", + tooltip="Convert to output defined in Settings.", + default=self.conversion_enabled, + label="Convert resources"), + ] + + def get_instance_attr_defs(self): + return [ + TextDef( + "folder_path", + label="Folder path", + disabled=True + ), + BoolDef("conversion_enabled", + tooltip="Convert to output defined in Settings.", + label="Convert resources"), ] def get_detail_description(self): From b55ed2e7869a508f33621b656cc03e23e8bd66d2 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 14:39:42 +0200 Subject: [PATCH 152/269] AY-4801-updated variable name Old 'path' clashed in output of instance attributes in Publisher. --- .../traypublisher/plugins/publish/collect_editorial_package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py index 101f58b6d1..cb1277546c 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/collect_editorial_package.py @@ -27,7 +27,7 @@ class CollectEditorialPackage(pyblish.api.InstancePlugin): families = ["editorial_pckg"] def process(self, instance): - folder_path = instance.data["creator_attributes"].get("path") + folder_path = instance.data["creator_attributes"]["folder_path"] if not folder_path or not os.path.exists(folder_path): self.log.info(( "Instance doesn't contain collected existing folder path." From 663ace6c8f23ae8faf61408c761aed6457d4c100 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 14:40:44 +0200 Subject: [PATCH 153/269] AY-4801-conversion controlled by instance attribute --- .../plugins/publish/extract_editorial_pckg.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py index 02f953d579..6b6f0bfe1d 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py @@ -45,14 +45,15 @@ class ExtractEditorialPckgConversion(publish.Extractor): publish_resource_folder) project_settings = instance.context.data["project_settings"] - profiles = (project_settings["traypublisher"] - ["publish"] - ["ExtractEditorialPckgConversion"] - .get("profiles")) - output_def = None - if profiles: - output_def = self._get_output_definition(instance, profiles) - if output_def: + output_def = (project_settings["traypublisher"] + ["publish"] + ["ExtractEditorialPckgConversion"] + ["output"]) + + conversion_enabled = (instance.data["creator_attributes"] + ["conversion_enabled"]) + + if conversion_enabled and output_def["ext"]: transfers = self._convert_resources(output_def, transfers) if not "transfers" in instance.data: From 0a45c5f8fff5e1bae29cec10033cff3263cfc638 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 14:41:10 +0200 Subject: [PATCH 154/269] AY-4801-removed profile filtering --- .../plugins/publish/extract_editorial_pckg.py | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py index 6b6f0bfe1d..e2eb4cb916 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py @@ -6,7 +6,7 @@ import opentimelineio import pyblish.api -from ayon_core.lib import filter_profiles, get_ffmpeg_tool_args, run_subprocess +from ayon_core.lib import get_ffmpeg_tool_args, run_subprocess from ayon_core.pipeline import publish @@ -81,26 +81,6 @@ class ExtractEditorialPckgConversion(publish.Extractor): os.makedirs(publish_resource_folder, exist_ok=True) return publish_resource_folder - def _get_output_definition(self, instance, profiles): - """Return appropriate profile by context information.""" - product_type = instance.data["productType"] - product_name = instance.data["productName"] - task_entity = instance.data["taskEntity"] or {} - task_name = task_entity.get("name") - task_type = task_entity.get("taskType") - filtering_criteria = { - "product_types": product_type, - "product_names": product_name, - "task_names": task_name, - "task_types": task_type, - } - profile = filter_profiles( - profiles, - filtering_criteria, - logger=self.log - ) - return profile - def _get_resource_path_mapping(self, instance, transfers): """Returns dict of {source_mov_path: rootless_published_path}.""" replace_paths = {} From f8503aa5dc7b62e0d5fdd9d982dc55b1204b604a Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 14:41:37 +0200 Subject: [PATCH 155/269] AY-4801-removed multiple output definitions --- .../plugins/publish/extract_editorial_pckg.py | 107 +++++++++--------- 1 file changed, 52 insertions(+), 55 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py index e2eb4cb916..488b8e5a75 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py @@ -147,69 +147,66 @@ class ExtractEditorialPckgConversion(publish.Extractor): def _convert_resources(self, output_def, transfers): """Converts all resource files to configured format.""" - outputs = output_def["outputs"] - if not outputs: - self.log.warning("No output configured in " - "ayon+settings://traypublisher/publish/ExtractEditorialPckgConversion/profiles/0/outputs") # noqa + out_extension = output_def["ext"] + if not out_extension: + self.log.warning("No output extension configured in " + "ayon+settings://traypublisher/publish/ExtractEditorialPckgConversion") # noqa return transfers final_transfers = [] - # most likely only single output is expected - for output in outputs: - out_extension = output["ext"] - out_def_ffmpeg_args = output["ffmpeg_args"] - ffmpeg_input_args = [ - value.strip() - for value in out_def_ffmpeg_args["input"] - if value.strip() - ] - ffmpeg_video_filters = [ - value.strip() - for value in out_def_ffmpeg_args["video_filters"] - if value.strip() - ] - ffmpeg_audio_filters = [ - value.strip() - for value in out_def_ffmpeg_args["audio_filters"] - if value.strip() - ] - ffmpeg_output_args = [ - value.strip() - for value in out_def_ffmpeg_args["output"] - if value.strip() - ] - ffmpeg_input_args = self._split_ffmpeg_args(ffmpeg_input_args) + out_def_ffmpeg_args = output_def["ffmpeg_args"] + ffmpeg_input_args = [ + value.strip() + for value in out_def_ffmpeg_args["input"] + if value.strip() + ] + ffmpeg_video_filters = [ + value.strip() + for value in out_def_ffmpeg_args["video_filters"] + if value.strip() + ] + ffmpeg_audio_filters = [ + value.strip() + for value in out_def_ffmpeg_args["audio_filters"] + if value.strip() + ] + ffmpeg_output_args = [ + value.strip() + for value in out_def_ffmpeg_args["output"] + if value.strip() + ] + ffmpeg_input_args = self._split_ffmpeg_args(ffmpeg_input_args) - generic_args = [ - subprocess.list2cmdline(get_ffmpeg_tool_args("ffmpeg")) - ] - generic_args.extend(ffmpeg_input_args) - if ffmpeg_video_filters: - generic_args.append("-filter:v") - generic_args.append( - "\"{}\"".format(",".join(ffmpeg_video_filters))) + generic_args = [ + subprocess.list2cmdline(get_ffmpeg_tool_args("ffmpeg")) + ] + generic_args.extend(ffmpeg_input_args) + if ffmpeg_video_filters: + generic_args.append("-filter:v") + generic_args.append( + "\"{}\"".format(",".join(ffmpeg_video_filters))) - if ffmpeg_audio_filters: - generic_args.append("-filter:a") - generic_args.append( - "\"{}\"".format(",".join(ffmpeg_audio_filters))) + if ffmpeg_audio_filters: + generic_args.append("-filter:a") + generic_args.append( + "\"{}\"".format(",".join(ffmpeg_audio_filters))) - for source, destination in transfers: - base_name = os.path.basename(destination) - file_name, ext = os.path.splitext(base_name) - dest_path = os.path.join(os.path.dirname(destination), - f"{file_name}.{out_extension}") - final_transfers.append((source, dest_path)) + for source, destination in transfers: + base_name = os.path.basename(destination) + file_name, ext = os.path.splitext(base_name) + dest_path = os.path.join(os.path.dirname(destination), + f"{file_name}.{out_extension}") + final_transfers.append((source, dest_path)) - all_args = copy.deepcopy(generic_args) - all_args.append(f"-i {source}") - all_args.extend(ffmpeg_output_args) # order matters - all_args.append(f"{dest_path}") - subprcs_cmd = " ".join(all_args) + all_args = copy.deepcopy(generic_args) + all_args.append(f"-i {source}") + all_args.extend(ffmpeg_output_args) # order matters + all_args.append(f"{dest_path}") + subprcs_cmd = " ".join(all_args) - # run subprocess - self.log.debug("Executing: {}".format(subprcs_cmd)) - run_subprocess(subprcs_cmd, shell=True, logger=self.log) + # run subprocess + self.log.debug("Executing: {}".format(subprcs_cmd)) + run_subprocess(subprcs_cmd, shell=True, logger=self.log) return final_transfers def _split_ffmpeg_args(self, in_args): From ac2453db1e1cb37dd29cbd76cf9f9d61d0ca6751 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 10 May 2024 14:42:13 +0200 Subject: [PATCH 156/269] bump version to '0.3.1' --- client/ayon_core/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/version.py b/client/ayon_core/version.py index a60de0493a..952df2a2c0 100644 --- a/client/ayon_core/version.py +++ b/client/ayon_core/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON core addon version.""" -__version__ = "0.3.1-dev.1" +__version__ = "0.3.1" diff --git a/package.py b/package.py index fa3eaba9bd..4398bd9920 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "core" title = "Core" -version = "0.3.1-dev.1" +version = "0.3.1" client_dir = "ayon_core" From 0e4e845407d9f0c425b392d3f454dd5866b819b5 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 10 May 2024 14:43:02 +0200 Subject: [PATCH 157/269] bump version to '0.3.2-dev.1' --- client/ayon_core/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/version.py b/client/ayon_core/version.py index 952df2a2c0..275e1b1dd6 100644 --- a/client/ayon_core/version.py +++ b/client/ayon_core/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON core addon version.""" -__version__ = "0.3.1" +__version__ = "0.3.2-dev.1" diff --git a/package.py b/package.py index 4398bd9920..b7b8d2dae6 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "core" title = "Core" -version = "0.3.1" +version = "0.3.2-dev.1" client_dir = "ayon_core" From ba0918964f3766465104d278489d49bad7585233 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 14:41:57 +0200 Subject: [PATCH 158/269] AY-4801-updated validation message --- .../plugins/publish/extract_editorial_pckg.py | 8 +++++--- .../plugins/publish/validate_editorial_package.py | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py index 488b8e5a75..d25a7146a0 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py @@ -111,9 +111,11 @@ class ExtractEditorialPckgConversion(publish.Extractor): if not target_url: continue file_name = os.path.basename(target_url) - replace_value = replace_paths.get(file_name) - if replace_value: - clip.media_reference.target_url = replace_value + replace_path = replace_paths.get(file_name) + if replace_path: + clip.media_reference.target_url = replace_path + if clip.name == file_name: + clip.name = os.path.basename(replace_path) return otio_data diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py index 869dc73811..ce545610ea 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py @@ -47,8 +47,9 @@ class ValidateEditorialPackage(pyblish.api.InstancePlugin): missing_files.add(target_basename) if missing_files: - raise PublishValidationError("Otio file contains missing files " - f"'{missing_files}'.") + raise PublishValidationError( + "Otio file contains missing files `{missing_files}`.\n\n" + f"Please add them to `{folder_path}` and republish.") instance.data["editorial_pckg"]["otio_data"] = otio_data From 4cfc90bbb3b7bf97315b993028edc201280fabe4 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 10 May 2024 16:29:56 +0300 Subject: [PATCH 159/269] Add OPMenu Stencil --- .../hosts/houdini/startup/OPmenu.xml | 528 ++++++++++++++++++ 1 file changed, 528 insertions(+) create mode 100644 client/ayon_core/hosts/houdini/startup/OPmenu.xml diff --git a/client/ayon_core/hosts/houdini/startup/OPmenu.xml b/client/ayon_core/hosts/houdini/startup/OPmenu.xml new file mode 100644 index 0000000000..bdb559a084 --- /dev/null +++ b/client/ayon_core/hosts/houdini/startup/OPmenu.xml @@ -0,0 +1,528 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 2c12a540c184b7d7323bdf5306d3dbae9031a787 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 10 May 2024 16:36:18 +0300 Subject: [PATCH 160/269] update OPMenu: add 'Create New (AYON)...' script item --- client/ayon_core/hosts/houdini/startup/OPmenu.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/ayon_core/hosts/houdini/startup/OPmenu.xml b/client/ayon_core/hosts/houdini/startup/OPmenu.xml index bdb559a084..0d58cf53fe 100644 --- a/client/ayon_core/hosts/houdini/startup/OPmenu.xml +++ b/client/ayon_core/hosts/houdini/startup/OPmenu.xml @@ -432,6 +432,21 @@ examples.load_token(kwargs['selectedtoken'], kwargs['node'], shift=kwargs['shift + + + + + + + + From 171ecf2be41c9d6e13e862b7479713d5f3ce221e Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 15:53:50 +0200 Subject: [PATCH 161/269] AY-4801-bump up version of OpenTimelineIO --- client/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/pyproject.toml b/client/pyproject.toml index 1a0ad7e5f2..5e811321f8 100644 --- a/client/pyproject.toml +++ b/client/pyproject.toml @@ -16,7 +16,7 @@ aiohttp_json_rpc = "*" # TVPaint server aiohttp-middlewares = "^2.0.0" wsrpc_aiohttp = "^3.1.1" # websocket server Click = "^8" -OpenTimelineIO = "0.14.1" +OpenTimelineIO = "0.16.0" opencolorio = "2.2.1" Pillow = "9.5.0" pynput = "^1.7.2" # Timers manager - TODO remove From c976261786de427ba2cff49afee44d5a6e28c99e Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 16:04:02 +0200 Subject: [PATCH 162/269] AY-4801-added default setting to .mp4 conversion --- .../server/settings/publish_plugins.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/server_addon/traypublisher/server/settings/publish_plugins.py b/server_addon/traypublisher/server/settings/publish_plugins.py index 2afe20c865..dc659f6110 100644 --- a/server_addon/traypublisher/server/settings/publish_plugins.py +++ b/server_addon/traypublisher/server/settings/publish_plugins.py @@ -100,6 +100,21 @@ DEFAULT_PUBLISH_PLUGINS = { }, "ExtractEditorialPckgConversion": { "optional": False, - "active": True + "conversion_enabled": True, + "output": { + "ext": "", + "ffmpeg_args": { + "video_filters": [], + "audio_filters": [], + "input": [ + "-apply_trc gamma22" + ], + "output": [ + "-pix_fmt yuv420p", + "-crf 18", + "-intra" + ] + } + } } } From e19986a792972962be07d060249cfe3c56764ca3 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 10 May 2024 16:26:10 +0200 Subject: [PATCH 163/269] AY-4801-bump up version of traypublisher package --- server_addon/traypublisher/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/traypublisher/package.py b/server_addon/traypublisher/package.py index 4ca8ae9fd3..c138a2296d 100644 --- a/server_addon/traypublisher/package.py +++ b/server_addon/traypublisher/package.py @@ -1,3 +1,3 @@ name = "traypublisher" title = "TrayPublisher" -version = "0.1.4" +version = "0.1.5" From 922db60bd031f5a071c5de84b595e9a7a6d5bab2 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 10 May 2024 17:18:36 +0200 Subject: [PATCH 164/269] Add quotes to file paths in ExtractEditorialPckgConversion, improve error message handling in ValidateEditorialPackage. --- .../traypublisher/plugins/publish/extract_editorial_pckg.py | 5 ++--- .../plugins/publish/validate_editorial_package.py | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py index d25a7146a0..a4d8d2c6fb 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py @@ -201,9 +201,9 @@ class ExtractEditorialPckgConversion(publish.Extractor): final_transfers.append((source, dest_path)) all_args = copy.deepcopy(generic_args) - all_args.append(f"-i {source}") + all_args.append(f"-i \"{source}\"") all_args.extend(ffmpeg_output_args) # order matters - all_args.append(f"{dest_path}") + all_args.append(f"\"{dest_path}\"") subprcs_cmd = " ".join(all_args) # run subprocess @@ -232,4 +232,3 @@ class ExtractEditorialPckgConversion(publish.Extractor): if arg and arg not in splitted_args: splitted_args.append(arg) return splitted_args - diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py index ce545610ea..89594ce441 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py @@ -48,7 +48,7 @@ class ValidateEditorialPackage(pyblish.api.InstancePlugin): if missing_files: raise PublishValidationError( - "Otio file contains missing files `{missing_files}`.\n\n" + f"Otio file contains missing files `{missing_files}`.\n\n" f"Please add them to `{folder_path}` and republish.") instance.data["editorial_pckg"]["otio_data"] = otio_data @@ -67,5 +67,3 @@ class ValidateEditorialPackage(pyblish.api.InstancePlugin): target_urls.append(target_url) return target_urls - - From 86b2f3b5b52431f6cb11b91e771552c717fa6df8 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 10 May 2024 18:45:15 +0300 Subject: [PATCH 165/269] remove redundant elements --- .../hosts/houdini/startup/OPmenu.xml | 520 +----------------- 1 file changed, 3 insertions(+), 517 deletions(-) diff --git a/client/ayon_core/hosts/houdini/startup/OPmenu.xml b/client/ayon_core/hosts/houdini/startup/OPmenu.xml index 0d58cf53fe..0a7b265fa1 100644 --- a/client/ayon_core/hosts/houdini/startup/OPmenu.xml +++ b/client/ayon_core/hosts/houdini/startup/OPmenu.xml @@ -1,438 +1,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + opmenu.unsynchronize + opmenu.vhda_create @@ -447,97 +24,6 @@ create_interactive("io.openpype.creators.houdini.hda", **kwargs) ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 8dc0043d0308b3e823bd055ae7a54217d95462d6 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Sat, 11 May 2024 00:00:52 +0800 Subject: [PATCH 166/269] add joint into accepted_controllers & make sure the bake animation doesn't get resample when it is exported --- .../hosts/maya/plugins/publish/extract_fbx_animation.py | 1 + .../hosts/maya/plugins/publish/validate_animated_reference.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py b/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py index ee66ed2fb7..36dc1b1544 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py +++ b/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py @@ -36,6 +36,7 @@ class ExtractFBXAnimation(publish.Extractor): out_members = instance.data.get("animated_skeleton", []) # Export instance.data["constraints"] = True + instance.data["bakeResampleAnimation"] = False instance.data["skeletonDefinitions"] = True instance.data["referencedAssetsContent"] = True fbx_exporter.set_options_from_instance(instance) diff --git a/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py b/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py index 2ba2bff6fc..c9dcc662af 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py +++ b/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py @@ -16,7 +16,7 @@ class ValidateAnimatedReferenceRig(pyblish.api.InstancePlugin, hosts = ["maya"] families = ["animation.fbx"] label = "Animated Reference Rig" - accepted_controllers = ["transform", "locator"] + accepted_controllers = ["transform", "locator", "joint"] actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction] optional = False From 2d4bc1e7ca9546692a242a40e273d1e88fe6fcdf Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Sat, 11 May 2024 00:23:53 +0800 Subject: [PATCH 167/269] add inputchildren as options --- client/ayon_core/hosts/maya/api/fbx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/hosts/maya/api/fbx.py b/client/ayon_core/hosts/maya/api/fbx.py index 3f1395cb40..437d64abbf 100644 --- a/client/ayon_core/hosts/maya/api/fbx.py +++ b/client/ayon_core/hosts/maya/api/fbx.py @@ -102,6 +102,7 @@ class FBXExtractor: "constraints": False, "lights": True, "embeddedTextures": False, + "includeChildren": True, "inputConnections": True, "upAxis": "y", "triangulate": False, From 828fe3ad266324fa64d20ec2cd17c7a9a4803a6f Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 10 May 2024 19:14:34 +0200 Subject: [PATCH 168/269] Fix call to `create_context_node` --- .../ayon_core/hosts/houdini/plugins/create/create_workfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py b/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py index a958509e25..40a607e81a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py @@ -95,7 +95,7 @@ class CreateWorkfile(plugin.HoudiniCreatorBase, AutoCreator): # write workfile information to context container. op_ctx = hou.node(CONTEXT_CONTAINER) if not op_ctx: - op_ctx = self.create_context_node() + op_ctx = self.host.create_context_node() workfile_data = {"workfile": current_instance.data_to_store()} imprint(op_ctx, workfile_data) From f820050f7eb7ac95d3c4f07174a5a409e47d2d3a Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 13 May 2024 18:39:33 +0800 Subject: [PATCH 169/269] add inputChildren into the dict from options function --- client/ayon_core/hosts/maya/api/fbx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/hosts/maya/api/fbx.py b/client/ayon_core/hosts/maya/api/fbx.py index 437d64abbf..fd1bf2c901 100644 --- a/client/ayon_core/hosts/maya/api/fbx.py +++ b/client/ayon_core/hosts/maya/api/fbx.py @@ -59,6 +59,7 @@ class FBXExtractor: "constraints": bool, "lights": bool, "embeddedTextures": bool, + "includeChildren": bool, "inputConnections": bool, "upAxis": str, # x, y or z, "triangulate": bool, From 4a70e5bb0084285062527937c3b2d3858d36e506 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 13 May 2024 18:56:56 +0800 Subject: [PATCH 170/269] make sure the constraint is false when exporting --- .../hosts/maya/plugins/publish/extract_fbx_animation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py b/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py index 36dc1b1544..21a8abd46f 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py +++ b/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py @@ -35,8 +35,7 @@ class ExtractFBXAnimation(publish.Extractor): fbx_exporter = fbx.FBXExtractor(log=self.log) out_members = instance.data.get("animated_skeleton", []) # Export - instance.data["constraints"] = True - instance.data["bakeResampleAnimation"] = False + instance.data["constraints"] = False instance.data["skeletonDefinitions"] = True instance.data["referencedAssetsContent"] = True fbx_exporter.set_options_from_instance(instance) From 8cf1d53e2b66eccc6040ebbc48f4f99c9e4a19d0 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 13 May 2024 22:42:37 +0800 Subject: [PATCH 171/269] add TODO --- .../hosts/maya/plugins/publish/extract_fbx_animation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py b/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py index 21a8abd46f..77b5b79b5f 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py +++ b/client/ayon_core/hosts/maya/plugins/publish/extract_fbx_animation.py @@ -35,7 +35,8 @@ class ExtractFBXAnimation(publish.Extractor): fbx_exporter = fbx.FBXExtractor(log=self.log) out_members = instance.data.get("animated_skeleton", []) # Export - instance.data["constraints"] = False + # TODO: need to set up the options for users to set up + # the flags they intended to export instance.data["skeletonDefinitions"] = True instance.data["referencedAssetsContent"] = True fbx_exporter.set_options_from_instance(instance) From b2b8cb132f78b4bc807e0dcaf0ef71d906f10f73 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 13 May 2024 17:59:23 +0300 Subject: [PATCH 172/269] add CreateModel --- server_addon/houdini/package.py | 2 +- server_addon/houdini/server/settings/create.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 6c81eba439..06b034da38 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,3 +1,3 @@ name = "houdini" title = "Houdini" -version = "0.2.14" +version = "0.2.15" diff --git a/server_addon/houdini/server/settings/create.py b/server_addon/houdini/server/settings/create.py index 203ca4f9d6..cd1e110c23 100644 --- a/server_addon/houdini/server/settings/create.py +++ b/server_addon/houdini/server/settings/create.py @@ -57,6 +57,9 @@ class CreatePluginsModel(BaseSettingsModel): CreateMantraROP: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create Mantra ROP") + CreateModel: CreatorModel = SettingsField( + default_factory=CreatorModel, + title="Create Model") CreatePointCache: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create PointCache (Abc)") @@ -124,6 +127,10 @@ DEFAULT_HOUDINI_CREATE_SETTINGS = { "enabled": True, "default_variants": ["Main"] }, + "CreateModel": { + "enabled": True, + "default_variants": ["Main"] + }, "CreatePointCache": { "enabled": True, "default_variants": ["Main"] From fb2714005999c262d5e023afd17c76ae9c296dca Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 13 May 2024 23:39:49 +0800 Subject: [PATCH 173/269] remove joint --- .../hosts/maya/plugins/publish/validate_animated_reference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py b/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py index c9dcc662af..2ba2bff6fc 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py +++ b/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py @@ -16,7 +16,7 @@ class ValidateAnimatedReferenceRig(pyblish.api.InstancePlugin, hosts = ["maya"] families = ["animation.fbx"] label = "Animated Reference Rig" - accepted_controllers = ["transform", "locator", "joint"] + accepted_controllers = ["transform", "locator"] actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction] optional = False From aa6b254326f052b05f95fee20e91fad784a54c1a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 14 May 2024 11:14:06 +0200 Subject: [PATCH 174/269] do not try to fix own overrides --- server/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/__init__.py b/server/__init__.py index 82473927b6..79f505ccd5 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -26,10 +26,14 @@ class CoreAddon(BaseServerAddon): def _convert_imagio_configs_0_3_1(self, overrides): """Imageio config settings did change to profiles since 0.3.1. .""" imageio_overrides = overrides.get("imageio") or {} - if "ocio_config" not in imageio_overrides: + if ( + "ocio_config" not in imageio_overrides + or "filepath" not in imageio_overrides["ocio_config"] + ): return ocio_config = imageio_overrides.pop("ocio_config") + filepath = ocio_config["filepath"] if not filepath: return From 37cd670f40a89206023adc0da2e6b11aff0ed273 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 14 May 2024 11:40:47 +0200 Subject: [PATCH 175/269] removed deprecated function 'get_template_data_from_session' --- client/ayon_core/pipeline/context_tools.py | 30 ---------------------- 1 file changed, 30 deletions(-) diff --git a/client/ayon_core/pipeline/context_tools.py b/client/ayon_core/pipeline/context_tools.py index 33567d7280..c32d04c44c 100644 --- a/client/ayon_core/pipeline/context_tools.py +++ b/client/ayon_core/pipeline/context_tools.py @@ -459,36 +459,6 @@ def is_representation_from_latest(representation): ) -def get_template_data_from_session(session=None, settings=None): - """Template data for template fill from session keys. - - Args: - session (Union[Dict[str, str], None]): The Session to use. If not - provided use the currently active global Session. - settings (Optional[Dict[str, Any]]): Prepared studio or project - settings. - - Returns: - Dict[str, Any]: All available data from session. - """ - - if session is not None: - project_name = session["AYON_PROJECT_NAME"] - folder_path = session["AYON_FOLDER_PATH"] - task_name = session["AYON_TASK_NAME"] - host_name = session["AYON_HOST_NAME"] - else: - context = get_current_context() - project_name = context["project_name"] - folder_path = context["folder_path"] - task_name = context["task_name"] - host_name = get_current_host_name() - - return get_template_data_with_names( - project_name, folder_path, task_name, host_name, settings - ) - - def get_current_context_template_data(settings=None): """Prepare template data for current context. From 217cd06f9a7c94b4bc0e12c54e2da5c48e73855d Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 14 May 2024 12:31:50 +0200 Subject: [PATCH 176/269] fix ruff comments --- .../traypublisher/plugins/create/create_editorial_package.py | 1 - .../traypublisher/plugins/publish/extract_editorial_pckg.py | 2 -- .../plugins/publish/validate_editorial_package.py | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py index 830cfa5564..82b109be28 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py +++ b/client/ayon_core/hosts/traypublisher/plugins/create/create_editorial_package.py @@ -8,7 +8,6 @@ from ayon_core.lib.attribute_definitions import ( FileDef, BoolDef, TextDef, - HiddenDef ) from ayon_core.hosts.traypublisher.api.plugin import TrayPublishCreator diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py index a4d8d2c6fb..6dd4e84704 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/extract_editorial_pckg.py @@ -56,8 +56,6 @@ class ExtractEditorialPckgConversion(publish.Extractor): if conversion_enabled and output_def["ext"]: transfers = self._convert_resources(output_def, transfers) - if not "transfers" in instance.data: - instance.data["transfers"] = [] instance.data["transfers"] = transfers source_to_rootless = self._get_resource_path_mapping(instance, diff --git a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py b/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py index 89594ce441..c63c4a6a73 100644 --- a/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py +++ b/client/ayon_core/hosts/traypublisher/plugins/publish/validate_editorial_package.py @@ -22,8 +22,7 @@ class ValidateEditorialPackage(pyblish.api.InstancePlugin): def process(self, instance): editorial_pckg_data = instance.data.get("editorial_pckg") if not editorial_pckg_data: - raise PublishValidationError( - f"Editorial package not collected") + raise PublishValidationError("Editorial package not collected") folder_path = editorial_pckg_data["folder_path"] From 4dc893dfd571365337594ac2e764e69c230e352c Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 14 May 2024 12:32:21 +0200 Subject: [PATCH 177/269] Nuke: Refactor metadata imprinting - Simplified code by removing 'author' attribute from metadata imprinting in various plugins. --- client/ayon_core/hosts/nuke/plugins/load/load_backdrop.py | 4 ++-- client/ayon_core/hosts/nuke/plugins/load/load_camera_abc.py | 4 ++-- client/ayon_core/hosts/nuke/plugins/load/load_clip.py | 4 +--- client/ayon_core/hosts/nuke/plugins/load/load_effects.py | 2 -- client/ayon_core/hosts/nuke/plugins/load/load_effects_ip.py | 2 -- client/ayon_core/hosts/nuke/plugins/load/load_gizmo.py | 2 -- client/ayon_core/hosts/nuke/plugins/load/load_gizmo_ip.py | 2 -- client/ayon_core/hosts/nuke/plugins/load/load_image.py | 3 +-- client/ayon_core/hosts/nuke/plugins/load/load_model.py | 4 ++-- .../ayon_core/hosts/nuke/plugins/load/load_script_precomp.py | 2 -- 10 files changed, 8 insertions(+), 21 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_backdrop.py b/client/ayon_core/hosts/nuke/plugins/load/load_backdrop.py index 7d823919dc..50af8a4eb9 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_backdrop.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_backdrop.py @@ -62,7 +62,7 @@ class LoadBackdropNodes(load.LoaderPlugin): } # add attributes from the version to imprint to metadata knob - for k in ["source", "author", "fps"]: + for k in ["source", "fps"]: data_imprint[k] = version_attributes[k] # getting file path @@ -206,7 +206,7 @@ class LoadBackdropNodes(load.LoaderPlugin): "colorspaceInput": colorspace, } - for k in ["source", "author", "fps"]: + for k in ["source", "fps"]: data_imprint[k] = version_attributes[k] # adding nodes to node graph diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_camera_abc.py b/client/ayon_core/hosts/nuke/plugins/load/load_camera_abc.py index 14c54c3adc..3c7d4f3bb2 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_camera_abc.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_camera_abc.py @@ -48,7 +48,7 @@ class AlembicCameraLoader(load.LoaderPlugin): "frameEnd": last, "version": version_entity["version"], } - for k in ["source", "author", "fps"]: + for k in ["source", "fps"]: data_imprint[k] = version_attributes[k] # getting file path @@ -123,7 +123,7 @@ class AlembicCameraLoader(load.LoaderPlugin): } # add attributes from the version to imprint to metadata knob - for k in ["source", "author", "fps"]: + for k in ["source", "fps"]: data_imprint[k] = version_attributes[k] # getting file path diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_clip.py b/client/ayon_core/hosts/nuke/plugins/load/load_clip.py index df8f2ab018..22203a5978 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_clip.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_clip.py @@ -197,7 +197,6 @@ class LoadClip(plugin.NukeLoader): "frameStart", "frameEnd", "source", - "author", "fps", "handleStart", "handleEnd", @@ -347,8 +346,7 @@ class LoadClip(plugin.NukeLoader): "source": version_attributes.get("source"), "handleStart": str(self.handle_start), "handleEnd": str(self.handle_end), - "fps": str(version_attributes.get("fps")), - "author": version_attributes.get("author") + "fps": str(version_attributes.get("fps")) } last_version_entity = ayon_api.get_last_version_by_product_id( diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_effects.py b/client/ayon_core/hosts/nuke/plugins/load/load_effects.py index a87c81295a..be7420fcf0 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_effects.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_effects.py @@ -69,7 +69,6 @@ class LoadEffects(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps" ]: data_imprint[k] = version_attributes[k] @@ -189,7 +188,6 @@ class LoadEffects(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps", ]: data_imprint[k] = version_attributes[k] diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_effects_ip.py b/client/ayon_core/hosts/nuke/plugins/load/load_effects_ip.py index 8fa1347598..9bb430b37b 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_effects_ip.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_effects_ip.py @@ -69,7 +69,6 @@ class LoadEffectsInputProcess(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps" ]: data_imprint[k] = version_attributes[k] @@ -192,7 +191,6 @@ class LoadEffectsInputProcess(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps" ]: data_imprint[k] = version_attributes[k] diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_gizmo.py b/client/ayon_core/hosts/nuke/plugins/load/load_gizmo.py index 95f85bacfc..57d00795ae 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_gizmo.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_gizmo.py @@ -71,7 +71,6 @@ class LoadGizmo(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps" ]: data_imprint[k] = version_attributes[k] @@ -139,7 +138,6 @@ class LoadGizmo(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps" ]: data_imprint[k] = version_attributes[k] diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_gizmo_ip.py b/client/ayon_core/hosts/nuke/plugins/load/load_gizmo_ip.py index 3112e27811..ed2b1ec458 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_gizmo_ip.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_gizmo_ip.py @@ -73,7 +73,6 @@ class LoadGizmoInputProcess(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps" ]: data_imprint[k] = version_attributes[k] @@ -145,7 +144,6 @@ class LoadGizmoInputProcess(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps" ]: data_imprint[k] = version_attributes[k] diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_image.py b/client/ayon_core/hosts/nuke/plugins/load/load_image.py index d825b621fc..b5fccd8a0d 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_image.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_image.py @@ -133,7 +133,7 @@ class LoadImage(load.LoaderPlugin): "version": version_entity["version"], "colorspace": colorspace, } - for k in ["source", "author", "fps"]: + for k in ["source", "fps"]: data_imprint[k] = version_attributes.get(k, str(None)) r["tile_color"].setValue(int("0x4ecd25ff", 16)) @@ -207,7 +207,6 @@ class LoadImage(load.LoaderPlugin): "colorspace": version_attributes.get("colorSpace"), "source": version_attributes.get("source"), "fps": str(version_attributes.get("fps")), - "author": version_attributes.get("author") } # change color of node diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_model.py b/client/ayon_core/hosts/nuke/plugins/load/load_model.py index 0326e0a4fc..40862cd1e0 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_model.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_model.py @@ -47,7 +47,7 @@ class AlembicModelLoader(load.LoaderPlugin): "version": version_entity["version"] } # add attributes from the version to imprint to metadata knob - for k in ["source", "author", "fps"]: + for k in ["source", "fps"]: data_imprint[k] = version_attributes[k] # getting file path @@ -130,7 +130,7 @@ class AlembicModelLoader(load.LoaderPlugin): } # add additional metadata from the version to imprint to Avalon knob - for k in ["source", "author", "fps"]: + for k in ["source", "fps"]: data_imprint[k] = version_attributes[k] # getting file path diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_script_precomp.py b/client/ayon_core/hosts/nuke/plugins/load/load_script_precomp.py index 3e554f9d3b..d6699be164 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_script_precomp.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_script_precomp.py @@ -55,7 +55,6 @@ class LinkAsGroup(load.LoaderPlugin): "handleStart", "handleEnd", "source", - "author", "fps" ]: data_imprint[k] = version_attributes[k] @@ -131,7 +130,6 @@ class LinkAsGroup(load.LoaderPlugin): "colorspace": version_attributes.get("colorSpace"), "source": version_attributes.get("source"), "fps": version_attributes.get("fps"), - "author": version_attributes.get("author") } # Update the imprinted representation From 7f4385c9a23020b044a7a34a3de4aec6f3491543 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 14 May 2024 12:33:44 +0200 Subject: [PATCH 178/269] remove unused imports --- server_addon/traypublisher/server/settings/publish_plugins.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server_addon/traypublisher/server/settings/publish_plugins.py b/server_addon/traypublisher/server/settings/publish_plugins.py index dc659f6110..99a0bbf107 100644 --- a/server_addon/traypublisher/server/settings/publish_plugins.py +++ b/server_addon/traypublisher/server/settings/publish_plugins.py @@ -1,10 +1,6 @@ -from pydantic import validator - from ayon_server.settings import ( BaseSettingsModel, SettingsField, - task_types_enum, - ensure_unique_names ) From 53b25cb77e65a48ca10149d2eff743e6cf13fd3c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 14 May 2024 13:28:41 +0200 Subject: [PATCH 179/269] fix import --- client/ayon_core/modules/royalrender/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/modules/royalrender/api.py b/client/ayon_core/modules/royalrender/api.py index a69f88c43c..ef715811c5 100644 --- a/client/ayon_core/modules/royalrender/api.py +++ b/client/ayon_core/modules/royalrender/api.py @@ -7,7 +7,7 @@ from ayon_core.lib import Logger, run_subprocess, AYONSettingsRegistry from ayon_core.lib.vendor_bin_utils import find_tool_in_custom_paths from .rr_job import SubmitFile -from .rr_job import RRjob, SubmitterParameter # noqa F401 +from .rr_job import RRJob, SubmitterParameter # noqa F401 class Api: From c5b0a1e0cebf5c4c6cbf8768d41ead634ba07a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 14 May 2024 14:19:00 +0200 Subject: [PATCH 180/269] :bug: fix merge --- client/ayon_core/plugins/publish/integrate.py | 68 ------------------- 1 file changed, 68 deletions(-) diff --git a/client/ayon_core/plugins/publish/integrate.py b/client/ayon_core/plugins/publish/integrate.py index 33dc3024d1..865b566e6e 100644 --- a/client/ayon_core/plugins/publish/integrate.py +++ b/client/ayon_core/plugins/publish/integrate.py @@ -108,75 +108,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin): label = "Integrate Asset" order = pyblish.api.IntegratorOrder -<<<<<<< enhancement/AY-4138_remove-explicit-products-type-list -- Incoming Change -======= - families = ["workfile", - "pointcache", - "pointcloud", - "proxyAbc", - "camera", - "animation", - "model", - "maxScene", - "mayaAscii", - "mayaScene", - "setdress", - "layout", - "ass", - "assProxy", - "vdbcache", - "scene", - "vrayproxy", - "vrayscene_layer", - "render", - "prerender", - "imagesequence", - "review", - "rendersetup", - "rig", - "plate", - "look", - "ociolook", - "audio", - "yetiRig", - "yeticache", - "nukenodes", - "gizmo", - "source", - "matchmove", - "image", - "assembly", - "fbx", - "gltf", - "textures", - "action", - "harmony.template", - "harmony.palette", - "editorial", - "background", - "camerarig", - "redshiftproxy", - "effect", - "xgen", - "hda", - "usd", - "staticMesh", - "skeletalMesh", - "mvLook", - "mvUsd", - "mvUsdComposition", - "mvUsdOverride", - "online", - "uasset", - "blendScene", - "yeticacheUE", - "tycache", - "csv_ingest_file", - "editorial_pckg", - "render.local.hou", - ] ->>>>>>> develop -- Current Change default_template_name = "publish" # Representation context keys that should always be written to From 1b05428eb73087b222890509e0a12c0e59a90654 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 10:17:30 +0200 Subject: [PATCH 181/269] expand default settings for readability --- server/settings/main.py | 42 ++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/server/settings/main.py b/server/settings/main.py index d1cee32afa..40e16e7e91 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -268,26 +268,50 @@ DEFAULT_VALUES = { }, "studio_name": "", "studio_code": "", - "environments": '{\n"STUDIO_SW": {\n "darwin": "/mnt/REPO_SW",\n "linux": "/mnt/REPO_SW",\n "windows": "P:/REPO_SW"\n }\n}', + "environments": json.dumps( + { + "STUDIO_SW": { + "darwin": "/mnt/REPO_SW", + "linux": "/mnt/REPO_SW", + "windows": "P:/REPO_SW" + } + }, + indent=4 + ), "tools": DEFAULT_TOOLS_VALUES, - "version_start_category": {"profiles": []}, + "version_start_category": { + "profiles": [] + }, "publish": DEFAULT_PUBLISH_VALUES, "project_folder_structure": json.dumps( { "__project_root__": { "prod": {}, "resources": { - "footage": {"plates": {}, "offline": {}}, + "footage": { + "plates": {}, + "offline": {} + }, "audio": {}, - "art_dept": {}, + "art_dept": {} }, "editorial": {}, - "assets": {"characters": {}, "locations": {}}, - "shots": {}, + "assets": { + "characters": {}, + "locations": {} + }, + "shots": {} } }, - indent=4, + indent=4 ), - "project_plugins": {"windows": [], "darwin": [], "linux": []}, - "project_environments": "{}", + "project_plugins": { + "windows": [], + "darwin": [], + "linux": [] + }, + "project_environments": json.dumps( + {}, + indent=4 + ) } From c6a396de4f8850a1acf56125a82a8248a6666fc4 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 15 May 2024 17:15:07 +0200 Subject: [PATCH 182/269] AY-1110 - updated variable to be more descriptive Bump up version --- server_addon/deadline/package.py | 2 +- server_addon/deadline/server/settings/main.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/server_addon/deadline/package.py b/server_addon/deadline/package.py index 25ba1c1166..e26734c813 100644 --- a/server_addon/deadline/package.py +++ b/server_addon/deadline/package.py @@ -1,3 +1,3 @@ name = "deadline" title = "Deadline" -version = "0.1.11" +version = "0.1.12" diff --git a/server_addon/deadline/server/settings/main.py b/server_addon/deadline/server/settings/main.py index 5d42b9b1ef..47ad72a86f 100644 --- a/server_addon/deadline/server/settings/main.py +++ b/server_addon/deadline/server/settings/main.py @@ -38,10 +38,9 @@ class ServerItemSubmodel(BaseSettingsModel): name: str = SettingsField(title="Name") value: str = SettingsField(title="Url") require_authentication: bool = SettingsField( - False, - title="Require authentication") - ssl: bool = SettingsField(False, - title="SSL") + False, title="Require authentication") + not_verify_ssl: bool = SettingsField( + False, title="Don't verify SSL") class DeadlineSettings(BaseSettingsModel): @@ -78,7 +77,7 @@ DEFAULT_VALUES = { "name": "default", "value": "http://127.0.0.1:8082", "require_authentication": False, - "ssl": False + "not_verify_ssl": False } ], "deadline_server": "default", From e9697884e98ce02dc603fdae81155e114370e1a3 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 15 May 2024 17:18:13 +0200 Subject: [PATCH 183/269] AY-1110 - use field from Setttings instead of OPENPYPE_DONT_VERIFY_SSL --- .../deadline/abstract_submit_deadline.py | 35 +++++++------------ .../publish/collect_user_credentials.py | 3 ++ .../publish/submit_blender_deadline.py | 5 +-- .../publish/submit_celaction_deadline.py | 6 ++-- .../plugins/publish/submit_fusion_deadline.py | 3 +- .../plugins/publish/submit_max_deadline.py | 16 ++++++--- .../plugins/publish/submit_maya_deadline.py | 18 +++++++--- .../plugins/publish/submit_nuke_deadline.py | 8 +++-- .../publish/submit_publish_cache_job.py | 5 +-- .../plugins/publish/submit_publish_job.py | 5 +-- 10 files changed, 62 insertions(+), 42 deletions(-) diff --git a/client/ayon_core/modules/deadline/abstract_submit_deadline.py b/client/ayon_core/modules/deadline/abstract_submit_deadline.py index 00e51100bc..564966b6a0 100644 --- a/client/ayon_core/modules/deadline/abstract_submit_deadline.py +++ b/client/ayon_core/modules/deadline/abstract_submit_deadline.py @@ -29,15 +29,11 @@ from ayon_core.pipeline.publish.lib import ( JSONDecodeError = getattr(json.decoder, "JSONDecodeError", ValueError) -# TODO both 'requests_post' and 'requests_get' should not set 'verify' based -# on environment variable. This should be done in a more controlled way, -# e.g. each deadline url could have checkbox to enabled/disable -# ssl verification. def requests_post(*args, **kwargs): """Wrap request post method. - Disabling SSL certificate validation if ``DONT_VERIFY_SSL`` environment - variable is found. This is useful when Deadline server is + Disabling SSL certificate validation if ``verify`` kwarg is set to False. + This is useful when Deadline server is running with self-signed certificates and its certificate is not added to trusted certificates on client machines. @@ -46,10 +42,6 @@ def requests_post(*args, **kwargs): of defense SSL is providing, and it is not recommended. """ - if 'verify' not in kwargs: - kwargs['verify'] = False if os.getenv("OPENPYPE_DONT_VERIFY_SSL", - True) else True # noqa - auth = kwargs.get("auth") if auth: kwargs["auth"] = tuple(auth) # explicit cast to tuple @@ -61,8 +53,8 @@ def requests_post(*args, **kwargs): def requests_get(*args, **kwargs): """Wrap request get method. - Disabling SSL certificate validation if ``DONT_VERIFY_SSL`` environment - variable is found. This is useful when Deadline server is + Disabling SSL certificate validation if ``verify`` kwarg is set to False. + This is useful when Deadline server is running with self-signed certificates and its certificate is not added to trusted certificates on client machines. @@ -71,9 +63,6 @@ def requests_get(*args, **kwargs): of defense SSL is providing, and it is not recommended. """ - if 'verify' not in kwargs: - kwargs['verify'] = False if os.getenv("OPENPYPE_DONT_VERIFY_SSL", - True) else True # noqa auth = kwargs.get("auth") if auth: kwargs["auth"] = tuple(auth) @@ -466,7 +455,8 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin, self.aux_files = self.get_aux_files() auth = instance.data["deadline"]["auth"] - job_id = self.process_submission(auth) + verify = instance.data["deadline"]["verify"] + job_id = self.process_submission(auth, verify) self.log.info("Submitted job to Deadline: {}.".format(job_id)) # TODO: Find a way that's more generic and not render type specific @@ -479,10 +469,10 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin, job_info=render_job_info, plugin_info=render_plugin_info ) - render_job_id = self.submit(payload, auth) + render_job_id = self.submit(payload, auth, verify) self.log.info("Render job id: %s", render_job_id) - def process_submission(self, auth=None): + def process_submission(self, auth=None, verify=True): """Process data for submission. This takes Deadline JobInfo, PluginInfo, AuxFile, creates payload @@ -493,7 +483,7 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin, """ payload = self.assemble_payload() - return self.submit(payload, auth) + return self.submit(payload, auth, verify) @abstractmethod def get_job_info(self): @@ -583,7 +573,7 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin, "AuxFiles": aux_files or self.aux_files } - def submit(self, payload, auth): + def submit(self, payload, auth, verify): """Submit payload to Deadline API end-point. This takes payload in the form of JSON file and POST it to @@ -592,6 +582,7 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin, Args: payload (dict): dict to become json in deadline submission. auth (tuple): (username, password) + verify (bool): verify SSL certificate if present Returns: str: resulting Deadline job id. @@ -601,8 +592,8 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin, """ url = "{}/api/jobs".format(self._deadline_url) - response = requests_post(url, json=payload, - auth=auth) + response = requests_post( + url, json=payload, auth=auth, verify=verify) if not response.ok: self.log.error("Submission failed!") self.log.error(response.status_code) diff --git a/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py b/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py index 5d03523c89..99d75ecb9e 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py @@ -76,6 +76,9 @@ class CollectDeadlineUserCredentials(pyblish.api.InstancePlugin): ) instance.data["deadline"]["auth"] = None + instance.data["deadline"]["verify"] = ( + not deadline_info["not_verify_ssl"]) + if not deadline_info["require_authentication"]: return # TODO import 'get_addon_site_settings' when available diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py index f5805beb5c..311dbcedd5 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py @@ -174,8 +174,9 @@ class BlenderSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, instance.data["toBeRenderedOn"] = "deadline" payload = self.assemble_payload() - return self.submit(payload, - auth=instance.data["deadline"]["auth"]) + auth = instance.data["deadline"]["auth"] + verify = instance.data["deadline"]["verify"] + return self.submit(payload, auth=auth, verify=verify) def from_published_scene(self): """ diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_celaction_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_celaction_deadline.py index 2220442dac..a17bf0c3ef 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_celaction_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_celaction_deadline.py @@ -193,9 +193,11 @@ class CelactionSubmitDeadline(pyblish.api.InstancePlugin): self.expected_files(instance, render_path) self.log.debug("__ expectedFiles: `{}`".format( instance.data["expectedFiles"])) - + auth = instance.data["deadline"]["auth"] + verify = instance.data["deadline"]["verify"] response = requests_post(self.deadline_url, json=payload, - auth=instance.data["deadline"]["require_authentication"]) + auth=auth, + verify=verify) if not response.ok: self.log.error( diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py index e9b93a47cd..6c70119628 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py @@ -242,7 +242,8 @@ class FusionSubmitDeadline( # E.g. http://192.168.0.1:8082/api/jobs url = "{}/api/jobs".format(deadline_url) auth = instance.data["deadline"]["auth"] - response = requests_post(url, json=payload, auth=auth) + verify = instance.data["deadline"]["verify"] + response = requests_post(url, json=payload, auth=auth, verify=verify) if not response.ok: raise Exception(response.text) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py index e9f6c382c5..ababb01285 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py @@ -181,19 +181,27 @@ class MaxSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, self.log.debug("Submitting 3dsMax render..") project_settings = instance.context.data["project_settings"] + auth = instance.data["deadline"]["auth"] + verify = instance.data["deadline"]["verify"] if instance.data.get("multiCamera"): self.log.debug("Submitting jobs for multiple cameras..") payload = self._use_published_name_for_multiples( payload_data, project_settings) job_infos, plugin_infos = payload for job_info, plugin_info in zip(job_infos, plugin_infos): - self.submit(self.assemble_payload(job_info, plugin_info), - instance.data["deadline"]["auth"]) + self.submit( + self.assemble_payload(job_info, plugin_info), + auth=auth, + verify=verify + ) else: payload = self._use_published_name(payload_data, project_settings) job_info, plugin_info = payload - self.submit(self.assemble_payload(job_info, plugin_info), - instance.data["deadline"]["auth"]) + self.submit( + self.assemble_payload(job_info, plugin_info), + auth=auth, + verify=verify + ) def _use_published_name(self, data, project_settings): # Not all hosts can import these modules. diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py index 250dc8b7ea..f1bc1cb2be 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py @@ -292,7 +292,7 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, return plugin_payload - def process_submission(self, auth=None): + def process_submission(self, auth=None, verify=True): from maya import cmds instance = self._instance @@ -332,8 +332,10 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, if "vrayscene" in instance.data["families"]: self.log.debug("Submitting V-Ray scene render..") vray_export_payload = self._get_vray_export_payload(payload_data) + export_job = self.submit(vray_export_payload, - instance.data["deadline"]["auth"]) + auth=auth, + verify=verify) payload = self._get_vray_render_payload(payload_data) @@ -353,7 +355,8 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, # Submit main render job job_info, plugin_info = payload self.submit(self.assemble_payload(job_info, plugin_info), - instance.data["deadline"]["auth"]) + auth=auth, + verify=verify) def _tile_render(self, payload): """Submit as tile render per frame with dependent assembly jobs.""" @@ -557,13 +560,18 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, # Submit assembly jobs assembly_job_ids = [] num_assemblies = len(assembly_payloads) + auth = instance.data["deadline"]["auth"] + verify = instance.data["deadline"]["verify"] for i, payload in enumerate(assembly_payloads): self.log.debug( "submitting assembly job {} of {}".format(i + 1, num_assemblies) ) - assembly_job_id = self.submit(payload, - instance.data["deadline"]["auth"]) + assembly_job_id = self.submit( + payload, + auth=auth, + verify=verify + ) assembly_job_ids.append(assembly_job_id) instance.data["assemblySubmissionJobs"] = assembly_job_ids 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 ef744ae1e1..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 @@ -424,8 +424,12 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin, self.log.debug("__ expectedFiles: `{}`".format( instance.data["expectedFiles"])) auth = instance.data["deadline"]["auth"] - response = requests_post(self.deadline_url, json=payload, timeout=10, - auth=auth) + verify = instance.data["deadline"]["verify"] + response = requests_post(self.deadline_url, + json=payload, + timeout=10, + auth=auth, + verify=verify) if not response.ok: raise Exception(response.text) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py index ce15eda9a0..103f1355da 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py @@ -210,8 +210,9 @@ class ProcessSubmittedCacheJobOnFarm(pyblish.api.InstancePlugin, url = "{}/api/jobs".format(self.deadline_url) auth = instance.data["deadline"]["auth"] - response = requests_post(url, json=payload, timeout=10, - auth=auth) + verify = instance.data["deadline"]["verify"] + response = requests_post( + url, json=payload, timeout=10, auth=auth, verify=verify) if not response.ok: raise Exception(response.text) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 0f505dce78..64313c5c4d 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -304,8 +304,9 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, url = "{}/api/jobs".format(self.deadline_url) auth = instance.data["deadline"]["auth"] - response = requests_post(url, json=payload, timeout=10, - auth=auth) + verify = instance.data["deadline"]["verify"] + response = requests_post( + url, json=payload, timeout=10, auth=auth, verify=verify) if not response.ok: raise Exception(response.text) From 61fcc3ddecc2121d4947344215cce3dbff8caff5 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 15 May 2024 17:47:37 +0200 Subject: [PATCH 184/269] AY-1110 - use get_addon_site_settings from ayon_api Method was not available previously --- .../deadline/plugins/publish/collect_user_credentials.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py b/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py index 99d75ecb9e..30e3703b58 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py @@ -12,7 +12,7 @@ Provides: """ import pyblish.api -from ayon_api import get_server_api_connection +from ayon_api import get_addon_site_settings from ayon_core.modules.deadline.deadline_module import DeadlineModule from ayon_core.modules.deadline import __version__ @@ -81,9 +81,8 @@ class CollectDeadlineUserCredentials(pyblish.api.InstancePlugin): if not deadline_info["require_authentication"]: return - # TODO import 'get_addon_site_settings' when available - # in public 'ayon_api' - local_settings = get_server_api_connection().get_addon_site_settings( + + local_settings = get_addon_site_settings( DeadlineModule.name, __version__) local_settings = local_settings["local_settings"] for server_info in local_settings: From b300db793a9af3d93e093df074dbf07685440f82 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:28:19 +0200 Subject: [PATCH 185/269] move deprecated functions at the end of file --- client/ayon_core/pipeline/colorspace.py | 215 ++++++++++++------------ 1 file changed, 106 insertions(+), 109 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 3503d0c534..c081b58752 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -195,17 +195,6 @@ def get_colorspace_name_from_filepath( return colorspace_name -# TODO: remove this in future - backward compatibility -@deprecated("get_imageio_file_rules_colorspace_from_filepath") -def get_imageio_colorspace_from_filepath(*args, **kwargs): - return get_imageio_file_rules_colorspace_from_filepath(*args, **kwargs) - -# TODO: remove this in future - backward compatibility -@deprecated("get_imageio_file_rules_colorspace_from_filepath") -def get_colorspace_from_filepath(*args, **kwargs): - return get_imageio_file_rules_colorspace_from_filepath(*args, **kwargs) - - def get_imageio_file_rules_colorspace_from_filepath( filepath, host_name, @@ -394,21 +383,6 @@ def validate_imageio_colorspace_in_config(config_path, colorspace_name): return True -# TODO: remove this in future - backward compatibility -@deprecated("_get_wrapped_with_subprocess") -def get_data_subprocess(config_path, data_type): - """[Deprecated] Get data via subprocess - - Wrapper for Python 2 hosts. - - Args: - config_path (str): path leading to config.ocio file - """ - return _get_wrapped_with_subprocess( - "config", data_type, in_path=config_path, - ) - - def _get_wrapped_with_subprocess(command_group, command, **kwargs): """Get data via subprocess @@ -673,24 +647,6 @@ def get_colorspaces_enumerator_items( return labeled_colorspaces -# TODO: remove this in future - backward compatibility -@deprecated("_get_wrapped_with_subprocess") -def get_colorspace_data_subprocess(config_path): - """[Deprecated] Get colorspace data via subprocess - - Wrapper for Python 2 hosts. - - Args: - config_path (str): path leading to config.ocio file - - Returns: - dict: colorspace and family in couple - """ - return _get_wrapped_with_subprocess( - "config", "get_colorspace", in_path=config_path - ) - - def get_ocio_config_views(config_path): """Get all viewer data @@ -716,71 +672,6 @@ def get_ocio_config_views(config_path): return _get_views_data(config_path) -# TODO: remove this in future - backward compatibility -@deprecated("_get_wrapped_with_subprocess") -def get_views_data_subprocess(config_path): - """[Deprecated] Get viewers data via subprocess - - Wrapper for Python 2 hosts. - - Args: - config_path (str): path leading to config.ocio file - - Returns: - dict: `display/viewer` and viewer data - """ - return _get_wrapped_with_subprocess( - "config", "get_views", in_path=config_path - ) - - -@deprecated("get_imageio_config_preset") -def get_imageio_config( - project_name, - host_name, - project_settings=None, - anatomy_data=None, - anatomy=None, - env=None -): - """Returns config data from settings - - Config path is formatted in `path` key - and original settings input is saved into `template` key. - - Deprecated: - Deprecated since '0.3.1' . Use `get_imageio_config_preset` instead. - - Args: - project_name (str): project name - host_name (str): host name - project_settings (Optional[dict]): Project settings. - anatomy_data (Optional[dict]): anatomy formatting data. - anatomy (Optional[Anatomy]): Anatomy object. - env (Optional[dict]): Environment variables. - - Returns: - dict: config path data or empty dict - - """ - if not anatomy_data: - from .context_tools import get_current_context_template_data - anatomy_data = get_current_context_template_data() - - task_name = anatomy_data.get("task", {}).get("name") - folder_path = anatomy_data.get("folder", {}).get("path") - return get_imageio_config_preset( - project_name, - folder_path, - task_name, - host_name, - anatomy=anatomy, - project_settings=project_settings, - template_data=anatomy_data, - env=env, - ) - - def _get_global_config_data( project_name, host_name, @@ -1437,3 +1328,109 @@ def get_current_context_imageio_config_preset( template_data=template_data, env=env, ) + + +# --- Deprecated functions --- +@deprecated("get_imageio_file_rules_colorspace_from_filepath") +def get_imageio_colorspace_from_filepath(*args, **kwargs): + return get_imageio_file_rules_colorspace_from_filepath(*args, **kwargs) + + +@deprecated("get_imageio_file_rules_colorspace_from_filepath") +def get_colorspace_from_filepath(*args, **kwargs): + return get_imageio_file_rules_colorspace_from_filepath(*args, **kwargs) + + +@deprecated("_get_wrapped_with_subprocess") +def get_colorspace_data_subprocess(config_path): + """[Deprecated] Get colorspace data via subprocess + + Wrapper for Python 2 hosts. + + Args: + config_path (str): path leading to config.ocio file + + Returns: + dict: colorspace and family in couple + """ + return _get_wrapped_with_subprocess( + "config", "get_colorspace", in_path=config_path + ) + + +@deprecated("_get_wrapped_with_subprocess") +def get_views_data_subprocess(config_path): + """[Deprecated] Get viewers data via subprocess + + Wrapper for Python 2 hosts. + + Args: + config_path (str): path leading to config.ocio file + + Returns: + dict: `display/viewer` and viewer data + """ + return _get_wrapped_with_subprocess( + "config", "get_views", in_path=config_path + ) + + +@deprecated("_get_wrapped_with_subprocess") +def get_data_subprocess(config_path, data_type): + """[Deprecated] Get data via subprocess + + Wrapper for Python 2 hosts. + + Args: + config_path (str): path leading to config.ocio file + """ + return _get_wrapped_with_subprocess( + "config", data_type, in_path=config_path, + ) + + +@deprecated("get_imageio_config_preset") +def get_imageio_config( + project_name, + host_name, + project_settings=None, + anatomy_data=None, + anatomy=None, + env=None +): + """Returns config data from settings + + Config path is formatted in `path` key + and original settings input is saved into `template` key. + + Deprecated: + Deprecated since '0.3.1' . Use `get_imageio_config_preset` instead. + + Args: + project_name (str): project name + host_name (str): host name + project_settings (Optional[dict]): Project settings. + anatomy_data (Optional[dict]): anatomy formatting data. + anatomy (Optional[Anatomy]): Anatomy object. + env (Optional[dict]): Environment variables. + + Returns: + dict: config path data or empty dict + + """ + if not anatomy_data: + from .context_tools import get_current_context_template_data + anatomy_data = get_current_context_template_data() + + task_name = anatomy_data.get("task", {}).get("name") + folder_path = anatomy_data.get("folder", {}).get("path") + return get_imageio_config_preset( + project_name, + folder_path, + task_name, + host_name, + anatomy=anatomy, + project_settings=project_settings, + template_data=anatomy_data, + env=env, + ) From 4d398e21371ff8a840d14f35887a4107bbcf46f1 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:32:04 +0200 Subject: [PATCH 186/269] added functions that are using 'PyOpenColorIO' --- client/ayon_core/pipeline/colorspace.py | 170 ++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index c081b58752..562e698f75 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -1294,6 +1294,176 @@ def _get_display_view_colorspace_subprocess(config_path, display, view): return json.load(f) +# --- Implementation of logic using 'PyOpenColorIO' --- +def _get_ocio_config(config_path): + """Helper function to create OCIO config object. + + Args: + config_path (str): Path to config. + + Returns: + PyOpenColorIO.Config: OCIO config for the confing path. + + """ + import PyOpenColorIO + + config_path = os.path.abspath(config_path) + + if not os.path.isfile(config_path): + raise IOError("Input path should be `config.ocio` file") + + return PyOpenColorIO.Config.CreateFromFile(config_path) + + +def _get_config_file_rules_colorspace_from_filepath(config_path, filepath): + """Return found colorspace data found in v2 file rules. + + Args: + config_path (str): path string leading to config.ocio + filepath (str): path string leading to v2 file rules + + Raises: + IOError: Input config does not exist. + + Returns: + dict: aggregated available colorspaces + + """ + config = _get_ocio_config(config_path) + + # TODO: use `parseColorSpaceFromString` instead if ocio v1 + return config.getColorSpaceFromFilepath(str(filepath)) + + +def _get_config_version_data(config_path): + """Return major and minor version info. + + Args: + config_path (str): path string leading to config.ocio + + Raises: + IOError: Input config does not exist. + + Returns: + dict: minor and major keys with values + + """ + config = _get_ocio_config(config_path) + + return { + "major": config.getMajorVersion(), + "minor": config.getMinorVersion() + } + + +def _get_display_view_colorspace_name(config_path, display, view): + """Returns the colorspace attribute of the (display, view) pair. + + Args: + config_path (str): path string leading to config.ocio + display (str): display name e.g. "ACES" + view (str): view name e.g. "sRGB" + + Raises: + IOError: Input config does not exist. + + Returns: + str: view color space name e.g. "Output - sRGB" + + """ + config = _get_ocio_config(config_path) + return config.getDisplayViewColorSpaceName(display, view) + + +def _get_ocio_config_colorspaces(config_path): + """Return all found colorspace data. + + Args: + config_path (str): path string leading to config.ocio + + Raises: + IOError: Input config does not exist. + + Returns: + dict: aggregated available colorspaces + + """ + config = _get_ocio_config(config_path) + + colorspace_data = { + "roles": {}, + "colorspaces": { + color.getName(): { + "family": color.getFamily(), + "categories": list(color.getCategories()), + "aliases": list(color.getAliases()), + "equalitygroup": color.getEqualityGroup(), + } + for color in config.getColorSpaces() + }, + "displays_views": { + f"{view} ({display})": { + "display": display, + "view": view + + } + for display in config.getDisplays() + for view in config.getViews(display) + }, + "looks": {} + } + + # add looks + looks = config.getLooks() + if looks: + colorspace_data["looks"] = { + look.getName(): {"process_space": look.getProcessSpace()} + for look in looks + } + + # add roles + roles = config.getRoles() + if roles: + colorspace_data["roles"] = { + role: {"colorspace": colorspace} + for (role, colorspace) in roles + } + + return colorspace_data + + +def _get_ocio_config_views(config_path): + """Return all found viewer data. + + Args: + config_path (str): path string leading to config.ocio + + Raises: + IOError: Input config does not exist. + + Returns: + dict: aggregated available viewers + + """ + config = _get_ocio_config(config_path) + + output = {} + for display in config.getDisplays(): + for view in config.getViews(display): + colorspace = config.getDisplayViewColorSpaceName(display, view) + # Special token. See https://opencolorio.readthedocs.io/en/latest/guides/authoring/authoring.html#shared-views # noqa + if colorspace == "": + colorspace = display + + output[f"{display}/{view}"] = { + "display": display, + "view": view, + "colorspace": colorspace + } + + return output + + # --- Current context functions --- def get_current_context_imageio_config_preset( anatomy=None, From b0340f4f3b94e1dae75305410dda2c33c70ad03a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:35:42 +0200 Subject: [PATCH 187/269] renamed 'compatibility_check' to 'has_compatible_ocio_package' --- client/ayon_core/pipeline/colorspace.py | 58 ++++++++++++++++--------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 562e698f75..a503c37101 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -107,6 +107,27 @@ def _make_temp_json_file(): os.remove(temporary_json_filepath) +def has_compatible_ocio_package(): + """Current process has available compatible 'PyOpenColorIO'. + + Returns: + bool: True if compatible package is available. + + """ + if CachedData.has_compatible_ocio_package is not None: + return CachedData.has_compatible_ocio_package + + try: + import PyOpenColorIO # noqa: F401 + # TODO validate 'PyOpenColorIO' version + CachedData.has_compatible_ocio_package = True + except ImportError: + CachedData.has_compatible_ocio_package = False + + # compatible + return CachedData.has_compatible_ocio_package + + def get_ocio_config_script_path(): """Get path to ocio wrapper script @@ -261,7 +282,7 @@ def get_config_file_rules_colorspace_from_filepath(config_path, filepath): Returns: Union[str, None]: matching colorspace name """ - if not compatibility_check(): + if not has_compatible_ocio_package(): # python environment is not compatible with PyOpenColorIO # needs to be run in subprocess result_data = _get_wrapped_with_subprocess( @@ -418,28 +439,12 @@ def _get_wrapped_with_subprocess(command_group, command, **kwargs): return json.load(f_) -# TODO: this should be part of ocio_wrapper.py -def compatibility_check(): - """Making sure PyOpenColorIO is importable""" - if CachedData.has_compatible_ocio_package is not None: - return CachedData.has_compatible_ocio_package - - try: - import PyOpenColorIO # noqa: F401 - CachedData.has_compatible_ocio_package = True - except ImportError: - CachedData.has_compatible_ocio_package = False - - # compatible - return CachedData.has_compatible_ocio_package - - # TODO: this should be part of ocio_wrapper.py def compatibility_check_config_version(config_path, major=1, minor=None): """Making sure PyOpenColorIO config version is compatible""" if not CachedData.config_version_data.get(config_path): - if compatibility_check(): + if has_compatible_ocio_package(): # TODO: refactor this so it is not imported but part of this file from ayon_core.scripts.ocio_wrapper import _get_version_data @@ -479,7 +484,7 @@ def get_ocio_config_colorspaces(config_path): dict: colorspace and family in couple """ if not CachedData.ocio_config_colorspaces.get(config_path): - if not compatibility_check(): + if not has_compatible_ocio_package(): # python environment is not compatible with PyOpenColorIO # needs to be run in subprocess config_colorspaces = _get_wrapped_with_subprocess( @@ -659,7 +664,7 @@ def get_ocio_config_views(config_path): Returns: dict: `display/viewer` and viewer data """ - if not compatibility_check(): + if not has_compatible_ocio_package(): # python environment is not compatible with PyOpenColorIO # needs to be run in subprocess return _get_wrapped_with_subprocess( @@ -1250,7 +1255,7 @@ def get_display_view_colorspace_name(config_path, display, view): str: View color space name. e.g. "Output - sRGB" """ - if not compatibility_check(): + if not has_compatible_ocio_package(): # python environment is not compatible with PyOpenColorIO # needs to be run in subprocess return _get_display_view_colorspace_subprocess( @@ -1501,6 +1506,17 @@ def get_current_context_imageio_config_preset( # --- Deprecated functions --- +@deprecated("has_compatible_ocio_package") +def compatibility_check(): + """Making sure PyOpenColorIO is importable + + Deprecated: + Deprecated since '0.3.2'. Use `has_compatible_ocio_package` instead. + """ + + return has_compatible_ocio_package() + + @deprecated("get_imageio_file_rules_colorspace_from_filepath") def get_imageio_colorspace_from_filepath(*args, **kwargs): return get_imageio_file_rules_colorspace_from_filepath(*args, **kwargs) From c668ab49397b564dab51a9f901ef9e76a4974d87 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:38:41 +0200 Subject: [PATCH 188/269] modified ocio wrapper to use new functions --- client/ayon_core/scripts/ocio_wrapper.py | 480 +++++++---------------- 1 file changed, 142 insertions(+), 338 deletions(-) diff --git a/client/ayon_core/scripts/ocio_wrapper.py b/client/ayon_core/scripts/ocio_wrapper.py index 0a78e33c1f..9cbab32956 100644 --- a/client/ayon_core/scripts/ocio_wrapper.py +++ b/client/ayon_core/scripts/ocio_wrapper.py @@ -1,28 +1,31 @@ """OpenColorIO Wrapper. -Only to be interpreted by Python 3. It is run in subprocess in case -Python 2 hosts needs to use it. Or it is used as module for Python 3 -processing. - -Providing functionality: -- get_colorspace - console command - python 2 - - returning all available color spaces - found in input config path. -- _get_colorspace_data - python 3 - module function - - returning all available colorspaces - found in input config path. -- get_views - console command - python 2 - - returning all available viewers - found in input config path. -- _get_views_data - python 3 - module function - - returning all available viewers - found in input config path. +Receive OpenColorIO information and store it in JSON format for processed +that don't have access to OpenColorIO or their version of OpenColorIO is +not compatible. """ -import click import json from pathlib import Path -import PyOpenColorIO as ocio + +import click + +from ayon_core.pipeline.colorspace import ( + has_compatible_ocio_package, + get_display_view_colorspace_name, + get_config_file_rules_colorspace_from_filepath, + get_config_version_data, + get_ocio_config_views, + get_ocio_config_colorspaces, +) + + +def _save_output_to_json_file(output, output_path): + json_path = Path(output_path) + with open(json_path, "w") as stream: + json.dump(output, stream) + + print(f"Data are saved to '{json_path}'") @click.group() @@ -51,383 +54,184 @@ def colorspace(): @config.command( - name="get_colorspace", - help=( - "return all colorspaces from config file " - "--path input arg is required" - ) -) -@click.option("--in_path", required=True, - help="path where to read ocio config file", - type=click.Path(exists=True)) -@click.option("--out_path", required=True, - help="path where to write output json file", - type=click.Path()) -def get_colorspace(in_path, out_path): + name="get_ocio_config_colorspaces", + help="return all colorspaces from config file") +@click.option( + "--config_path", + required=True, + help="OCIO config path to read ocio config file.", + type=click.Path(exists=True)) +@click.option( + "--output_path", + required=True, + help="path where to write output json file", + type=click.Path()) +def _get_ocio_config_colorspaces(config_path, output_path): """Aggregate all colorspace to file. - Python 2 wrapped console command - Args: - in_path (str): config file path string - out_path (str): temp json file path string + config_path (str): config file path string + output_path (str): temp json file path string Example of use: > pyton.exe ./ocio_wrapper.py config get_colorspace - --in_path= --out_path= + --config_path --output_path """ - json_path = Path(out_path) - - out_data = _get_colorspace_data(in_path) - - with open(json_path, "w") as f_: - json.dump(out_data, f_) - - print(f"Colorspace data are saved to '{json_path}'") - - -def _get_colorspace_data(config_path): - """Return all found colorspace data. - - Args: - config_path (str): path string leading to config.ocio - - Raises: - IOError: Input config does not exist. - - Returns: - dict: aggregated available colorspaces - """ - config_path = Path(config_path) - - if not config_path.is_file(): - raise IOError( - f"Input path `{config_path}` should be `config.ocio` file") - - config = ocio.Config().CreateFromFile(str(config_path)) - - colorspace_data = { - "roles": {}, - "colorspaces": { - color.getName(): { - "family": color.getFamily(), - "categories": list(color.getCategories()), - "aliases": list(color.getAliases()), - "equalitygroup": color.getEqualityGroup(), - } - for color in config.getColorSpaces() - }, - "displays_views": { - f"{view} ({display})": { - "display": display, - "view": view - - } - for display in config.getDisplays() - for view in config.getViews(display) - }, - "looks": {} - } - - # add looks - looks = config.getLooks() - if looks: - colorspace_data["looks"] = { - look.getName(): {"process_space": look.getProcessSpace()} - for look in looks - } - - # add roles - roles = config.getRoles() - if roles: - colorspace_data["roles"] = { - role: {"colorspace": colorspace} - for (role, colorspace) in roles - } - - return colorspace_data + _save_output_to_json_file( + get_ocio_config_colorspaces(config_path), + output_path + ) @config.command( - name="get_views", - help=( - "return all viewers from config file " - "--path input arg is required" - ) -) -@click.option("--in_path", required=True, - help="path where to read ocio config file", - type=click.Path(exists=True)) -@click.option("--out_path", required=True, - help="path where to write output json file", - type=click.Path()) -def get_views(in_path, out_path): + name="get_ocio_config_views", + help="All viewers from config file") +@click.option( + "--config_path", + required=True, + help="OCIO config path to read ocio config file.", + type=click.Path(exists=True)) +@click.option( + "--output_path", + required=True, + help="path where to write output json file", + type=click.Path()) +def _get_ocio_config_views(config_path, output_path): """Aggregate all viewers to file. - Python 2 wrapped console command - Args: - in_path (str): config file path string - out_path (str): temp json file path string + config_path (str): config file path string + output_path (str): temp json file path string Example of use: > pyton.exe ./ocio_wrapper.py config get_views \ - --in_path= --out_path= + --config_path --output """ - json_path = Path(out_path) - - out_data = _get_views_data(in_path) - - with open(json_path, "w") as f_: - json.dump(out_data, f_) - - print(f"Viewer data are saved to '{json_path}'") - - -def _get_views_data(config_path): - """Return all found viewer data. - - Args: - config_path (str): path string leading to config.ocio - - Raises: - IOError: Input config does not exist. - - Returns: - dict: aggregated available viewers - """ - config_path = Path(config_path) - - if not config_path.is_file(): - raise IOError("Input path should be `config.ocio` file") - - config = ocio.Config().CreateFromFile(str(config_path)) - - data_ = {} - for display in config.getDisplays(): - for view in config.getViews(display): - colorspace = config.getDisplayViewColorSpaceName(display, view) - # Special token. See https://opencolorio.readthedocs.io/en/latest/guides/authoring/authoring.html#shared-views # noqa - if colorspace == "": - colorspace = display - - data_[f"{display}/{view}"] = { - "display": display, - "view": view, - "colorspace": colorspace - } - - return data_ + _save_output_to_json_file( + get_ocio_config_views(config_path), + output_path + ) @config.command( - name="get_version", - help=( - "return major and minor version from config file " - "--config_path input arg is required" - "--out_path input arg is required" - ) -) -@click.option("--config_path", required=True, - help="path where to read ocio config file", - type=click.Path(exists=True)) -@click.option("--out_path", required=True, - help="path where to write output json file", - type=click.Path()) -def get_version(config_path, out_path): + name="get_config_version_data", + help="Get major and minor version from config file") +@click.option( + "--config_path", + required=True, + help="OCIO config path to read ocio config file.", + type=click.Path(exists=True)) +@click.option( + "--output_path", + required=True, + help="path where to write output json file", + type=click.Path()) +def _get_config_version_data(config_path, output_path): """Get version of config. - Python 2 wrapped console command - Args: config_path (str): ocio config file path string - out_path (str): temp json file path string + output_path (str): temp json file path string Example of use: > pyton.exe ./ocio_wrapper.py config get_version \ - --config_path= --out_path= + --config_path --output_path """ - json_path = Path(out_path) - - out_data = _get_version_data(config_path) - - with open(json_path, "w") as f_: - json.dump(out_data, f_) - - print(f"Config version data are saved to '{json_path}'") - - -def _get_version_data(config_path): - """Return major and minor version info. - - Args: - config_path (str): path string leading to config.ocio - - Raises: - IOError: Input config does not exist. - - Returns: - dict: minor and major keys with values - """ - config_path = Path(config_path) - - if not config_path.is_file(): - raise IOError("Input path should be `config.ocio` file") - - config = ocio.Config().CreateFromFile(str(config_path)) - - return { - "major": config.getMajorVersion(), - "minor": config.getMinorVersion() - } + _save_output_to_json_file( + get_config_version_data(config_path), + output_path + ) @colorspace.command( name="get_config_file_rules_colorspace_from_filepath", - help=( - "return colorspace from filepath " - "--config_path - ocio config file path (input arg is required) " - "--filepath - any file path (input arg is required) " - "--out_path - temp json file path (input arg is required)" - ) -) -@click.option("--config_path", required=True, - help="path where to read ocio config file", - type=click.Path(exists=True)) -@click.option("--filepath", required=True, - help="path to file to get colorspace from", - type=click.Path()) -@click.option("--out_path", required=True, - help="path where to write output json file", - type=click.Path()) -def get_config_file_rules_colorspace_from_filepath( - config_path, filepath, out_path + help="Colorspace file rules from filepath") +@click.option( + "--config_path", + required=True, + help="OCIO config path to read ocio config file.", + type=click.Path(exists=True)) +@click.option( + "--filepath", + equired=True, + help="Path to file to get colorspace from.", + type=click.Path()) +@click.option( + "--output_path", + required=True, + help="Path where to write output json file.", + type=click.Path()) +def _get_config_file_rules_colorspace_from_filepath( + config_path, filepath, output_path ): """Get colorspace from file path wrapper. - Python 2 wrapped console command - Args: config_path (str): config file path string filepath (str): path string leading to file - out_path (str): temp json file path string + output_path (str): temp json file path string Example of use: - > pyton.exe ./ocio_wrapper.py \ + > python.exe ./ocio_wrapper.py \ colorspace get_config_file_rules_colorspace_from_filepath \ - --config_path= --filepath= --out_path= + --config_path --filepath --output_path """ - json_path = Path(out_path) - - colorspace = _get_config_file_rules_colorspace_from_filepath( - config_path, filepath) - - with open(json_path, "w") as f_: - json.dump(colorspace, f_) - - print(f"Colorspace name is saved to '{json_path}'") - - -def _get_config_file_rules_colorspace_from_filepath(config_path, filepath): - """Return found colorspace data found in v2 file rules. - - Args: - config_path (str): path string leading to config.ocio - filepath (str): path string leading to v2 file rules - - Raises: - IOError: Input config does not exist. - - Returns: - dict: aggregated available colorspaces - """ - config_path = Path(config_path) - - if not config_path.is_file(): - raise IOError( - f"Input path `{config_path}` should be `config.ocio` file") - - config = ocio.Config().CreateFromFile(str(config_path)) - - # TODO: use `parseColorSpaceFromString` instead if ocio v1 - colorspace = config.getColorSpaceFromFilepath(str(filepath)) - - return colorspace - - -def _get_display_view_colorspace_name(config_path, display, view): - """Returns the colorspace attribute of the (display, view) pair. - - Args: - config_path (str): path string leading to config.ocio - display (str): display name e.g. "ACES" - view (str): view name e.g. "sRGB" - - - Raises: - IOError: Input config does not exist. - - Returns: - view color space name (str) e.g. "Output - sRGB" - """ - - config_path = Path(config_path) - - if not config_path.is_file(): - raise IOError("Input path should be `config.ocio` file") - - config = ocio.Config.CreateFromFile(str(config_path)) - colorspace = config.getDisplayViewColorSpaceName(display, view) - - return colorspace + _save_output_to_json_file( + get_config_file_rules_colorspace_from_filepath(config_path, filepath), + output_path + ) @config.command( name="get_display_view_colorspace_name", help=( - "return default view colorspace name " - "for the given display and view " - "--path input arg is required" - ) -) -@click.option("--in_path", required=True, - help="path where to read ocio config file", - type=click.Path(exists=True)) -@click.option("--out_path", required=True, - help="path where to write output json file", - type=click.Path()) -@click.option("--display", required=True, - help="display name", - type=click.STRING) -@click.option("--view", required=True, - help="view name", - type=click.STRING) -def get_display_view_colorspace_name(in_path, out_path, - display, view): + "Default view colorspace name for the given display and view" + )) +@click.option( + "--config_path", + required=True, + help="path where to read ocio config file", + type=click.Path(exists=True)) +@click.option( + "--display", + required=True, + help="Display name", + type=click.STRING) +@click.option( + "--view", + required=True, + help="view name", + type=click.STRING) +@click.option( + "--output_path", + required=True, + help="path where to write output json file", + type=click.Path()) +def _get_display_view_colorspace_name( + config_path, display, view, output_path +): """Aggregate view colorspace name to file. Wrapper command for processes without access to OpenColorIO Args: - in_path (str): config file path string - out_path (str): temp json file path string + config_path (str): config file path string + output_path (str): temp json file path string display (str): display name e.g. "ACES" view (str): view name e.g. "sRGB" Example of use: > pyton.exe ./ocio_wrapper.py config \ - get_display_view_colorspace_name --in_path= \ - --out_path= --display= --view= + get_display_view_colorspace_name --config_path \ + --output_path --display --view """ + _save_output_to_json_file( + get_display_view_colorspace_name(config_path, display, view), + output_path + ) - out_data = _get_display_view_colorspace_name(in_path, - display, - view) - with open(out_path, "w") as f: - json.dump(out_data, f) - - print(f"Display view colorspace saved to '{out_path}'") - -if __name__ == '__main__': +if __name__ == "__main__": + if not has_compatible_ocio_package(): + raise RuntimeError("OpenColorIO is not available.") main() From b23faf324903e5c5b4ae2deaa76087c3358b405d Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:40:50 +0200 Subject: [PATCH 189/269] modified existing functions to use functions from colorspace.py --- client/ayon_core/pipeline/colorspace.py | 286 +++++++++++------------- 1 file changed, 132 insertions(+), 154 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index a503c37101..c347638937 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -18,11 +18,10 @@ from ayon_core.lib import ( run_ayon_launcher_process, Logger, ) +from ayon_core.lib.transcoding import VIDEO_EXTENSIONS, IMAGE_EXTENSIONS from ayon_core.pipeline import Anatomy from ayon_core.pipeline.template_data import get_template_data from ayon_core.pipeline.load import get_representation_path_with_anatomy -from ayon_core.lib.transcoding import VIDEO_EXTENSIONS, IMAGE_EXTENSIONS - log = Logger.get_logger(__name__) @@ -281,26 +280,50 @@ def get_config_file_rules_colorspace_from_filepath(config_path, filepath): Returns: Union[str, None]: matching colorspace name + """ - if not has_compatible_ocio_package(): - # python environment is not compatible with PyOpenColorIO - # needs to be run in subprocess + if has_compatible_ocio_package(): + result_data = _get_config_file_rules_colorspace_from_filepath( + config_path, filepath + ) + else: result_data = _get_wrapped_with_subprocess( - "colorspace", "get_config_file_rules_colorspace_from_filepath", + "colorspace", + "get_config_file_rules_colorspace_from_filepath", config_path=config_path, filepath=filepath ) - if result_data: - return result_data[0] - - # TODO: refactor this so it is not imported but part of this file - from ayon_core.scripts.ocio_wrapper import _get_config_file_rules_colorspace_from_filepath # noqa: E501 - - result_data = _get_config_file_rules_colorspace_from_filepath( - config_path, filepath) if result_data: return result_data[0] + return None + + +def get_config_version_data(config_path): + """Return major and minor version info. + + Args: + config_path (str): path string leading to config.ocio + + Raises: + IOError: Input config does not exist. + + Returns: + dict: minor and major keys with values + + """ + if config_path not in CachedData.config_version_data: + if has_compatible_ocio_package(): + version_data = _get_config_version_data(config_path) + else: + version_data = _get_wrapped_with_subprocess( + "config", + "get_config_version_data", + config_path=config_path + ) + CachedData.config_version_data[config_path] = version_data + + return deepcopy(CachedData.config_version_data[config_path]) def parse_colorspace_from_filepath( @@ -394,6 +417,7 @@ def validate_imageio_colorspace_in_config(config_path, colorspace_name): Returns: bool: True if exists + """ colorspaces = get_ocio_config_colorspaces(config_path)["colorspaces"] if colorspace_name not in colorspaces: @@ -405,9 +429,7 @@ def validate_imageio_colorspace_in_config(config_path, colorspace_name): def _get_wrapped_with_subprocess(command_group, command, **kwargs): - """Get data via subprocess - - Wrapper for Python 2 hosts. + """Get data via subprocess. Args: command_group (str): command group name @@ -420,14 +442,16 @@ def _get_wrapped_with_subprocess(command_group, command, **kwargs): with _make_temp_json_file() as tmp_json_path: # Prepare subprocess arguments args = [ - "run", get_ocio_config_script_path(), - command_group, command + "run", + get_ocio_config_script_path(), + command_group, + command ] - for key_, value_ in kwargs.items(): - args.extend(("--{}".format(key_), value_)) + for key, value in kwargs.items(): + args.extend(("--{}".format(key), value)) - args.append("--out_path") + args.append("--output_path") args.append(tmp_json_path) log.info("Executing: {}".format(" ".join(args))) @@ -435,39 +459,23 @@ def _get_wrapped_with_subprocess(command_group, command, **kwargs): run_ayon_launcher_process(*args, logger=log) # return all colorspaces - with open(tmp_json_path, "r") as f_: - return json.load(f_) + with open(tmp_json_path, "r") as stream: + return json.load(stream) -# TODO: this should be part of ocio_wrapper.py def compatibility_check_config_version(config_path, major=1, minor=None): """Making sure PyOpenColorIO config version is compatible""" - if not CachedData.config_version_data.get(config_path): - if has_compatible_ocio_package(): - # TODO: refactor this so it is not imported but part of this file - from ayon_core.scripts.ocio_wrapper import _get_version_data - - CachedData.config_version_data[config_path] = \ - _get_version_data(config_path) - - else: - # python environment is not compatible with PyOpenColorIO - # needs to be run in subprocess - CachedData.config_version_data[config_path] = \ - _get_wrapped_with_subprocess( - "config", "get_version", config_path=config_path - ) + version_data = get_config_version_data(config_path) # check major version - if CachedData.config_version_data[config_path]["major"] != major: + if version_data["major"] != major: return False # check minor version - if minor and CachedData.config_version_data[config_path]["minor"] != minor: + if minor is not None and version_data["minor"] != minor: return False - # compatible return True @@ -482,22 +490,20 @@ def get_ocio_config_colorspaces(config_path): Returns: dict: colorspace and family in couple - """ - if not CachedData.ocio_config_colorspaces.get(config_path): - if not has_compatible_ocio_package(): - # python environment is not compatible with PyOpenColorIO - # needs to be run in subprocess - config_colorspaces = _get_wrapped_with_subprocess( - "config", "get_colorspace", in_path=config_path - ) - else: - # TODO: refactor this so it is not imported but part of this file - from ayon_core.scripts.ocio_wrapper import _get_colorspace_data - config_colorspaces = _get_colorspace_data(config_path) + """ + if config_path not in CachedData.ocio_config_colorspaces: + if has_compatible_ocio_package(): + config_colorspaces = _get_ocio_config_colorspaces(config_path) + else: + config_colorspaces = _get_wrapped_with_subprocess( + "config", + "get_ocio_config_colorspaces", + config_path=config_path + ) CachedData.ocio_config_colorspaces[config_path] = config_colorspaces - return CachedData.ocio_config_colorspaces[config_path] + return deepcopy(CachedData.ocio_config_colorspaces[config_path]) def convert_colorspace_enumerator_item( @@ -571,16 +577,18 @@ def get_colorspaces_enumerator_items( Families can be used for building menu and submenus in gui. Args: - config_items (dict[str,dict]): colorspace data coming from - `get_ocio_config_colorspaces` function - include_aliases (bool): include aliases in result - include_looks (bool): include looks in result - include_roles (bool): include roles in result + config_items (dict[str,dict]): Colorspace data coming from + `get_ocio_config_colorspaces` function. + include_aliases (Optional[bool]): Include aliases in result. + include_looks (Optional[bool]): Include looks in result. + include_roles (Optional[bool]): Include roles in result. + include_display_views (Optional[bool]): Include display views + in result. Returns: - list[tuple[str,str]]: colorspace and family in couple + list[tuple[str, str]]: Colorspace and family in couples. + """ - labeled_colorspaces = [] aliases = set() colorspaces = set() looks = set() @@ -590,64 +598,74 @@ def get_colorspaces_enumerator_items( if items_type == "colorspaces": for color_name, color_data in colorspace_items.items(): if color_data.get("aliases"): - aliases.update([ + aliases.update({ ( "aliases::{}".format(alias_name), "[alias] {} ({})".format(alias_name, color_name) ) for alias_name in color_data["aliases"] - ]) + }) colorspaces.add(( "{}::{}".format(items_type, color_name), "[colorspace] {}".format(color_name) )) elif items_type == "looks": - looks.update([ + looks.update({ ( "{}::{}".format(items_type, name), "[look] {} ({})".format(name, role_data["process_space"]) ) for name, role_data in colorspace_items.items() - ]) + }) elif items_type == "displays_views": - display_views.update([ + display_views.update({ ( "{}::{}".format(items_type, name), "[view (display)] {}".format(name) ) for name, _ in colorspace_items.items() - ]) + }) elif items_type == "roles": - roles.update([ + roles.update({ ( "{}::{}".format(items_type, name), "[role] {} ({})".format(name, role_data["colorspace"]) ) for name, role_data in colorspace_items.items() - ]) + }) - if roles and include_roles: - roles = sorted(roles, key=lambda x: x[0]) - labeled_colorspaces.extend(roles) + def _sort_key_getter(item): + """Use colorspace for sorting.""" + return item[0] - # add colorspaces as second so it is not first in menu - colorspaces = sorted(colorspaces, key=lambda x: x[0]) - labeled_colorspaces.extend(colorspaces) + labeled_colorspaces = [] + if include_roles: + labeled_colorspaces.extend( + sorted(roles, key=_sort_key_getter) + ) - if aliases and include_aliases: - aliases = sorted(aliases, key=lambda x: x[0]) - labeled_colorspaces.extend(aliases) + # Add colorspaces after roles, so it is not first in menu + labeled_colorspaces.extend( + sorted(colorspaces, key=_sort_key_getter) + ) - if looks and include_looks: - looks = sorted(looks, key=lambda x: x[0]) - labeled_colorspaces.extend(looks) + if include_aliases: + labeled_colorspaces.extend( + sorted(aliases, key=_sort_key_getter) + ) - if display_views and include_display_views: - display_views = sorted(display_views, key=lambda x: x[0]) - labeled_colorspaces.extend(display_views) + if include_looks: + labeled_colorspaces.extend( + sorted(looks, key=_sort_key_getter) + ) + + if include_display_views: + labeled_colorspaces.extend( + sorted(display_views, key=_sort_key_getter) + ) return labeled_colorspaces @@ -663,18 +681,16 @@ def get_ocio_config_views(config_path): Returns: dict: `display/viewer` and viewer data + """ - if not has_compatible_ocio_package(): - # python environment is not compatible with PyOpenColorIO - # needs to be run in subprocess - return _get_wrapped_with_subprocess( - "config", "get_views", in_path=config_path - ) + if has_compatible_ocio_package(): + return _get_ocio_config_views(config_path) - # TODO: refactor this so it is not imported but part of this file - from ayon_core.scripts.ocio_wrapper import _get_views_data - - return _get_views_data(config_path) + return _get_wrapped_with_subprocess( + "config", + "get_ocio_config_views", + config_path=config_path + ) def _get_global_config_data( @@ -1255,48 +1271,17 @@ def get_display_view_colorspace_name(config_path, display, view): str: View color space name. e.g. "Output - sRGB" """ - if not has_compatible_ocio_package(): - # python environment is not compatible with PyOpenColorIO - # needs to be run in subprocess - return _get_display_view_colorspace_subprocess( + if has_compatible_ocio_package(): + return _get_display_view_colorspace_name( config_path, display, view ) - - from ayon_core.scripts.ocio_wrapper import _get_display_view_colorspace_name # noqa - - return _get_display_view_colorspace_name(config_path, display, view) - - -def _get_display_view_colorspace_subprocess(config_path, display, view): - """Returns the colorspace attribute of the (display, view) pair - via subprocess. - - Args: - config_path (str): path string leading to config.ocio - display (str): display name e.g. "ACES" - view (str): view name e.g. "sRGB" - - Returns: - view color space name (str) e.g. "Output - sRGB" - - """ - with _make_temp_json_file() as tmp_json_path: - # Prepare subprocess arguments - args = [ - "run", get_ocio_config_script_path(), - "config", "get_display_view_colorspace_name", - "--in_path", config_path, - "--out_path", tmp_json_path, - "--display", display, - "--view", view - ] - log.debug("Executing: {}".format(" ".join(args))) - - run_ayon_launcher_process(*args, logger=log) - - # return default view colorspace name - with open(tmp_json_path, "r") as f: - return json.load(f) + return _get_wrapped_with_subprocess( + "config", + "get_display_view_colorspace_name", + config_path=config_path, + display=display, + view=view + ) # --- Implementation of logic using 'PyOpenColorIO' --- @@ -1531,7 +1516,8 @@ def get_colorspace_from_filepath(*args, **kwargs): def get_colorspace_data_subprocess(config_path): """[Deprecated] Get colorspace data via subprocess - Wrapper for Python 2 hosts. + Deprecated: + Deprecated since OpenPype. Use `_get_wrapped_with_subprocess` instead. Args: config_path (str): path leading to config.ocio file @@ -1540,7 +1526,9 @@ def get_colorspace_data_subprocess(config_path): dict: colorspace and family in couple """ return _get_wrapped_with_subprocess( - "config", "get_colorspace", in_path=config_path + "config", + "get_ocio_config_colorspaces", + config_path=config_path ) @@ -1548,30 +1536,20 @@ def get_colorspace_data_subprocess(config_path): def get_views_data_subprocess(config_path): """[Deprecated] Get viewers data via subprocess - Wrapper for Python 2 hosts. + Deprecated: + Deprecated since OpenPype. Use `_get_wrapped_with_subprocess` instead. Args: config_path (str): path leading to config.ocio file Returns: dict: `display/viewer` and viewer data + """ return _get_wrapped_with_subprocess( - "config", "get_views", in_path=config_path - ) - - -@deprecated("_get_wrapped_with_subprocess") -def get_data_subprocess(config_path, data_type): - """[Deprecated] Get data via subprocess - - Wrapper for Python 2 hosts. - - Args: - config_path (str): path leading to config.ocio file - """ - return _get_wrapped_with_subprocess( - "config", data_type, in_path=config_path, + "config", + "get_ocio_config_views", + config_path=config_path ) From 25fe55aa316f8f5d16bd6c773d0aa3c1a3d07935 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:42:21 +0200 Subject: [PATCH 190/269] validate 'PyOpenColorIO' version --- client/ayon_core/pipeline/colorspace.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index c347638937..c29bdd762d 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -116,13 +116,21 @@ def has_compatible_ocio_package(): if CachedData.has_compatible_ocio_package is not None: return CachedData.has_compatible_ocio_package + is_compatible = False try: - import PyOpenColorIO # noqa: F401 - # TODO validate 'PyOpenColorIO' version - CachedData.has_compatible_ocio_package = True - except ImportError: - CachedData.has_compatible_ocio_package = False + import PyOpenColorIO + # Check if PyOpenColorIO is compatible + # - version 2.0.0 or higher is required + # NOTE version 1 does not have '__version__' attribute + if hasattr(PyOpenColorIO, "__version__"): + version_parts = PyOpenColorIO.__version__.split(".") + major = int(version_parts[0]) + is_compatible = (major, ) >= (2, ) + except ImportError: + pass + + CachedData.has_compatible_ocio_package = is_compatible # compatible return CachedData.has_compatible_ocio_package From 8806463c7789fdcc2ce222576062c759c56c8b19 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:42:30 +0200 Subject: [PATCH 191/269] use raw DeprecationWarning --- client/ayon_core/pipeline/colorspace.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index c29bdd762d..b568e2cdf1 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -36,10 +36,6 @@ class CachedData: } -class DeprecatedWarning(DeprecationWarning): - pass - - def deprecated(new_destination): """Mark functions as deprecated. @@ -64,13 +60,13 @@ def deprecated(new_destination): @functools.wraps(decorated_func) def wrapper(*args, **kwargs): - warnings.simplefilter("always", DeprecatedWarning) + warnings.simplefilter("always", DeprecationWarning) warnings.warn( ( "Call to deprecated function '{}'" "\nFunction was moved or removed.{}" ).format(decorated_func.__name__, warning_message), - category=DeprecatedWarning, + category=DeprecationWarning, stacklevel=4 ) return decorated_func(*args, **kwargs) From 3b93392eb75663351e04de49d2c55cf163cd56cc Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:47:23 +0200 Subject: [PATCH 192/269] fix typo --- client/ayon_core/scripts/ocio_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/scripts/ocio_wrapper.py b/client/ayon_core/scripts/ocio_wrapper.py index 9cbab32956..897e910fa5 100644 --- a/client/ayon_core/scripts/ocio_wrapper.py +++ b/client/ayon_core/scripts/ocio_wrapper.py @@ -153,7 +153,7 @@ def _get_config_version_data(config_path, output_path): type=click.Path(exists=True)) @click.option( "--filepath", - equired=True, + required=True, help="Path to file to get colorspace from.", type=click.Path()) @click.option( From ddbec4ea71ae9e57c9c2a1d9d82abbe01933896f Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 15 May 2024 18:57:04 +0200 Subject: [PATCH 193/269] added docstring to sorter --- client/ayon_core/pipeline/colorspace.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index b568e2cdf1..d9785b61fb 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -642,7 +642,15 @@ def get_colorspaces_enumerator_items( }) def _sort_key_getter(item): - """Use colorspace for sorting.""" + """Use colorspace for sorting. + + Args: + item (tuple[str, str]): Item with colorspace and label. + + Returns: + str: Colorspace. + + """ return item[0] labeled_colorspaces = [] From d353dd145a4c82a72498de87f9dfb32f2cffac09 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 16 May 2024 09:40:53 +0200 Subject: [PATCH 194/269] removed unnecessary command group --- client/ayon_core/pipeline/colorspace.py | 11 +-------- client/ayon_core/scripts/ocio_wrapper.py | 30 ++++-------------------- 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index d9785b61fb..239c187959 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -292,7 +292,6 @@ def get_config_file_rules_colorspace_from_filepath(config_path, filepath): ) else: result_data = _get_wrapped_with_subprocess( - "colorspace", "get_config_file_rules_colorspace_from_filepath", config_path=config_path, filepath=filepath @@ -321,7 +320,6 @@ def get_config_version_data(config_path): version_data = _get_config_version_data(config_path) else: version_data = _get_wrapped_with_subprocess( - "config", "get_config_version_data", config_path=config_path ) @@ -432,11 +430,10 @@ def validate_imageio_colorspace_in_config(config_path, colorspace_name): return True -def _get_wrapped_with_subprocess(command_group, command, **kwargs): +def _get_wrapped_with_subprocess(command, **kwargs): """Get data via subprocess. Args: - command_group (str): command group name command (str): command name **kwargs: command arguments @@ -448,7 +445,6 @@ def _get_wrapped_with_subprocess(command_group, command, **kwargs): args = [ "run", get_ocio_config_script_path(), - command_group, command ] @@ -501,7 +497,6 @@ def get_ocio_config_colorspaces(config_path): config_colorspaces = _get_ocio_config_colorspaces(config_path) else: config_colorspaces = _get_wrapped_with_subprocess( - "config", "get_ocio_config_colorspaces", config_path=config_path ) @@ -699,7 +694,6 @@ def get_ocio_config_views(config_path): return _get_ocio_config_views(config_path) return _get_wrapped_with_subprocess( - "config", "get_ocio_config_views", config_path=config_path ) @@ -1288,7 +1282,6 @@ def get_display_view_colorspace_name(config_path, display, view): config_path, display, view ) return _get_wrapped_with_subprocess( - "config", "get_display_view_colorspace_name", config_path=config_path, display=display, @@ -1538,7 +1531,6 @@ def get_colorspace_data_subprocess(config_path): dict: colorspace and family in couple """ return _get_wrapped_with_subprocess( - "config", "get_ocio_config_colorspaces", config_path=config_path ) @@ -1559,7 +1551,6 @@ def get_views_data_subprocess(config_path): """ return _get_wrapped_with_subprocess( - "config", "get_ocio_config_views", config_path=config_path ) diff --git a/client/ayon_core/scripts/ocio_wrapper.py b/client/ayon_core/scripts/ocio_wrapper.py index 897e910fa5..0414fc59ce 100644 --- a/client/ayon_core/scripts/ocio_wrapper.py +++ b/client/ayon_core/scripts/ocio_wrapper.py @@ -33,27 +33,7 @@ def main(): pass # noqa: WPS100 -@main.group() -def config(): - """Config related commands group - - Example of use: - > pyton.exe ./ocio_wrapper.py config *args - """ - pass # noqa: WPS100 - - -@main.group() -def colorspace(): - """Colorspace related commands group - - Example of use: - > pyton.exe ./ocio_wrapper.py config *args - """ - pass # noqa: WPS100 - - -@config.command( +@main.command( name="get_ocio_config_colorspaces", help="return all colorspaces from config file") @click.option( @@ -83,7 +63,7 @@ def _get_ocio_config_colorspaces(config_path, output_path): ) -@config.command( +@main.command( name="get_ocio_config_views", help="All viewers from config file") @click.option( @@ -113,7 +93,7 @@ def _get_ocio_config_views(config_path, output_path): ) -@config.command( +@main.command( name="get_config_version_data", help="Get major and minor version from config file") @click.option( @@ -143,7 +123,7 @@ def _get_config_version_data(config_path, output_path): ) -@colorspace.command( +@main.command( name="get_config_file_rules_colorspace_from_filepath", help="Colorspace file rules from filepath") @click.option( @@ -182,7 +162,7 @@ def _get_config_file_rules_colorspace_from_filepath( ) -@config.command( +@main.command( name="get_display_view_colorspace_name", help=( "Default view colorspace name for the given display and view" From dc0f1769d5a73ebea1c9e7546d412f744370c65a Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 16 May 2024 12:31:13 +0200 Subject: [PATCH 195/269] Revert "AY-1110 - use get_addon_site_settings from ayon_api" This reverts commit 61fcc3ddecc2121d4947344215cce3dbff8caff5. --- .../deadline/plugins/publish/collect_user_credentials.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py b/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py index 30e3703b58..99d75ecb9e 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_user_credentials.py @@ -12,7 +12,7 @@ Provides: """ import pyblish.api -from ayon_api import get_addon_site_settings +from ayon_api import get_server_api_connection from ayon_core.modules.deadline.deadline_module import DeadlineModule from ayon_core.modules.deadline import __version__ @@ -81,8 +81,9 @@ class CollectDeadlineUserCredentials(pyblish.api.InstancePlugin): if not deadline_info["require_authentication"]: return - - local_settings = get_addon_site_settings( + # TODO import 'get_addon_site_settings' when available + # in public 'ayon_api' + local_settings = get_server_api_connection().get_addon_site_settings( DeadlineModule.name, __version__) local_settings = local_settings["local_settings"] for server_info in local_settings: From 340c07317f32bbfa94b865189cb554a36bb17465 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 16 May 2024 19:38:26 +0800 Subject: [PATCH 196/269] make validator animated reference being optional --- .../hosts/maya/plugins/publish/validate_animated_reference.py | 2 +- server_addon/maya/server/settings/publishers.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py b/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py index 2ba2bff6fc..4e8261d42e 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py +++ b/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py @@ -18,7 +18,7 @@ class ValidateAnimatedReferenceRig(pyblish.api.InstancePlugin, label = "Animated Reference Rig" accepted_controllers = ["transform", "locator"] actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction] - optional = False + optional = True def process(self, instance): if not self.is_active(instance.data): diff --git a/server_addon/maya/server/settings/publishers.py b/server_addon/maya/server/settings/publishers.py index 20523b2ca9..3e8dc704b7 100644 --- a/server_addon/maya/server/settings/publishers.py +++ b/server_addon/maya/server/settings/publishers.py @@ -1448,8 +1448,8 @@ DEFAULT_PUBLISH_SETTINGS = { "active": True }, "ValidateAnimatedReferenceRig": { - "enabled": True, - "optional": False, + "enabled": False, + "optional": True, "active": True }, "ValidateAnimationContent": { From ce194b32febe009e2eec969c2fba77fb8238a319 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 16 May 2024 20:25:03 +0800 Subject: [PATCH 197/269] remove the validator --- .../publish/validate_animated_reference.py | 71 ------------------- .../maya/server/settings/publishers.py | 10 +-- 2 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py diff --git a/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py b/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py deleted file mode 100644 index 4e8261d42e..0000000000 --- a/client/ayon_core/hosts/maya/plugins/publish/validate_animated_reference.py +++ /dev/null @@ -1,71 +0,0 @@ -import pyblish.api -import ayon_core.hosts.maya.api.action -from ayon_core.pipeline.publish import ( - PublishValidationError, - ValidateContentsOrder, - OptionalPyblishPluginMixin -) -from maya import cmds - - -class ValidateAnimatedReferenceRig(pyblish.api.InstancePlugin, - OptionalPyblishPluginMixin): - """Validate all nodes in skeletonAnim_SET are referenced""" - - order = ValidateContentsOrder - hosts = ["maya"] - families = ["animation.fbx"] - label = "Animated Reference Rig" - accepted_controllers = ["transform", "locator"] - actions = [ayon_core.hosts.maya.api.action.SelectInvalidAction] - optional = True - - def process(self, instance): - if not self.is_active(instance.data): - return - animated_sets = instance.data.get("animated_skeleton", []) - if not animated_sets: - self.log.debug( - "No nodes found in skeletonAnim_SET. " - "Skipping validation of animated reference rig..." - ) - return - - for animated_reference in animated_sets: - is_referenced = cmds.referenceQuery( - animated_reference, isNodeReferenced=True) - if not bool(is_referenced): - raise PublishValidationError( - "All the content in skeletonAnim_SET" - " should be referenced nodes" - ) - invalid_controls = self.validate_controls(animated_sets) - if invalid_controls: - raise PublishValidationError( - "All the content in skeletonAnim_SET" - " should be transforms" - ) - - @classmethod - def validate_controls(self, set_members): - """Check if the controller set contains only accepted node types. - - Checks if all its set members are within the hierarchy of the root - Checks if the node types of the set members valid - - Args: - set_members: list of nodes of the skeleton_anim_set - hierarchy: list of nodes which reside under the root node - - Returns: - errors (list) - """ - - # Validate control types - invalid = [] - set_members = cmds.ls(set_members, long=True) - for node in set_members: - if cmds.nodeType(node) not in self.accepted_controllers: - invalid.append(node) - - return invalid diff --git a/server_addon/maya/server/settings/publishers.py b/server_addon/maya/server/settings/publishers.py index 3e8dc704b7..3ff57bab13 100644 --- a/server_addon/maya/server/settings/publishers.py +++ b/server_addon/maya/server/settings/publishers.py @@ -921,10 +921,7 @@ class PublishersModel(BaseSettingsModel): default_factory=BasicValidateModel, title="Validate Animated Reference Rig", ) - ValidateAnimationContent: BasicValidateModel = SettingsField( - default_factory=BasicValidateModel, - title="Validate Animation Content", - ) + ValidateOutRelatedNodeIds: BasicValidateModel = SettingsField( default_factory=BasicValidateModel, title="Validate Animation Out Set Related Node Ids", @@ -1447,11 +1444,6 @@ DEFAULT_PUBLISH_SETTINGS = { "optional": True, "active": True }, - "ValidateAnimatedReferenceRig": { - "enabled": False, - "optional": True, - "active": True - }, "ValidateAnimationContent": { "enabled": True, "optional": False, From cd0bf07939a557744a2bc94d5f67479282b5099c Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 16 May 2024 21:11:32 +0800 Subject: [PATCH 198/269] upversion --- server_addon/maya/package.py | 2 +- server_addon/maya/server/settings/publishers.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/server_addon/maya/package.py b/server_addon/maya/package.py index fe3e3039f5..5ab2fa217c 100644 --- a/server_addon/maya/package.py +++ b/server_addon/maya/package.py @@ -1,3 +1,3 @@ name = "maya" title = "Maya" -version = "0.1.18" +version = "0.1.19" diff --git a/server_addon/maya/server/settings/publishers.py b/server_addon/maya/server/settings/publishers.py index 3ff57bab13..01ac6f4acd 100644 --- a/server_addon/maya/server/settings/publishers.py +++ b/server_addon/maya/server/settings/publishers.py @@ -917,11 +917,10 @@ class PublishersModel(BaseSettingsModel): default_factory=BasicValidateModel, title="Validate Rig Controllers", ) - ValidateAnimatedReferenceRig: BasicValidateModel = SettingsField( + ValidateAnimationContent: BasicValidateModel = SettingsField( default_factory=BasicValidateModel, - title="Validate Animated Reference Rig", + title="Validate Animation Content", ) - ValidateOutRelatedNodeIds: BasicValidateModel = SettingsField( default_factory=BasicValidateModel, title="Validate Animation Out Set Related Node Ids", From 2536f86c221099a70cd7bbf7a226593674c24c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Thu, 16 May 2024 22:54:02 +0200 Subject: [PATCH 199/269] :recycle: fix UE name on linux and darwin --- client/ayon_core/hosts/unreal/lib.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/hosts/unreal/lib.py b/client/ayon_core/hosts/unreal/lib.py index 37122b2096..185853a0aa 100644 --- a/client/ayon_core/hosts/unreal/lib.py +++ b/client/ayon_core/hosts/unreal/lib.py @@ -80,17 +80,21 @@ def get_engine_versions(env=None): def get_editor_exe_path(engine_path: Path, engine_version: str) -> Path: """Get UE Editor executable path.""" ue_path = engine_path / "Engine/Binaries" + + ue_name = "UnrealEditor" + + # handle older versions of Unreal Engine + if engine_version.split(".")[0] == "4": + ue_name = "UE4Editor" + if platform.system().lower() == "windows": - if engine_version.split(".")[0] == "4": - ue_path /= "Win64/UE4Editor.exe" - elif engine_version.split(".")[0] == "5": - ue_path /= "Win64/UnrealEditor.exe" + ue_path /= f"Win64/{ue_name}.exe" elif platform.system().lower() == "linux": - ue_path /= "Linux/UE4Editor" + ue_path /= f"Linux/{ue_name}" elif platform.system().lower() == "darwin": - ue_path /= "Mac/UE4Editor" + ue_path /= f"Mac/{ue_name}" return ue_path From 242326093eaa77728d15785904a3db92496579e2 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 17 May 2024 13:12:43 +0200 Subject: [PATCH 200/269] 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 cc7769dd21fc2d8312220d5f61f07b7c6eef5038 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 11:13:11 +0200 Subject: [PATCH 201/269] ValidateContainers have profile based settings --- .../plugins/publish/validate_containers.py | 40 +++++++++++++-- server/settings/publish_plugins.py | 49 +++++++++++++++++++ 2 files changed, 85 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/plugins/publish/validate_containers.py b/client/ayon_core/plugins/publish/validate_containers.py index bd21ec9693..21736f0659 100644 --- a/client/ayon_core/plugins/publish/validate_containers.py +++ b/client/ayon_core/plugins/publish/validate_containers.py @@ -1,6 +1,11 @@ import pyblish.api + +from ayon_core.lib import filter_profiles +from ayon_core.host import ILoadHost from ayon_core.pipeline.load import any_outdated_containers from ayon_core.pipeline import ( + get_current_host_name, + registered_host, PublishXmlValidationError, OptionalPyblishPluginMixin ) @@ -18,17 +23,44 @@ class ShowInventory(pyblish.api.Action): host_tools.show_scene_inventory() -class ValidateContainers(OptionalPyblishPluginMixin, - pyblish.api.ContextPlugin): - +class ValidateContainers( + OptionalPyblishPluginMixin, + pyblish.api.ContextPlugin +): """Containers are must be updated to latest version on publish.""" label = "Validate Outdated Containers" order = pyblish.api.ValidatorOrder - hosts = ["maya", "houdini", "nuke", "harmony", "photoshop", "aftereffects"] + optional = True actions = [ShowInventory] + @classmethod + def apply_settings(cls, settings): + # Disable plugin if host does not inherit from 'ILoadHost' + # - not a host that can load containers + host = registered_host() + if not isinstance(host, ILoadHost): + cls.enabled = False + return + + # Disable if no profile is found for the current host + profile = filter_profiles( + settings["core"]["publish"]["ValidateContainers"]["profiles"], + {"host_names": get_current_host_name()} + ) + if not profile: + cls.enabled = False + return + + # Apply settings from profile + for attr_name in { + "enabled", + "optional", + "active", + }: + setattr(cls, attr_name, profile[attr_name]) + def process(self, context): if not self.is_active(context.data): return diff --git a/server/settings/publish_plugins.py b/server/settings/publish_plugins.py index e61bf6986b..f487438109 100644 --- a/server/settings/publish_plugins.py +++ b/server/settings/publish_plugins.py @@ -59,6 +59,32 @@ class CollectFramesFixDefModel(BaseSettingsModel): ) +class ValidateContainersProfile(BaseSettingsModel): + _layout = "expanded" + # Filtering + host_names: list[str] = SettingsField( + default_factory=list, + title="Host names" + ) + # Profile values + enabled: bool = SettingsField(True) + optional: bool = SettingsField(True) + active: bool = SettingsField(True) + + +class ValidateContainersModel(BaseSettingsModel): + """Validate if Publishing intent was selected. + + It is possible to disable validation for specific publishing context + with profiles. + """ + + _isGroup = True + profiles: list[ValidateContainersProfile] = SettingsField( + default_factory=list + ) + + class ValidateIntentProfile(BaseSettingsModel): _layout = "expanded" hosts: list[str] = SettingsField(default_factory=list, title="Host names") @@ -770,6 +796,10 @@ class PublishPuginsModel(BaseSettingsModel): default_factory=ValidateBaseModel, title="Validate Version" ) + ValidateContainers: ValidateContainersModel = SettingsField( + default_factory=ValidateContainersModel, + title="Validate Containers" + ) ValidateIntent: ValidateIntentModel = SettingsField( default_factory=ValidateIntentModel, title="Validate Intent" @@ -855,6 +885,25 @@ DEFAULT_PUBLISH_VALUES = { "optional": False, "active": True }, + "ValidateContainers": { + "profiles": [ + { + # Default host names are based on original + # filter of ValidateContainer pyblish plugin + "host_names": [ + "maya", + "houdini", + "nuke", + "harmony", + "photoshop", + "aftereffects" + ], + "enabled": True, + "optional": True, + "active": True + } + ] + }, "ValidateIntent": { "enabled": False, "profiles": [] From 0101527af2864458d3c0728ab3ae508dd7a7bafb Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 11:14:28 +0200 Subject: [PATCH 202/269] add titles --- server/settings/publish_plugins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/settings/publish_plugins.py b/server/settings/publish_plugins.py index f487438109..f40cc1fefe 100644 --- a/server/settings/publish_plugins.py +++ b/server/settings/publish_plugins.py @@ -67,9 +67,9 @@ class ValidateContainersProfile(BaseSettingsModel): title="Host names" ) # Profile values - enabled: bool = SettingsField(True) - optional: bool = SettingsField(True) - active: bool = SettingsField(True) + enabled: bool = SettingsField(True, title="Enabled") + optional: bool = SettingsField(True, title="Optional") + active: bool = SettingsField(True, title="Active") class ValidateContainersModel(BaseSettingsModel): From d2a0719de3ba30a74f846a67082c7a02e0f1855b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 11:28:02 +0200 Subject: [PATCH 203/269] remove 'ValidateContainers' settings from other hosts --- server_addon/aftereffects/package.py | 2 +- .../server/settings/publish_plugins.py | 15 --------------- server_addon/harmony/package.py | 2 +- server_addon/harmony/server/settings/main.py | 5 ----- .../harmony/server/settings/publish_plugins.py | 13 ------------- server_addon/maya/package.py | 2 +- .../maya/server/settings/publishers.py | 9 --------- server_addon/nuke/package.py | 2 +- .../nuke/server/settings/publish_plugins.py | 9 --------- server_addon/photoshop/package.py | 2 +- .../server/settings/publish_plugins.py | 18 ------------------ 11 files changed, 5 insertions(+), 74 deletions(-) diff --git a/server_addon/aftereffects/package.py b/server_addon/aftereffects/package.py index a680b37602..7a2f9bc7af 100644 --- a/server_addon/aftereffects/package.py +++ b/server_addon/aftereffects/package.py @@ -1,3 +1,3 @@ name = "aftereffects" title = "AfterEffects" -version = "0.1.3" +version = "0.1.4" diff --git a/server_addon/aftereffects/server/settings/publish_plugins.py b/server_addon/aftereffects/server/settings/publish_plugins.py index 61d67f26d3..a9f30c6686 100644 --- a/server_addon/aftereffects/server/settings/publish_plugins.py +++ b/server_addon/aftereffects/server/settings/publish_plugins.py @@ -22,12 +22,6 @@ class ValidateSceneSettingsModel(BaseSettingsModel): ) -class ValidateContainersModel(BaseSettingsModel): - enabled: bool = SettingsField(True, title="Enabled") - optional: bool = SettingsField(True, title="Optional") - active: bool = SettingsField(True, title="Active") - - class AfterEffectsPublishPlugins(BaseSettingsModel): CollectReview: CollectReviewPluginModel = SettingsField( default_factory=CollectReviewPluginModel, @@ -37,10 +31,6 @@ class AfterEffectsPublishPlugins(BaseSettingsModel): default_factory=ValidateSceneSettingsModel, title="Validate Scene Settings", ) - ValidateContainers: ValidateContainersModel = SettingsField( - default_factory=ValidateContainersModel, - title="Validate Containers", - ) AE_PUBLISH_PLUGINS_DEFAULTS = { @@ -58,9 +48,4 @@ AE_PUBLISH_PLUGINS_DEFAULTS = { ".*" ] }, - "ValidateContainers": { - "enabled": True, - "optional": True, - "active": True, - } } diff --git a/server_addon/harmony/package.py b/server_addon/harmony/package.py index 83e88e7d57..00824cedef 100644 --- a/server_addon/harmony/package.py +++ b/server_addon/harmony/package.py @@ -1,3 +1,3 @@ name = "harmony" title = "Harmony" -version = "0.1.2" +version = "0.1.3" diff --git a/server_addon/harmony/server/settings/main.py b/server_addon/harmony/server/settings/main.py index 9c780b63c2..8a72c966d8 100644 --- a/server_addon/harmony/server/settings/main.py +++ b/server_addon/harmony/server/settings/main.py @@ -45,11 +45,6 @@ DEFAULT_HARMONY_SETTING = { "optional": True, "active": True }, - "ValidateContainers": { - "enabled": True, - "optional": True, - "active": True - }, "ValidateSceneSettings": { "enabled": True, "optional": True, diff --git a/server_addon/harmony/server/settings/publish_plugins.py b/server_addon/harmony/server/settings/publish_plugins.py index c9e7c515e4..2d976389f6 100644 --- a/server_addon/harmony/server/settings/publish_plugins.py +++ b/server_addon/harmony/server/settings/publish_plugins.py @@ -18,14 +18,6 @@ class ValidateAudioPlugin(BaseSettingsModel): active: bool = SettingsField(True, title="Active") -class ValidateContainersPlugin(BaseSettingsModel): - """Check if loaded container is scene are latest versions.""" - _isGroup = True - enabled: bool = True - optional: bool = SettingsField(False, title="Optional") - active: bool = SettingsField(True, title="Active") - - class ValidateSceneSettingsPlugin(BaseSettingsModel): """Validate if FrameStart, FrameEnd and Resolution match shot data in DB. Use regular expressions to limit validations only on particular asset @@ -63,11 +55,6 @@ class HarmonyPublishPlugins(BaseSettingsModel): default_factory=ValidateAudioPlugin, ) - ValidateContainers: ValidateContainersPlugin = SettingsField( - title="Validate Containers", - default_factory=ValidateContainersPlugin, - ) - ValidateSceneSettings: ValidateSceneSettingsPlugin = SettingsField( title="Validate Scene Settings", default_factory=ValidateSceneSettingsPlugin, diff --git a/server_addon/maya/package.py b/server_addon/maya/package.py index 5ab2fa217c..4537c23eaa 100644 --- a/server_addon/maya/package.py +++ b/server_addon/maya/package.py @@ -1,3 +1,3 @@ name = "maya" title = "Maya" -version = "0.1.19" +version = "0.1.20" diff --git a/server_addon/maya/server/settings/publishers.py b/server_addon/maya/server/settings/publishers.py index 01ac6f4acd..9c552e17fa 100644 --- a/server_addon/maya/server/settings/publishers.py +++ b/server_addon/maya/server/settings/publishers.py @@ -634,10 +634,6 @@ class PublishersModel(BaseSettingsModel): title="Validate Instance In Context", section="Validators" ) - ValidateContainers: BasicValidateModel = SettingsField( - default_factory=BasicValidateModel, - title="Validate Containers" - ) ValidateFrameRange: ValidateFrameRangeModel = SettingsField( default_factory=ValidateFrameRangeModel, title="Validate Frame Range" @@ -1059,11 +1055,6 @@ DEFAULT_PUBLISH_SETTINGS = { "optional": True, "active": True }, - "ValidateContainers": { - "enabled": True, - "optional": True, - "active": True - }, "ValidateFrameRange": { "enabled": True, "optional": True, diff --git a/server_addon/nuke/package.py b/server_addon/nuke/package.py index e522b9fb5d..bc166bd14e 100644 --- a/server_addon/nuke/package.py +++ b/server_addon/nuke/package.py @@ -1,3 +1,3 @@ name = "nuke" title = "Nuke" -version = "0.1.12" +version = "0.1.13" diff --git a/server_addon/nuke/server/settings/publish_plugins.py b/server_addon/nuke/server/settings/publish_plugins.py index e67f7be24f..6c37ecd37a 100644 --- a/server_addon/nuke/server/settings/publish_plugins.py +++ b/server_addon/nuke/server/settings/publish_plugins.py @@ -231,10 +231,6 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=OptionalPluginModel, section="Validators" ) - ValidateContainers: OptionalPluginModel = SettingsField( - title="Validate Containers", - default_factory=OptionalPluginModel - ) ValidateKnobs: ValidateKnobsModel = SettingsField( title="Validate Knobs", default_factory=ValidateKnobsModel @@ -300,11 +296,6 @@ DEFAULT_PUBLISH_PLUGIN_SETTINGS = { "optional": True, "active": True }, - "ValidateContainers": { - "enabled": True, - "optional": True, - "active": True - }, "ValidateKnobs": { "enabled": False, "knobs": "\n".join([ diff --git a/server_addon/photoshop/package.py b/server_addon/photoshop/package.py index 25615529d1..22043f951c 100644 --- a/server_addon/photoshop/package.py +++ b/server_addon/photoshop/package.py @@ -1,3 +1,3 @@ name = "photoshop" title = "Photoshop" -version = "0.1.2" +version = "0.1.3" diff --git a/server_addon/photoshop/server/settings/publish_plugins.py b/server_addon/photoshop/server/settings/publish_plugins.py index d04faaf53a..149b08beb4 100644 --- a/server_addon/photoshop/server/settings/publish_plugins.py +++ b/server_addon/photoshop/server/settings/publish_plugins.py @@ -83,14 +83,6 @@ class CollectVersionPlugin(BaseSettingsModel): enabled: bool = SettingsField(True, title="Enabled") -class ValidateContainersPlugin(BaseSettingsModel): - """Check that workfile contains latest version of loaded items""" # noqa - _isGroup = True - enabled: bool = True - optional: bool = SettingsField(False, title="Optional") - active: bool = SettingsField(True, title="Active") - - class ValidateNamingPlugin(BaseSettingsModel): """Validate naming of products and layers""" # noqa invalid_chars: str = SettingsField( @@ -154,11 +146,6 @@ class PhotoshopPublishPlugins(BaseSettingsModel): default_factory=CollectVersionPlugin, ) - ValidateContainers: ValidateContainersPlugin = SettingsField( - title="Validate Containers", - default_factory=ValidateContainersPlugin, - ) - ValidateNaming: ValidateNamingPlugin = SettingsField( title="Validate naming of products and layers", default_factory=ValidateNamingPlugin, @@ -187,11 +174,6 @@ DEFAULT_PUBLISH_SETTINGS = { "CollectVersion": { "enabled": False }, - "ValidateContainers": { - "enabled": True, - "optional": True, - "active": True - }, "ValidateNaming": { "invalid_chars": "[ \\\\/+\\*\\?\\(\\)\\[\\]\\{\\}:,;]", "replace_char": "_" From bb05691289def08af1d69449cd284f880839097e Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 11:48:41 +0200 Subject: [PATCH 204/269] remove houdini settings too --- server_addon/houdini/package.py | 2 +- server_addon/houdini/server/settings/publish.py | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 6c81eba439..06b034da38 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,3 +1,3 @@ name = "houdini" title = "Houdini" -version = "0.2.14" +version = "0.2.15" diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 9e8e796aff..4a0c022f23 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -77,10 +77,6 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=CollectLocalRenderInstancesModel, title="Collect Local Render Instances." ) - ValidateContainers: BasicValidateModel = SettingsField( - default_factory=BasicValidateModel, - title="Validate Latest Containers.", - section="Validators") ValidateInstanceInContextHoudini: BasicValidateModel = SettingsField( default_factory=BasicValidateModel, title="Validate Instance is in same Context.") @@ -119,11 +115,6 @@ DEFAULT_HOUDINI_PUBLISH_SETTINGS = { ] } }, - "ValidateContainers": { - "enabled": True, - "optional": True, - "active": True - }, "ValidateInstanceInContextHoudini": { "enabled": True, "optional": True, From d4ca6bf3f644615ca49e3b43c649000f05f35b6f Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 12:14:47 +0200 Subject: [PATCH 205/269] use kwarg to pass project entity --- client/ayon_core/pipeline/colorspace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/colorspace.py b/client/ayon_core/pipeline/colorspace.py index 239c187959..099616ff4a 100644 --- a/client/ayon_core/pipeline/colorspace.py +++ b/client/ayon_core/pipeline/colorspace.py @@ -920,7 +920,7 @@ def get_imageio_config_preset( project_entity = None if anatomy is None: project_entity = ayon_api.get_project(project_name) - anatomy = Anatomy(project_name, project_entity) + anatomy = Anatomy(project_name, project_entity=project_entity) if env is None: env = dict(os.environ.items()) From 7340ab081d0b7bc197eb205eeaad57571b8e73f3 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 12:21:08 +0200 Subject: [PATCH 206/269] do not lower task name when it can be None --- client/ayon_core/tools/push_to_project/models/integrate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 6e43050c05..5937ffa4da 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -723,7 +723,6 @@ class ProjectPushItemProcess: dst_project_name = self._item.dst_project_name dst_folder_id = self._item.dst_folder_id dst_task_name = self._item.dst_task_name - dst_task_name_low = dst_task_name.lower() new_folder_name = self._item.new_folder_name if not dst_folder_id and not new_folder_name: self._status.set_failed( @@ -765,7 +764,7 @@ class ProjectPushItemProcess: dst_project_name, folder_ids=[folder_entity["id"]] ) } - task_info = folder_tasks.get(dst_task_name_low) + task_info = folder_tasks.get(dst_task_name.lower()) if not task_info: self._status.set_failed( f"Could find task with name \"{dst_task_name}\"" From 45611ea27e8e3f8106df6dc45075a02e2a1145fd Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 12:35:42 +0200 Subject: [PATCH 207/269] call update on viewport instead on view --- client/ayon_core/tools/launcher/ui/actions_widget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/tools/launcher/ui/actions_widget.py b/client/ayon_core/tools/launcher/ui/actions_widget.py index a225827418..d03aceb009 100644 --- a/client/ayon_core/tools/launcher/ui/actions_widget.py +++ b/client/ayon_core/tools/launcher/ui/actions_widget.py @@ -359,7 +359,8 @@ class ActionsWidget(QtWidgets.QWidget): def _on_model_refresh(self): self._proxy_model.sort(0) # Force repaint all items - self._view.update() + viewport = self._view.viewport() + viewport.update() def _on_animation(self): time_now = time.time() From 9dcfd06ed62599f4544e6c86af07e712da972b83 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 14:53:29 +0200 Subject: [PATCH 208/269] change "profiles" key to "plugin_state_profiles" --- .../ayon_core/plugins/publish/validate_containers.py | 10 ++++++++-- server/settings/publish_plugins.py | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/plugins/publish/validate_containers.py b/client/ayon_core/plugins/publish/validate_containers.py index 21736f0659..3fd5083b4e 100644 --- a/client/ayon_core/plugins/publish/validate_containers.py +++ b/client/ayon_core/plugins/publish/validate_containers.py @@ -45,9 +45,15 @@ class ValidateContainers( return # Disable if no profile is found for the current host + profiles = ( + settings + ["core"] + ["publish"] + ["ValidateContainers"] + ["plugin_state_profiles"] + ) profile = filter_profiles( - settings["core"]["publish"]["ValidateContainers"]["profiles"], - {"host_names": get_current_host_name()} + profiles, {"host_names": get_current_host_name()} ) if not profile: cls.enabled = False diff --git a/server/settings/publish_plugins.py b/server/settings/publish_plugins.py index f40cc1fefe..0c19655035 100644 --- a/server/settings/publish_plugins.py +++ b/server/settings/publish_plugins.py @@ -80,7 +80,7 @@ class ValidateContainersModel(BaseSettingsModel): """ _isGroup = True - profiles: list[ValidateContainersProfile] = SettingsField( + plugin_state_profiles: list[ValidateContainersProfile] = SettingsField( default_factory=list ) @@ -886,7 +886,7 @@ DEFAULT_PUBLISH_VALUES = { "active": True }, "ValidateContainers": { - "profiles": [ + "plugin_state_profiles": [ { # Default host names are based on original # filter of ValidateContainer pyblish plugin From daf35ecd0f7c7bcde0a19c121e6bd1d302f9a0a7 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 14:53:37 +0200 Subject: [PATCH 209/269] add a title to profiles --- server/settings/publish_plugins.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/settings/publish_plugins.py b/server/settings/publish_plugins.py index 0c19655035..8cf660354a 100644 --- a/server/settings/publish_plugins.py +++ b/server/settings/publish_plugins.py @@ -81,7 +81,8 @@ class ValidateContainersModel(BaseSettingsModel): _isGroup = True plugin_state_profiles: list[ValidateContainersProfile] = SettingsField( - default_factory=list + default_factory=list, + title="Plugin enable state profiles", ) From 38fd82623357d3001e96d0bc076c2dba0ff663b5 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 20 May 2024 15:34:12 +0200 Subject: [PATCH 210/269] rename 'ValidateContainers' to 'ValidateOutdatedContainers' --- .../ayon_core/plugins/publish/validate_containers.py | 4 ++-- server/settings/publish_plugins.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/plugins/publish/validate_containers.py b/client/ayon_core/plugins/publish/validate_containers.py index 3fd5083b4e..520e7a7ce9 100644 --- a/client/ayon_core/plugins/publish/validate_containers.py +++ b/client/ayon_core/plugins/publish/validate_containers.py @@ -23,7 +23,7 @@ class ShowInventory(pyblish.api.Action): host_tools.show_scene_inventory() -class ValidateContainers( +class ValidateOutdatedContainers( OptionalPyblishPluginMixin, pyblish.api.ContextPlugin ): @@ -49,7 +49,7 @@ class ValidateContainers( settings ["core"] ["publish"] - ["ValidateContainers"] + ["ValidateOutdatedContainers"] ["plugin_state_profiles"] ) profile = filter_profiles( diff --git a/server/settings/publish_plugins.py b/server/settings/publish_plugins.py index 8cf660354a..61e73ce912 100644 --- a/server/settings/publish_plugins.py +++ b/server/settings/publish_plugins.py @@ -59,7 +59,7 @@ class CollectFramesFixDefModel(BaseSettingsModel): ) -class ValidateContainersProfile(BaseSettingsModel): +class ValidateOutdatedContainersProfile(BaseSettingsModel): _layout = "expanded" # Filtering host_names: list[str] = SettingsField( @@ -72,7 +72,7 @@ class ValidateContainersProfile(BaseSettingsModel): active: bool = SettingsField(True, title="Active") -class ValidateContainersModel(BaseSettingsModel): +class ValidateOutdatedContainersModel(BaseSettingsModel): """Validate if Publishing intent was selected. It is possible to disable validation for specific publishing context @@ -80,7 +80,7 @@ class ValidateContainersModel(BaseSettingsModel): """ _isGroup = True - plugin_state_profiles: list[ValidateContainersProfile] = SettingsField( + plugin_state_profiles: list[ValidateOutdatedContainersProfile] = SettingsField( default_factory=list, title="Plugin enable state profiles", ) @@ -797,8 +797,8 @@ class PublishPuginsModel(BaseSettingsModel): default_factory=ValidateBaseModel, title="Validate Version" ) - ValidateContainers: ValidateContainersModel = SettingsField( - default_factory=ValidateContainersModel, + ValidateOutdatedContainers: ValidateOutdatedContainersModel = SettingsField( + default_factory=ValidateOutdatedContainersModel, title="Validate Containers" ) ValidateIntent: ValidateIntentModel = SettingsField( @@ -886,7 +886,7 @@ DEFAULT_PUBLISH_VALUES = { "optional": False, "active": True }, - "ValidateContainers": { + "ValidateOutdatedContainers": { "plugin_state_profiles": [ { # Default host names are based on original From 46337deb1a9db4d601c7c3a3fa9c3d12e2253942 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 20 May 2024 17:35:53 +0200 Subject: [PATCH 211/269] Update colorspace assignment in ExporterReviewMov class and remove unnecessary line adding custom tags in ExtractReviewIntermediates class. - Update colorspace assignment to use a method - Remove redundant line adding custom tags --- client/ayon_core/hosts/nuke/api/plugin.py | 3 ++- .../hosts/nuke/plugins/publish/extract_review_intermediates.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/plugin.py b/client/ayon_core/hosts/nuke/api/plugin.py index ec13104d4d..bb9d175e62 100644 --- a/client/ayon_core/hosts/nuke/api/plugin.py +++ b/client/ayon_core/hosts/nuke/api/plugin.py @@ -837,7 +837,8 @@ class ExporterReviewMov(ExporterReview): def generate_mov(self, farm=False, delete=True, **kwargs): # colorspace data - colorspace = None + colorspace = self.write_colorspace + # get colorspace settings # get colorspace data from context config_data, _ = get_colorspace_settings_from_publish_context( diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py b/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py index 82c7b6e4c5..f3dac3a82e 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py @@ -136,7 +136,6 @@ class ExtractReviewIntermediates(publish.Extractor): self, instance, o_name, o_data["extension"], multiple_presets) - o_data["add_custom_tags"].append("intermediate") delete = not o_data.get("publish", False) if instance.data.get("farm"): From d968c36c15487529ff198dab9b9cbc0a69ada520 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 21 May 2024 15:18:09 +0200 Subject: [PATCH 212/269] moved clockify code to server addon --- .../clockify/client/ayon_clockify}/__init__.py | 0 .../clockify/client/ayon_clockify}/clockify_api.py | 0 .../clockify/client/ayon_clockify}/clockify_module.py | 0 .../clockify/client/ayon_clockify}/constants.py | 0 .../ayon_clockify}/ftrack/server/action_clockify_sync_server.py | 0 .../ayon_clockify}/ftrack/user/action_clockify_sync_local.py | 0 .../client/ayon_clockify}/launcher_actions/ClockifyStart.py | 0 .../client/ayon_clockify}/launcher_actions/ClockifySync.py | 0 .../clockify/client/ayon_clockify}/widgets.py | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/__init__.py (100%) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/clockify_api.py (100%) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/clockify_module.py (100%) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/constants.py (100%) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/ftrack/server/action_clockify_sync_server.py (100%) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/ftrack/user/action_clockify_sync_local.py (100%) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/launcher_actions/ClockifyStart.py (100%) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/launcher_actions/ClockifySync.py (100%) rename {client/ayon_core/modules/clockify => server_addon/clockify/client/ayon_clockify}/widgets.py (100%) diff --git a/client/ayon_core/modules/clockify/__init__.py b/server_addon/clockify/client/ayon_clockify/__init__.py similarity index 100% rename from client/ayon_core/modules/clockify/__init__.py rename to server_addon/clockify/client/ayon_clockify/__init__.py diff --git a/client/ayon_core/modules/clockify/clockify_api.py b/server_addon/clockify/client/ayon_clockify/clockify_api.py similarity index 100% rename from client/ayon_core/modules/clockify/clockify_api.py rename to server_addon/clockify/client/ayon_clockify/clockify_api.py diff --git a/client/ayon_core/modules/clockify/clockify_module.py b/server_addon/clockify/client/ayon_clockify/clockify_module.py similarity index 100% rename from client/ayon_core/modules/clockify/clockify_module.py rename to server_addon/clockify/client/ayon_clockify/clockify_module.py diff --git a/client/ayon_core/modules/clockify/constants.py b/server_addon/clockify/client/ayon_clockify/constants.py similarity index 100% rename from client/ayon_core/modules/clockify/constants.py rename to server_addon/clockify/client/ayon_clockify/constants.py diff --git a/client/ayon_core/modules/clockify/ftrack/server/action_clockify_sync_server.py b/server_addon/clockify/client/ayon_clockify/ftrack/server/action_clockify_sync_server.py similarity index 100% rename from client/ayon_core/modules/clockify/ftrack/server/action_clockify_sync_server.py rename to server_addon/clockify/client/ayon_clockify/ftrack/server/action_clockify_sync_server.py diff --git a/client/ayon_core/modules/clockify/ftrack/user/action_clockify_sync_local.py b/server_addon/clockify/client/ayon_clockify/ftrack/user/action_clockify_sync_local.py similarity index 100% rename from client/ayon_core/modules/clockify/ftrack/user/action_clockify_sync_local.py rename to server_addon/clockify/client/ayon_clockify/ftrack/user/action_clockify_sync_local.py diff --git a/client/ayon_core/modules/clockify/launcher_actions/ClockifyStart.py b/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifyStart.py similarity index 100% rename from client/ayon_core/modules/clockify/launcher_actions/ClockifyStart.py rename to server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifyStart.py diff --git a/client/ayon_core/modules/clockify/launcher_actions/ClockifySync.py b/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifySync.py similarity index 100% rename from client/ayon_core/modules/clockify/launcher_actions/ClockifySync.py rename to server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifySync.py diff --git a/client/ayon_core/modules/clockify/widgets.py b/server_addon/clockify/client/ayon_clockify/widgets.py similarity index 100% rename from client/ayon_core/modules/clockify/widgets.py rename to server_addon/clockify/client/ayon_clockify/widgets.py From 5300ea1526f10085d0f44980347ea9dbe077d75e Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 21 May 2024 16:01:00 +0200 Subject: [PATCH 213/269] fix imports and naming --- .../clockify/client/ayon_clockify/__init__.py | 4 ++-- .../{clockify_module.py => addon.py} | 20 +++++++++--------- .../client/ayon_clockify/clockify_api.py | 8 ++++--- .../server/action_clockify_sync_server.py | 6 ++++-- .../ftrack/user/action_clockify_sync_local.py | 21 +++++++------------ .../launcher_actions/ClockifyStart.py | 3 ++- .../launcher_actions/ClockifySync.py | 2 +- .../clockify/client/ayon_clockify/version.py | 3 +++ server_addon/clockify/package.py | 2 +- 9 files changed, 36 insertions(+), 33 deletions(-) rename server_addon/clockify/client/ayon_clockify/{clockify_module.py => addon.py} (93%) create mode 100644 server_addon/clockify/client/ayon_clockify/version.py diff --git a/server_addon/clockify/client/ayon_clockify/__init__.py b/server_addon/clockify/client/ayon_clockify/__init__.py index 98834b516c..75fb87494e 100644 --- a/server_addon/clockify/client/ayon_clockify/__init__.py +++ b/server_addon/clockify/client/ayon_clockify/__init__.py @@ -1,5 +1,5 @@ -from .clockify_module import ClockifyModule +from .addon import ClockifyAddon __all__ = ( - "ClockifyModule", + "ClockifyAddon", ) diff --git a/server_addon/clockify/client/ayon_clockify/clockify_module.py b/server_addon/clockify/client/ayon_clockify/addon.py similarity index 93% rename from server_addon/clockify/client/ayon_clockify/clockify_module.py rename to server_addon/clockify/client/ayon_clockify/addon.py index d2ee4f1e1e..ce91b2be70 100644 --- a/server_addon/clockify/client/ayon_clockify/clockify_module.py +++ b/server_addon/clockify/client/ayon_clockify/addon.py @@ -2,12 +2,12 @@ import os import threading import time -from ayon_core.modules import AYONAddon, ITrayModule, IPluginPaths +from ayon_core.addon import AYONAddon, ITrayAddon, IPluginPaths from .constants import CLOCKIFY_FTRACK_USER_PATH, CLOCKIFY_FTRACK_SERVER_PATH -class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths): +class ClockifyAddon(AYONAddon, ITrayAddon, IPluginPaths): name = "clockify" def initialize(self, studio_settings): @@ -31,7 +31,7 @@ class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths): # TimersManager attributes # - set `timers_manager_connector` only in `tray_init` self.timers_manager_connector = None - self._timers_manager_module = None + self._timer_manager_addon = None @property def clockify_api(self): @@ -87,7 +87,7 @@ class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths): return {"actions": [actions_path]} def get_ftrack_event_handler_paths(self): - """Function for Ftrack module to add ftrack event handler paths.""" + """Function for ftrack addon to add ftrack event handler paths.""" return { "user": [CLOCKIFY_FTRACK_USER_PATH], "server": [CLOCKIFY_FTRACK_SERVER_PATH], @@ -206,19 +206,19 @@ class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths): self.action_stop_timer.setVisible(self.bool_timer_run) # --- TimersManager connection methods --- - def register_timers_manager(self, timer_manager_module): + def register_timers_manager(self, timer_manager_addon): """Store TimersManager for future use.""" - self._timers_manager_module = timer_manager_module + self._timer_manager_addon = timer_manager_addon def timer_started(self, data): """Tell TimersManager that timer started.""" - if self._timers_manager_module is not None: - self._timers_manager_module.timer_started(self.id, data) + if self._timer_manager_addon is not None: + self._timer_manager_addon.timer_started(self.id, data) def timer_stopped(self): """Tell TimersManager that timer stopped.""" - if self._timers_manager_module is not None: - self._timers_manager_module.timer_stopped(self.id) + if self._timer_manager_addon is not None: + self._timer_manager_addon.timer_stopped(self.id) def stop_timer(self): """Called from TimersManager to stop timer.""" diff --git a/server_addon/clockify/client/ayon_clockify/clockify_api.py b/server_addon/clockify/client/ayon_clockify/clockify_api.py index 2e1d8f008f..38ca6cdb66 100644 --- a/server_addon/clockify/client/ayon_clockify/clockify_api.py +++ b/server_addon/clockify/client/ayon_clockify/clockify_api.py @@ -1,15 +1,17 @@ import os import json import datetime + import requests + +from ayon_core.lib.local_settings import AYONSecureRegistry +from ayon_core.lib import Logger + from .constants import ( CLOCKIFY_ENDPOINT, ADMIN_PERMISSION_NAMES, ) -from ayon_core.lib.local_settings import AYONSecureRegistry -from ayon_core.lib import Logger - class ClockifyAPI: log = Logger.get_logger(__name__) diff --git a/server_addon/clockify/client/ayon_clockify/ftrack/server/action_clockify_sync_server.py b/server_addon/clockify/client/ayon_clockify/ftrack/server/action_clockify_sync_server.py index 7854f0ceba..ed83fed287 100644 --- a/server_addon/clockify/client/ayon_clockify/ftrack/server/action_clockify_sync_server.py +++ b/server_addon/clockify/client/ayon_clockify/ftrack/server/action_clockify_sync_server.py @@ -1,7 +1,9 @@ import os import json -from openpype_modules.ftrack.lib import ServerAction -from openpype_modules.clockify.clockify_api import ClockifyAPI + +from ayon_clockify.clockify_api import ClockifyAPI + +from ayon_ftrack.lib import ServerAction class SyncClockifyServer(ServerAction): diff --git a/server_addon/clockify/client/ayon_clockify/ftrack/user/action_clockify_sync_local.py b/server_addon/clockify/client/ayon_clockify/ftrack/user/action_clockify_sync_local.py index 4701653a0b..05a94e56fd 100644 --- a/server_addon/clockify/client/ayon_clockify/ftrack/user/action_clockify_sync_local.py +++ b/server_addon/clockify/client/ayon_clockify/ftrack/user/action_clockify_sync_local.py @@ -1,25 +1,20 @@ import json -from openpype_modules.ftrack.lib import BaseAction, statics_icon -from openpype_modules.clockify.clockify_api import ClockifyAPI +from ayon_clockify.clockify_api import ClockifyAPI +from ayon_ftrack.lib import BaseAction, statics_icon class SyncClockifyLocal(BaseAction): - '''Synchronise project names and task types.''' + """Synchronise project names and task types.""" - #: Action identifier. - identifier = 'clockify.sync.local' - #: Action label. - label = 'Sync To Clockify (local)' - #: Action description. - description = 'Synchronise data to Clockify workspace' - #: roles that are allowed to register this action + identifier = "clockify.sync.local" + label = "Sync To Clockify" + description = "Synchronise data to Clockify workspace" role_list = ["Administrator", "project Manager"] - #: icon icon = statics_icon("app_icons", "clockify-white.png") def __init__(self, *args, **kwargs): super(SyncClockifyLocal, self).__init__(*args, **kwargs) - #: CLockifyApi + self.clockify_api = ClockifyAPI() def discover(self, session, entities, event): @@ -56,7 +51,7 @@ class SyncClockifyLocal(BaseAction): 'user': user, 'status': 'running', 'data': json.dumps({ - 'description': 'Sync Ftrack to Clockify' + 'description': 'Sync ftrack to Clockify' }) }) session.commit() diff --git a/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifyStart.py b/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifyStart.py index 8381c7d73e..d69d0371c0 100644 --- a/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifyStart.py +++ b/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifyStart.py @@ -1,7 +1,8 @@ import ayon_api +from ayon_clockify.clockify_api import ClockifyAPI + from ayon_core.pipeline import LauncherAction -from openpype_modules.clockify.clockify_api import ClockifyAPI class ClockifyStart(LauncherAction): diff --git a/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifySync.py b/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifySync.py index 5388f47c98..a32f2a8082 100644 --- a/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifySync.py +++ b/server_addon/clockify/client/ayon_clockify/launcher_actions/ClockifySync.py @@ -1,6 +1,6 @@ import ayon_api -from openpype_modules.clockify.clockify_api import ClockifyAPI +from ayon_clockify.clockify_api import ClockifyAPI from ayon_core.pipeline import LauncherAction diff --git a/server_addon/clockify/client/ayon_clockify/version.py b/server_addon/clockify/client/ayon_clockify/version.py new file mode 100644 index 0000000000..0e6e40cb7d --- /dev/null +++ b/server_addon/clockify/client/ayon_clockify/version.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +"""Package declaring AYON addon 'clockify' version.""" +__version__ = "0.2.0" diff --git a/server_addon/clockify/package.py b/server_addon/clockify/package.py index bcf9425b3f..1a36c43e69 100644 --- a/server_addon/clockify/package.py +++ b/server_addon/clockify/package.py @@ -1,3 +1,3 @@ name = "clockify" title = "Clockify" -version = "0.1.1" +version = "0.2.0" From 5f387f052dd16a6a186579dbcde6c53cbe84408c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 21 May 2024 16:03:06 +0200 Subject: [PATCH 214/269] added clockify version requirement in ayon core --- 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 21b1193b07..431e9b651b 100644 --- a/client/ayon_core/addon/base.py +++ b/client/ayon_core/addon/base.py @@ -51,6 +51,7 @@ IGNORED_MODULES_IN_AYON = set() # - this is used to log the missing addon MOVED_ADDON_MILESTONE_VERSIONS = { "applications": VersionInfo(0, 2, 0), + "clockify": VersionInfo(0, 2, 0), } # Inherit from `object` for Python 2 hosts From 2ff82353753a7557f628c1cb439ff7dd1e3255c8 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 21 May 2024 16:03:16 +0200 Subject: [PATCH 215/269] add more information to package.py --- server_addon/clockify/package.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server_addon/clockify/package.py b/server_addon/clockify/package.py index 1a36c43e69..9482d7e0f7 100644 --- a/server_addon/clockify/package.py +++ b/server_addon/clockify/package.py @@ -1,3 +1,9 @@ name = "clockify" title = "Clockify" version = "0.2.0" +client_dir = "ayon_clockify" + +ayon_required_addons = { + "core": ">0.3.1", +} +ayon_compatible_addons = {} From caf3682e87bc3f4356f5ed8a9d54d0c040282588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Tue, 21 May 2024 22:22:33 +0200 Subject: [PATCH 216/269] Make sure actions in Launcher are sorted so they don't keep changing order randomly --- client/ayon_core/tools/launcher/models/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/launcher/models/actions.py b/client/ayon_core/tools/launcher/models/actions.py index 32df600c87..c27f0cd757 100644 --- a/client/ayon_core/tools/launcher/models/actions.py +++ b/client/ayon_core/tools/launcher/models/actions.py @@ -332,7 +332,7 @@ class ActionsModel: selection = self._prepare_selection(project_name, folder_id, task_id) output = [] action_items = self._get_action_items(project_name) - for identifier, action in self._get_action_objects().items(): + for identifier, action in sorted(self._get_action_objects().items()): if not action.is_compatible(selection): continue From 6c461eb21c981ebb70c19d40013f63fcefbd1a5f Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 09:54:27 +0200 Subject: [PATCH 217/269] add addon name to version.py --- server_addon/create_ayon_addons.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/server_addon/create_ayon_addons.py b/server_addon/create_ayon_addons.py index f0a36d4740..749077d2a8 100644 --- a/server_addon/create_ayon_addons.py +++ b/server_addon/create_ayon_addons.py @@ -47,7 +47,7 @@ plugin_for = ["ayon_server"] """ CLIENT_VERSION_CONTENT = '''# -*- coding: utf-8 -*- -"""Package declaring AYON core addon version.""" +"""Package declaring AYON addon '{}' version.""" __version__ = "{}" ''' @@ -183,6 +183,7 @@ def create_addon_zip( def prepare_client_code( + addon_name: str, addon_dir: Path, addon_output_dir: Path, addon_version: str @@ -211,7 +212,9 @@ def prepare_client_code( version_path = subpath / "version.py" if version_path.exists(): with open(version_path, "w") as stream: - stream.write(CLIENT_VERSION_CONTENT.format(addon_version)) + stream.write( + CLIENT_VERSION_CONTENT.format(addon_name, addon_version) + ) zip_filepath = private_dir / "client.zip" with ZipFileLongPaths(zip_filepath, "w", zipfile.ZIP_DEFLATED) as zipf: @@ -262,7 +265,9 @@ def create_addon_package( server_dir, addon_output_dir / "server", dirs_exist_ok=True ) - prepare_client_code(addon_dir, addon_output_dir, addon_version) + prepare_client_code( + package.name, addon_dir, addon_output_dir, addon_version + ) if create_zip: create_addon_zip( From dd29bd8fa8f88853fb8cf4ea4ec496ec8e2a41cf Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 22 May 2024 15:46:03 +0300 Subject: [PATCH 218/269] remove original render instance --- .../ayon_core/hosts/houdini/plugins/publish/extract_render.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py index 7b4762a25f..651df15c10 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py @@ -72,3 +72,6 @@ class ExtractRender(publish.Extractor): raise RuntimeError("Failed to complete render extraction. " "Missing output files: {}".format( missing_frames)) + + # Remove original render instance + instance.context.remove(instance) From 86595f282c1e7d01cfea1dcf81a6cd30244aa179 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 17:17:30 +0200 Subject: [PATCH 219/269] move tvpaint client code next to server codebase --- .../tvpaint/client/ayon_tvpaint}/__init__.py | 0 .../tvpaint/client/ayon_tvpaint}/addon.py | 0 .../tvpaint/client/ayon_tvpaint}/api/__init__.py | 0 .../ayon_tvpaint}/api/communication_server.py | 0 .../client/ayon_tvpaint}/api/launch_script.py | 0 .../tvpaint/client/ayon_tvpaint}/api/lib.py | 0 .../tvpaint/client/ayon_tvpaint}/api/pipeline.py | 0 .../tvpaint/client/ayon_tvpaint}/api/plugin.py | 0 .../client/ayon_tvpaint}/hooks/pre_launch_args.py | 0 .../tvpaint/client/ayon_tvpaint}/lib.py | 0 .../ayon_tvpaint}/plugins/create/convert_legacy.py | 0 .../ayon_tvpaint}/plugins/create/create_render.py | 0 .../ayon_tvpaint}/plugins/create/create_review.py | 0 .../ayon_tvpaint}/plugins/create/create_workfile.py | 0 .../client/ayon_tvpaint}/plugins/load/load_image.py | 0 .../plugins/load/load_reference_image.py | 0 .../client/ayon_tvpaint}/plugins/load/load_sound.py | 0 .../ayon_tvpaint}/plugins/load/load_workfile.py | 0 .../plugins/publish/collect_instance_frames.py | 0 .../plugins/publish/collect_render_instances.py | 0 .../plugins/publish/collect_workfile.py | 0 .../plugins/publish/collect_workfile_data.py | 0 .../plugins/publish/extract_convert_to_exr.py | 0 .../plugins/publish/extract_sequence.py | 0 .../plugins/publish/help/validate_asset_name.xml | 0 .../help/validate_duplicated_layer_names.xml | 0 .../publish/help/validate_layers_visibility.xml | 0 .../plugins/publish/help/validate_marks.xml | 0 .../publish/help/validate_missing_layer_names.xml | 0 .../publish/help/validate_render_layer_group.xml | 0 .../publish/help/validate_render_pass_group.xml | 0 .../publish/help/validate_scene_settings.xml | 0 .../plugins/publish/help/validate_start_frame.xml | 0 .../publish/help/validate_workfile_metadata.xml | 0 .../publish/help/validate_workfile_project_name.xml | 0 .../plugins/publish/increment_workfile_version.py | 0 .../plugins/publish/validate_asset_name.py | 0 .../publish/validate_duplicated_layer_names.py | 0 .../plugins/publish/validate_layers_visibility.py | 0 .../ayon_tvpaint}/plugins/publish/validate_marks.py | 0 .../plugins/publish/validate_missing_layer_names.py | 0 .../plugins/publish/validate_render_layer_group.py | 0 .../plugins/publish/validate_render_pass_group.py | 0 .../plugins/publish/validate_scene_settings.py | 0 .../plugins/publish/validate_start_frame.py | 0 .../plugins/publish/validate_workfile_metadata.py | 0 .../publish/validate_workfile_project_name.py | 0 .../client/ayon_tvpaint}/resources/template.tvpp | Bin .../client/ayon_tvpaint}/tvpaint_plugin/__init__.py | 0 .../tvpaint_plugin/plugin_code/CMakeLists.txt | 0 .../tvpaint_plugin/plugin_code/README.md | 0 .../tvpaint_plugin/plugin_code/library.cpp | 0 .../tvpaint_plugin/plugin_code/library.def | 0 .../windows_x64/plugin/OpenPypePlugin.dll | Bin .../windows_x86/plugin/OpenPypePlugin.dll | Bin .../tvpaint/client/ayon_tvpaint}/worker/__init__.py | 0 .../client/ayon_tvpaint}/worker/init_file.tvpp | Bin .../tvpaint/client/ayon_tvpaint}/worker/worker.py | 0 .../client/ayon_tvpaint}/worker/worker_job.py | 0 59 files changed, 0 insertions(+), 0 deletions(-) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/__init__.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/addon.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/api/__init__.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/api/communication_server.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/api/launch_script.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/api/lib.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/api/pipeline.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/api/plugin.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/hooks/pre_launch_args.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/lib.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/create/convert_legacy.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/create/create_render.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/create/create_review.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/create/create_workfile.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/load/load_image.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/load/load_reference_image.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/load/load_sound.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/load/load_workfile.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/collect_instance_frames.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/collect_render_instances.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/collect_workfile.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/collect_workfile_data.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/extract_convert_to_exr.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/extract_sequence.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_asset_name.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_duplicated_layer_names.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_layers_visibility.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_marks.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_missing_layer_names.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_render_layer_group.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_render_pass_group.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_scene_settings.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_start_frame.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_workfile_metadata.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/help/validate_workfile_project_name.xml (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/increment_workfile_version.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_asset_name.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_duplicated_layer_names.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_layers_visibility.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_marks.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_missing_layer_names.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_render_layer_group.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_render_pass_group.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_scene_settings.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_start_frame.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_workfile_metadata.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/plugins/publish/validate_workfile_project_name.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/resources/template.tvpp (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/tvpaint_plugin/__init__.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/tvpaint_plugin/plugin_code/CMakeLists.txt (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/tvpaint_plugin/plugin_code/README.md (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/tvpaint_plugin/plugin_code/library.cpp (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/tvpaint_plugin/plugin_code/library.def (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/tvpaint_plugin/plugin_files/windows_x64/plugin/OpenPypePlugin.dll (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/tvpaint_plugin/plugin_files/windows_x86/plugin/OpenPypePlugin.dll (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/worker/__init__.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/worker/init_file.tvpp (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/worker/worker.py (100%) rename {client/ayon_core/hosts/tvpaint => server_addon/tvpaint/client/ayon_tvpaint}/worker/worker_job.py (100%) diff --git a/client/ayon_core/hosts/tvpaint/__init__.py b/server_addon/tvpaint/client/ayon_tvpaint/__init__.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/__init__.py rename to server_addon/tvpaint/client/ayon_tvpaint/__init__.py diff --git a/client/ayon_core/hosts/tvpaint/addon.py b/server_addon/tvpaint/client/ayon_tvpaint/addon.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/addon.py rename to server_addon/tvpaint/client/ayon_tvpaint/addon.py diff --git a/client/ayon_core/hosts/tvpaint/api/__init__.py b/server_addon/tvpaint/client/ayon_tvpaint/api/__init__.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/api/__init__.py rename to server_addon/tvpaint/client/ayon_tvpaint/api/__init__.py diff --git a/client/ayon_core/hosts/tvpaint/api/communication_server.py b/server_addon/tvpaint/client/ayon_tvpaint/api/communication_server.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/api/communication_server.py rename to server_addon/tvpaint/client/ayon_tvpaint/api/communication_server.py diff --git a/client/ayon_core/hosts/tvpaint/api/launch_script.py b/server_addon/tvpaint/client/ayon_tvpaint/api/launch_script.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/api/launch_script.py rename to server_addon/tvpaint/client/ayon_tvpaint/api/launch_script.py diff --git a/client/ayon_core/hosts/tvpaint/api/lib.py b/server_addon/tvpaint/client/ayon_tvpaint/api/lib.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/api/lib.py rename to server_addon/tvpaint/client/ayon_tvpaint/api/lib.py diff --git a/client/ayon_core/hosts/tvpaint/api/pipeline.py b/server_addon/tvpaint/client/ayon_tvpaint/api/pipeline.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/api/pipeline.py rename to server_addon/tvpaint/client/ayon_tvpaint/api/pipeline.py diff --git a/client/ayon_core/hosts/tvpaint/api/plugin.py b/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/api/plugin.py rename to server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py diff --git a/client/ayon_core/hosts/tvpaint/hooks/pre_launch_args.py b/server_addon/tvpaint/client/ayon_tvpaint/hooks/pre_launch_args.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/hooks/pre_launch_args.py rename to server_addon/tvpaint/client/ayon_tvpaint/hooks/pre_launch_args.py diff --git a/client/ayon_core/hosts/tvpaint/lib.py b/server_addon/tvpaint/client/ayon_tvpaint/lib.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/lib.py rename to server_addon/tvpaint/client/ayon_tvpaint/lib.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/create/convert_legacy.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/convert_legacy.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/create/convert_legacy.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/create/convert_legacy.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/create/create_render.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_render.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/create/create_render.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_render.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/create/create_review.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_review.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/create/create_review.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_review.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/create/create_workfile.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_workfile.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/create/create_workfile.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_workfile.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/load/load_image.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_image.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/load/load_image.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_image.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/load/load_reference_image.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_reference_image.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/load/load_reference_image.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_reference_image.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/load/load_sound.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_sound.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/load/load_sound.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_sound.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/load/load_workfile.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_workfile.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/load/load_workfile.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_workfile.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/collect_instance_frames.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_instance_frames.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/collect_instance_frames.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_instance_frames.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/collect_render_instances.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_render_instances.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/collect_render_instances.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_render_instances.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/collect_workfile.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/collect_workfile.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/collect_workfile_data.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/collect_workfile_data.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/extract_convert_to_exr.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_convert_to_exr.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/extract_convert_to_exr.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_convert_to_exr.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/extract_sequence.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/extract_sequence.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_asset_name.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_asset_name.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_asset_name.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_asset_name.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_duplicated_layer_names.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_duplicated_layer_names.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_duplicated_layer_names.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_duplicated_layer_names.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_layers_visibility.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_layers_visibility.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_layers_visibility.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_layers_visibility.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_marks.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_marks.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_marks.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_marks.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_missing_layer_names.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_missing_layer_names.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_missing_layer_names.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_missing_layer_names.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_render_layer_group.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_render_layer_group.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_render_layer_group.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_render_layer_group.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_render_pass_group.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_render_pass_group.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_render_pass_group.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_render_pass_group.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_scene_settings.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_scene_settings.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_scene_settings.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_scene_settings.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_start_frame.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_start_frame.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_start_frame.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_start_frame.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_workfile_metadata.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_workfile_metadata.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_workfile_metadata.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_workfile_metadata.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_workfile_project_name.xml b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_workfile_project_name.xml similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/help/validate_workfile_project_name.xml rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/help/validate_workfile_project_name.xml diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/increment_workfile_version.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/increment_workfile_version.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/increment_workfile_version.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/increment_workfile_version.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_asset_name.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_asset_name.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_duplicated_layer_names.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_duplicated_layer_names.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_duplicated_layer_names.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_duplicated_layer_names.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_layers_visibility.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_layers_visibility.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_layers_visibility.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_layers_visibility.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_marks.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_marks.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_missing_layer_names.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_missing_layer_names.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_missing_layer_names.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_missing_layer_names.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_render_layer_group.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_layer_group.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_render_layer_group.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_layer_group.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_render_pass_group.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_pass_group.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_render_pass_group.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_pass_group.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_scene_settings.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_scene_settings.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_scene_settings.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_scene_settings.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_start_frame.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_start_frame.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_workfile_metadata.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_metadata.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_workfile_metadata.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_metadata.py diff --git a/client/ayon_core/hosts/tvpaint/plugins/publish/validate_workfile_project_name.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_project_name.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/plugins/publish/validate_workfile_project_name.py rename to server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_project_name.py diff --git a/client/ayon_core/hosts/tvpaint/resources/template.tvpp b/server_addon/tvpaint/client/ayon_tvpaint/resources/template.tvpp similarity index 100% rename from client/ayon_core/hosts/tvpaint/resources/template.tvpp rename to server_addon/tvpaint/client/ayon_tvpaint/resources/template.tvpp diff --git a/client/ayon_core/hosts/tvpaint/tvpaint_plugin/__init__.py b/server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/__init__.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/tvpaint_plugin/__init__.py rename to server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/__init__.py diff --git a/client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_code/CMakeLists.txt b/server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_code/CMakeLists.txt similarity index 100% rename from client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_code/CMakeLists.txt rename to server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_code/CMakeLists.txt diff --git a/client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_code/README.md b/server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_code/README.md similarity index 100% rename from client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_code/README.md rename to server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_code/README.md diff --git a/client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_code/library.cpp b/server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_code/library.cpp similarity index 100% rename from client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_code/library.cpp rename to server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_code/library.cpp diff --git a/client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_code/library.def b/server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_code/library.def similarity index 100% rename from client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_code/library.def rename to server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_code/library.def diff --git a/client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_files/windows_x64/plugin/OpenPypePlugin.dll b/server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_files/windows_x64/plugin/OpenPypePlugin.dll similarity index 100% rename from client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_files/windows_x64/plugin/OpenPypePlugin.dll rename to server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_files/windows_x64/plugin/OpenPypePlugin.dll diff --git a/client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_files/windows_x86/plugin/OpenPypePlugin.dll b/server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_files/windows_x86/plugin/OpenPypePlugin.dll similarity index 100% rename from client/ayon_core/hosts/tvpaint/tvpaint_plugin/plugin_files/windows_x86/plugin/OpenPypePlugin.dll rename to server_addon/tvpaint/client/ayon_tvpaint/tvpaint_plugin/plugin_files/windows_x86/plugin/OpenPypePlugin.dll diff --git a/client/ayon_core/hosts/tvpaint/worker/__init__.py b/server_addon/tvpaint/client/ayon_tvpaint/worker/__init__.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/worker/__init__.py rename to server_addon/tvpaint/client/ayon_tvpaint/worker/__init__.py diff --git a/client/ayon_core/hosts/tvpaint/worker/init_file.tvpp b/server_addon/tvpaint/client/ayon_tvpaint/worker/init_file.tvpp similarity index 100% rename from client/ayon_core/hosts/tvpaint/worker/init_file.tvpp rename to server_addon/tvpaint/client/ayon_tvpaint/worker/init_file.tvpp diff --git a/client/ayon_core/hosts/tvpaint/worker/worker.py b/server_addon/tvpaint/client/ayon_tvpaint/worker/worker.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/worker/worker.py rename to server_addon/tvpaint/client/ayon_tvpaint/worker/worker.py diff --git a/client/ayon_core/hosts/tvpaint/worker/worker_job.py b/server_addon/tvpaint/client/ayon_tvpaint/worker/worker_job.py similarity index 100% rename from client/ayon_core/hosts/tvpaint/worker/worker_job.py rename to server_addon/tvpaint/client/ayon_tvpaint/worker/worker_job.py From 60a76239bf254406eb19eef3096e3b94a40d0060 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Wed, 22 May 2024 18:32:28 +0300 Subject: [PATCH 220/269] disable integration for the original render instance Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../ayon_core/hosts/houdini/plugins/publish/extract_render.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py index 651df15c10..20e9341ebd 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py @@ -74,4 +74,4 @@ class ExtractRender(publish.Extractor): missing_frames)) # Remove original render instance - instance.context.remove(instance) + instance.data["integrate"] = False From ab8d5186b9f9c9a9fc885272dc398b579aa8225e Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 22 May 2024 18:42:19 +0300 Subject: [PATCH 221/269] update comment about skipping integration --- .../ayon_core/hosts/houdini/plugins/publish/extract_render.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py index 20e9341ebd..267280ad9f 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py @@ -73,5 +73,5 @@ class ExtractRender(publish.Extractor): "Missing output files: {}".format( missing_frames)) - # Remove original render instance + # Skip integrating original render instance instance.data["integrate"] = False From 48167e23c79baf4510d514426139f07f9ec86a9b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 17:43:31 +0200 Subject: [PATCH 222/269] Implement sorting proxy model --- .../tools/launcher/ui/actions_widget.py | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/tools/launcher/ui/actions_widget.py b/client/ayon_core/tools/launcher/ui/actions_widget.py index a225827418..3e4dfaf6e4 100644 --- a/client/ayon_core/tools/launcher/ui/actions_widget.py +++ b/client/ayon_core/tools/launcher/ui/actions_widget.py @@ -290,6 +290,34 @@ class ActionDelegate(QtWidgets.QStyledItemDelegate): painter.drawPixmap(extender_x, extender_y, pix) +class ActionsProxyModel(QtCore.QSortFilterProxyModel): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + self.setSortCaseSensitivity(QtCore.Qt.CaseInsensitive) + + def lessThan(self, left, right): + # Sort by action order and then by label + left_value = left.data(ACTION_SORT_ROLE) + right_value = right.data(ACTION_SORT_ROLE) + + # Values are same -> use super sorting + if left_value == right_value: + # Default behavior is using DisplayRole + return super().lessThan(left, right) + + # Validate 'None' values + if right_value is None: + return True + if left_value is None: + return False + # Sort values and handle incompatible types + try: + return left_value < right_value + except TypeError: + return True + + class ActionsWidget(QtWidgets.QWidget): def __init__(self, controller, parent): super(ActionsWidget, self).__init__(parent) @@ -316,10 +344,7 @@ class ActionsWidget(QtWidgets.QWidget): model = ActionsQtModel(controller) - proxy_model = QtCore.QSortFilterProxyModel() - proxy_model.setSortCaseSensitivity(QtCore.Qt.CaseInsensitive) - proxy_model.setSortRole(ACTION_SORT_ROLE) - + proxy_model = ActionsProxyModel() proxy_model.setSourceModel(model) view.setModel(proxy_model) From 88cae86ee67a0cedd2e0635dd1fe1f6a2a45f4d9 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 17:43:42 +0200 Subject: [PATCH 223/269] reverse sorting in actions model --- client/ayon_core/tools/launcher/models/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/launcher/models/actions.py b/client/ayon_core/tools/launcher/models/actions.py index c27f0cd757..32df600c87 100644 --- a/client/ayon_core/tools/launcher/models/actions.py +++ b/client/ayon_core/tools/launcher/models/actions.py @@ -332,7 +332,7 @@ class ActionsModel: selection = self._prepare_selection(project_name, folder_id, task_id) output = [] action_items = self._get_action_items(project_name) - for identifier, action in sorted(self._get_action_objects().items()): + for identifier, action in self._get_action_objects().items(): if not action.is_compatible(selection): continue From 7f586576415493f0c49bdb497fb70c9921b038ed Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 22 May 2024 18:46:39 +0300 Subject: [PATCH 224/269] move code to a dedicated place --- .../plugins/publish/collect_local_render_instances.py | 6 +++--- .../hosts/houdini/plugins/publish/extract_render.py | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py index 5a446fa0d3..474002e1ee 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_local_render_instances.py @@ -132,6 +132,6 @@ class CollectLocalRenderInstances(pyblish.api.InstancePlugin): ] }) - # Remove original render instance - # I can't remove it here as I still need it to trigger the render. - # context.remove(instance) + # Skip integrating original render instance. + # We are not removing it because it's used to trigger the render. + instance.data["integrate"] = False diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py index 267280ad9f..7b4762a25f 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_render.py @@ -72,6 +72,3 @@ class ExtractRender(publish.Extractor): raise RuntimeError("Failed to complete render extraction. " "Missing output files: {}".format( missing_frames)) - - # Skip integrating original render instance - instance.data["integrate"] = False From 299b9d14733f34a0a77f6ff6ffe2419ac4cd5ef9 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 17:52:56 +0200 Subject: [PATCH 225/269] fix imports --- .../tvpaint/client/ayon_tvpaint/api/communication_server.py | 2 +- .../tvpaint/client/ayon_tvpaint/api/launch_script.py | 2 +- server_addon/tvpaint/client/ayon_tvpaint/api/pipeline.py | 3 ++- .../tvpaint/client/ayon_tvpaint/hooks/pre_launch_args.py | 2 +- .../client/ayon_tvpaint/plugins/create/convert_legacy.py | 4 ++-- .../client/ayon_tvpaint/plugins/create/create_render.py | 4 ++-- .../client/ayon_tvpaint/plugins/create/create_review.py | 2 +- .../client/ayon_tvpaint/plugins/create/create_workfile.py | 2 +- .../tvpaint/client/ayon_tvpaint/plugins/load/load_image.py | 4 ++-- .../ayon_tvpaint/plugins/load/load_reference_image.py | 6 +++--- .../tvpaint/client/ayon_tvpaint/plugins/load/load_sound.py | 4 ++-- .../client/ayon_tvpaint/plugins/load/load_workfile.py | 6 +++--- .../ayon_tvpaint/plugins/publish/collect_workfile_data.py | 4 ++-- .../client/ayon_tvpaint/plugins/publish/extract_sequence.py | 4 ++-- .../ayon_tvpaint/plugins/publish/validate_asset_name.py | 2 +- .../client/ayon_tvpaint/plugins/publish/validate_marks.py | 2 +- .../ayon_tvpaint/plugins/publish/validate_start_frame.py | 2 +- server_addon/tvpaint/client/ayon_tvpaint/worker/worker.py | 4 ++-- .../tvpaint/client/ayon_tvpaint/worker/worker_job.py | 2 +- 19 files changed, 31 insertions(+), 30 deletions(-) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/api/communication_server.py b/server_addon/tvpaint/client/ayon_tvpaint/api/communication_server.py index d185bdf685..7ccb49f07e 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/api/communication_server.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/api/communication_server.py @@ -22,7 +22,7 @@ from aiohttp_json_rpc.protocol import ( from aiohttp_json_rpc.exceptions import RpcError from ayon_core.lib import emit_event -from ayon_core.hosts.tvpaint.tvpaint_plugin import get_plugin_files_path +from ayon_tvpaint.tvpaint_plugin import get_plugin_files_path log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/api/launch_script.py b/server_addon/tvpaint/client/ayon_tvpaint/api/launch_script.py index bcc92d8b6d..1e23e95572 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/api/launch_script.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/api/launch_script.py @@ -10,7 +10,7 @@ from qtpy import QtWidgets, QtCore, QtGui from ayon_core import style from ayon_core.pipeline import install_host -from ayon_core.hosts.tvpaint.api import ( +from ayon_tvpaint.api import ( TVPaintHost, CommunicationWrapper, ) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/api/pipeline.py b/server_addon/tvpaint/client/ayon_tvpaint/api/pipeline.py index 6f5c4d49d4..5ec6355138 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/api/pipeline.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/api/pipeline.py @@ -7,8 +7,9 @@ import requests import ayon_api import pyblish.api +from ayon_tvpaint import TVPAINT_ROOT_DIR + from ayon_core.host import HostBase, IWorkfileHost, ILoadHost, IPublishHost -from ayon_core.hosts.tvpaint import TVPAINT_ROOT_DIR from ayon_core.settings import get_current_project_settings from ayon_core.lib import register_event_callback from ayon_core.pipeline import ( diff --git a/server_addon/tvpaint/client/ayon_tvpaint/hooks/pre_launch_args.py b/server_addon/tvpaint/client/ayon_tvpaint/hooks/pre_launch_args.py index 691b81e089..8ee91aa0e7 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/hooks/pre_launch_args.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/hooks/pre_launch_args.py @@ -37,6 +37,6 @@ class TvpaintPrelaunchHook(PreLaunchHook): self.launch_context.launch_args.extend(remainders) def launch_script_path(self): - from ayon_core.hosts.tvpaint import get_launch_script_path + from ayon_tvpaint import get_launch_script_path return get_launch_script_path() diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/convert_legacy.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/convert_legacy.py index 34fe0ce8f4..e79a6565e8 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/convert_legacy.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/convert_legacy.py @@ -4,8 +4,8 @@ from ayon_core.pipeline.create.creator_plugins import ( ProductConvertorPlugin, cache_and_get_instances, ) -from ayon_core.hosts.tvpaint.api.plugin import SHARED_DATA_KEY -from ayon_core.hosts.tvpaint.api.lib import get_groups_data +from ayon_tvpaint.api.plugin import SHARED_DATA_KEY +from ayon_tvpaint.api.lib import get_groups_data class TVPaintLegacyConverted(ProductConvertorPlugin): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_render.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_render.py index dc9c2466e0..2286a4417a 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_render.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_render.py @@ -52,11 +52,11 @@ from ayon_core.pipeline.create import ( CreatedInstance, CreatorError, ) -from ayon_core.hosts.tvpaint.api.plugin import ( +from ayon_tvpaint.api.plugin import ( TVPaintCreator, TVPaintAutoCreator, ) -from ayon_core.hosts.tvpaint.api.lib import ( +from ayon_tvpaint.api.lib import ( get_layers_data, get_groups_data, execute_george_through_file, diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_review.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_review.py index acb4f0f8d6..6068ffa1d8 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_review.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_review.py @@ -1,7 +1,7 @@ import ayon_api from ayon_core.pipeline import CreatedInstance -from ayon_core.hosts.tvpaint.api.plugin import TVPaintAutoCreator +from ayon_tvpaint.api.plugin import TVPaintAutoCreator class TVPaintReviewCreator(TVPaintAutoCreator): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_workfile.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_workfile.py index f21f41439e..b08f731869 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_workfile.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/create/create_workfile.py @@ -1,7 +1,7 @@ import ayon_api from ayon_core.pipeline import CreatedInstance -from ayon_core.hosts.tvpaint.api.plugin import TVPaintAutoCreator +from ayon_tvpaint.api.plugin import TVPaintAutoCreator class TVPaintWorkfileCreator(TVPaintAutoCreator): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_image.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_image.py index aad8f92d26..de61992d3f 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_image.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_image.py @@ -1,6 +1,6 @@ from ayon_core.lib.attribute_definitions import BoolDef -from ayon_core.hosts.tvpaint.api import plugin -from ayon_core.hosts.tvpaint.api.lib import execute_george_through_file +from ayon_tvpaint.api import plugin +from ayon_tvpaint.api.lib import execute_george_through_file class ImportImage(plugin.Loader): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_reference_image.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_reference_image.py index a7fcb9f4a4..ce08aa9cd9 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_reference_image.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_reference_image.py @@ -2,12 +2,12 @@ import collections from ayon_core.lib.attribute_definitions import BoolDef from ayon_core.pipeline import registered_host -from ayon_core.hosts.tvpaint.api import plugin -from ayon_core.hosts.tvpaint.api.lib import ( +from ayon_tvpaint.api import plugin +from ayon_tvpaint.api.lib import ( get_layers_data, execute_george_through_file, ) -from ayon_core.hosts.tvpaint.api.pipeline import ( +from ayon_tvpaint.api.pipeline import ( write_workfile_metadata, SECTION_NAME_CONTAINERS, containerise, diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_sound.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_sound.py index 7e8c8022d6..086afba079 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_sound.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_sound.py @@ -1,7 +1,7 @@ import os import tempfile -from ayon_core.hosts.tvpaint.api import plugin -from ayon_core.hosts.tvpaint.api.lib import ( +from ayon_tvpaint.api import plugin +from ayon_tvpaint.api.lib import ( execute_george_through_file, ) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_workfile.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_workfile.py index 07c2d91533..045e22f188 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_workfile.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/load/load_workfile.py @@ -10,11 +10,11 @@ from ayon_core.pipeline.workfile import ( get_last_workfile_with_version, ) from ayon_core.pipeline.template_data import get_template_data_with_names -from ayon_core.hosts.tvpaint.api import plugin -from ayon_core.hosts.tvpaint.api.lib import ( +from ayon_tvpaint.api import plugin +from ayon_tvpaint.api.lib import ( execute_george_through_file, ) -from ayon_core.hosts.tvpaint.api.pipeline import ( +from ayon_tvpaint.api.pipeline import ( get_current_workfile_context, ) from ayon_core.pipeline.version_start import get_versioning_start diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py index 3155773bda..8f32b57e67 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py @@ -4,13 +4,13 @@ import tempfile import pyblish.api -from ayon_core.hosts.tvpaint.api.lib import ( +from ayon_tvpaint.api.lib import ( execute_george, execute_george_through_file, get_layers_data, get_groups_data, ) -from ayon_core.hosts.tvpaint.api.pipeline import ( +from ayon_tvpaint.api.pipeline import ( SECTION_NAME_CONTEXT, SECTION_NAME_INSTANCES, SECTION_NAME_CONTAINERS, diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py index fe5e148b7b..dc06726295 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py @@ -10,13 +10,13 @@ from ayon_core.pipeline.publish import ( KnownPublishError, get_publish_instance_families, ) -from ayon_core.hosts.tvpaint.api.lib import ( +from ayon_tvpaint.api.lib import ( execute_george, execute_george_through_file, get_layers_pre_post_behavior, get_layers_exposure_frames, ) -from ayon_core.hosts.tvpaint.lib import ( +from ayon_tvpaint.lib import ( calculate_layers_extraction_data, get_frame_filename_template, fill_reference_frames, diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py index 764c090720..55b06aa489 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py @@ -3,7 +3,7 @@ from ayon_core.pipeline import ( PublishXmlValidationError, OptionalPyblishPluginMixin, ) -from ayon_core.hosts.tvpaint.api.pipeline import ( +from ayon_tvpaint.api.pipeline import ( list_instances, write_instances, ) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py index 6bfbe840bb..f4e7eae2e1 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py @@ -5,7 +5,7 @@ from ayon_core.pipeline import ( PublishXmlValidationError, OptionalPyblishPluginMixin, ) -from ayon_core.hosts.tvpaint.api.lib import execute_george +from ayon_tvpaint.api.lib import execute_george class ValidateMarksRepair(pyblish.api.Action): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py index fea64bd6a8..f8f4fbb3c9 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py @@ -3,7 +3,7 @@ from ayon_core.pipeline import ( PublishXmlValidationError, OptionalPyblishPluginMixin, ) -from ayon_core.hosts.tvpaint.api.lib import execute_george +from ayon_tvpaint.api.lib import execute_george class RepairStartFrame(pyblish.api.Action): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/worker/worker.py b/server_addon/tvpaint/client/ayon_tvpaint/worker/worker.py index 3d9b1ef2b8..aa79fd442c 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/worker/worker.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/worker/worker.py @@ -5,11 +5,11 @@ import tempfile import shutil import asyncio -from ayon_core.hosts.tvpaint.api.communication_server import ( +from ayon_tvpaint.api.communication_server import ( BaseCommunicator, CommunicationWrapper ) -from openpype_modules.job_queue.job_workers import WorkerJobsConnection +from ayon_core.modules.job_queue.job_workers import WorkerJobsConnection from .worker_job import ProcessTVPaintCommands diff --git a/server_addon/tvpaint/client/ayon_tvpaint/worker/worker_job.py b/server_addon/tvpaint/client/ayon_tvpaint/worker/worker_job.py index f111ed369a..db91010c47 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/worker/worker_job.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/worker/worker_job.py @@ -256,7 +256,7 @@ class CollectSceneData(BaseCommand): name = "collect_scene_data" def execute(self): - from ayon_core.hosts.tvpaint.api.lib import ( + from ayon_tvpaint.api.lib import ( get_layers_data, get_groups_data, get_layers_pre_post_behavior, From ff55f08ad55bbaf4db41d6de18c51736a95c31b9 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 17:53:08 +0200 Subject: [PATCH 226/269] use ayon naming over openpype --- server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py b/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py index e715b959f4..ed3c38d564 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py @@ -12,7 +12,7 @@ from ayon_core.pipeline.create.creator_plugins import cache_and_get_instances from .lib import get_layers_data -SHARED_DATA_KEY = "openpype.tvpaint.instances" +SHARED_DATA_KEY = "ayon.tvpaint.instances" class TVPaintCreatorCommon: From 9a5421674a2e41dba8f1ac3679229062ec6eacf7 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 17:59:35 +0200 Subject: [PATCH 227/269] change version and add more information about addon --- server_addon/tvpaint/package.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server_addon/tvpaint/package.py b/server_addon/tvpaint/package.py index 2be3164f4a..c9e482efe7 100644 --- a/server_addon/tvpaint/package.py +++ b/server_addon/tvpaint/package.py @@ -1,3 +1,10 @@ name = "tvpaint" title = "TVPaint" -version = "0.1.2" +version = "0.2.0" +app_host_name = "tvpaint" +client_dir = "ayon_tvpaint" + +ayon_required_addons = { + "core": ">0.3.1", +} +ayon_compatible_addons = {} From f629148ae94eff0dad6fc2074842b72e7ab1fa5b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 18:00:17 +0200 Subject: [PATCH 228/269] add 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 21b1193b07..d9bd5b6af3 100644 --- a/client/ayon_core/addon/base.py +++ b/client/ayon_core/addon/base.py @@ -51,6 +51,7 @@ IGNORED_MODULES_IN_AYON = set() # - this is used to log the missing addon MOVED_ADDON_MILESTONE_VERSIONS = { "applications": VersionInfo(0, 2, 0), + "tvpaint": VersionInfo(0, 2, 0), } # Inherit from `object` for Python 2 hosts From 0f033d394a58b909d9a315bc99eff871968cfa2c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 18:08:09 +0200 Subject: [PATCH 229/269] define 'settings_category' on plugins --- server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py | 5 +++++ .../ayon_tvpaint/plugins/publish/collect_instance_frames.py | 2 ++ .../ayon_tvpaint/plugins/publish/collect_render_instances.py | 1 + .../client/ayon_tvpaint/plugins/publish/collect_workfile.py | 2 ++ .../ayon_tvpaint/plugins/publish/collect_workfile_data.py | 2 ++ .../ayon_tvpaint/plugins/publish/extract_convert_to_exr.py | 2 ++ .../client/ayon_tvpaint/plugins/publish/extract_sequence.py | 2 ++ .../plugins/publish/increment_workfile_version.py | 2 ++ .../ayon_tvpaint/plugins/publish/validate_asset_name.py | 2 ++ .../plugins/publish/validate_duplicated_layer_names.py | 2 ++ .../plugins/publish/validate_layers_visibility.py | 2 ++ .../client/ayon_tvpaint/plugins/publish/validate_marks.py | 2 ++ .../plugins/publish/validate_missing_layer_names.py | 2 ++ .../plugins/publish/validate_render_layer_group.py | 2 ++ .../plugins/publish/validate_render_pass_group.py | 2 ++ .../ayon_tvpaint/plugins/publish/validate_scene_settings.py | 2 ++ .../ayon_tvpaint/plugins/publish/validate_start_frame.py | 2 ++ .../plugins/publish/validate_workfile_metadata.py | 2 ++ .../plugins/publish/validate_workfile_project_name.py | 2 ++ 19 files changed, 40 insertions(+) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py b/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py index ed3c38d564..9dd6ae530a 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/api/plugin.py @@ -89,6 +89,8 @@ class TVPaintCreatorCommon: class TVPaintCreator(Creator, TVPaintCreatorCommon): + settings_category = "tvpaint" + def collect_instances(self): self._collect_create_instances() @@ -140,6 +142,8 @@ class TVPaintCreator(Creator, TVPaintCreatorCommon): class TVPaintAutoCreator(AutoCreator, TVPaintCreatorCommon): + settings_category = "tvpaint" + def collect_instances(self): self._collect_create_instances() @@ -152,6 +156,7 @@ class TVPaintAutoCreator(AutoCreator, TVPaintCreatorCommon): class Loader(LoaderPlugin): hosts = ["tvpaint"] + settings_category = "tvpaint" @staticmethod def get_members_from_container(container): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_instance_frames.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_instance_frames.py index 5f134a0cd0..a9e69166d7 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_instance_frames.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_instance_frames.py @@ -14,6 +14,8 @@ class CollectOutputFrameRange(pyblish.api.InstancePlugin): hosts = ["tvpaint"] families = ["review", "render"] + settings_category = "tvpaint" + def process(self, instance): folder_entity = instance.data.get("folderEntity") if not folder_entity: diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_render_instances.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_render_instances.py index 596d257f22..00af624700 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_render_instances.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_render_instances.py @@ -9,6 +9,7 @@ class CollectRenderInstances(pyblish.api.InstancePlugin): hosts = ["tvpaint"] families = ["render", "review"] + settings_category = "tvpaint" ignore_render_pass_transparency = False def process(self, instance): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile.py index a9e9db3872..27de086a46 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile.py @@ -9,6 +9,8 @@ class CollectWorkfile(pyblish.api.InstancePlugin): hosts = ["tvpaint"] families = ["workfile"] + settings_category = "tvpaint" + def process(self, instance): context = instance.context current_file = context.data["currentFile"] diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py index 8f32b57e67..a34a718ff5 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/collect_workfile_data.py @@ -58,6 +58,8 @@ class CollectWorkfileData(pyblish.api.ContextPlugin): hosts = ["tvpaint"] actions = [ResetTVPaintWorkfileMetadata] + settings_category = "tvpaint" + def process(self, context): current_project_id = execute_george("tv_projectcurrentid") execute_george("tv_projectselect {}".format(current_project_id)) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_convert_to_exr.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_convert_to_exr.py index d1bc68ef35..020ebc1a89 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_convert_to_exr.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_convert_to_exr.py @@ -23,6 +23,8 @@ class ExtractConvertToEXR(pyblish.api.InstancePlugin): hosts = ["tvpaint"] families = ["render"] + settings_category = "tvpaint" + enabled = False # Replace source PNG files or just add diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py index dc06726295..86c20c6528 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/extract_sequence.py @@ -31,6 +31,8 @@ class ExtractSequence(pyblish.api.InstancePlugin): hosts = ["tvpaint"] families = ["review", "render"] + settings_category = "tvpaint" + # Modifiable with settings review_bg = [255, 255, 255, 1.0] diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/increment_workfile_version.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/increment_workfile_version.py index 5dd6110bc7..601d276b97 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/increment_workfile_version.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/increment_workfile_version.py @@ -12,6 +12,8 @@ class IncrementWorkfileVersion(pyblish.api.ContextPlugin): optional = True hosts = ["tvpaint"] + settings_category = "tvpaint" + def process(self, context): assert all(result["success"] for result in context.data["results"]), ( diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py index 55b06aa489..8763c005dc 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_asset_name.py @@ -48,6 +48,8 @@ class ValidateAssetName( hosts = ["tvpaint"] actions = [FixFolderPaths] + settings_category = "tvpaint" + def process(self, context): if not self.is_active(context.data): return diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_duplicated_layer_names.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_duplicated_layer_names.py index aab0557bdd..be4dc0f123 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_duplicated_layer_names.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_duplicated_layer_names.py @@ -9,6 +9,8 @@ class ValidateLayersGroup(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder families = ["renderPass"] + settings_category = "tvpaint" + def process(self, instance): # Prepare layers layers_by_name = instance.context.data["layersByName"] diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_layers_visibility.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_layers_visibility.py index 1bcdf7baa1..f58b8a6973 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_layers_visibility.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_layers_visibility.py @@ -10,6 +10,8 @@ class ValidateLayersVisiblity(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder families = ["review", "render"] + settings_category = "tvpaint" + def process(self, instance): layers = instance.data.get("layers") # Instance have empty layers diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py index f4e7eae2e1..0911beb4e8 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_marks.py @@ -41,6 +41,8 @@ class ValidateMarks( optional = True actions = [ValidateMarksRepair] + settings_category = "tvpaint" + @staticmethod def get_expected_data(context): scene_mark_in = context.data["sceneMarkIn"] diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_missing_layer_names.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_missing_layer_names.py index 3fc80f6e78..f340d3c10d 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_missing_layer_names.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_missing_layer_names.py @@ -9,6 +9,8 @@ class ValidateMissingLayers(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder families = ["renderPass"] + settings_category = "tvpaint" + def process(self, instance): # Prepare layers layers_by_name = instance.context.data["layersByName"] diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_layer_group.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_layer_group.py index 0e97a01de2..b20ea3cac6 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_layer_group.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_layer_group.py @@ -12,6 +12,8 @@ class ValidateRenderLayerGroups(pyblish.api.ContextPlugin): label = "Validate Render Layers Group" order = pyblish.api.ValidatorOrder + 0.1 + settings_category = "tvpaint" + def process(self, context): # Prepare layers render_layers_by_group_id = collections.defaultdict(list) diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_pass_group.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_pass_group.py index 874af38dd4..3d00fd031f 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_pass_group.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_render_pass_group.py @@ -13,6 +13,8 @@ class ValidateLayersGroup(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder + 0.1 families = ["renderPass"] + settings_category = "tvpaint" + def process(self, instance): # Prepare layers layers_data = instance.context.data["layersData"] diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_scene_settings.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_scene_settings.py index 5e42b5ab2f..8bad5c43c8 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_scene_settings.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_scene_settings.py @@ -16,6 +16,8 @@ class ValidateProjectSettings( label = "Validate Scene Settings" order = pyblish.api.ValidatorOrder + + settings_category = "tvpaint" optional = True def process(self, context): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py index f8f4fbb3c9..9669acf1b5 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_start_frame.py @@ -27,6 +27,8 @@ class ValidateStartFrame( order = pyblish.api.ValidatorOrder hosts = ["tvpaint"] actions = [RepairStartFrame] + + settings_category = "tvpaint" optional = True def process(self, context): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_metadata.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_metadata.py index 1d9954d051..34c02c78ed 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_metadata.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_metadata.py @@ -31,6 +31,8 @@ class ValidateWorkfileMetadata(pyblish.api.ContextPlugin): actions = [ValidateWorkfileMetadataRepair] + settings_category = "tvpaint" + required_keys = {"project_name", "folder_path", "task_name"} def process(self, context): diff --git a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_project_name.py b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_project_name.py index 5b42842717..868c7d44fc 100644 --- a/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_project_name.py +++ b/server_addon/tvpaint/client/ayon_tvpaint/plugins/publish/validate_workfile_project_name.py @@ -12,6 +12,8 @@ class ValidateWorkfileProjectName(pyblish.api.ContextPlugin): label = "Validate Workfile Project Name" order = pyblish.api.ValidatorOrder + settings_category = "tvpaint" + def process(self, context): workfile_context = context.data.get("workfile_context") # If workfile context is missing than project is matching to From 3dc40e4ba406cafddb3751d4be4fd60657d1a081 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 22 May 2024 18:14:19 +0200 Subject: [PATCH 230/269] remove 'app_host_name' as it's supported since server 1.1.1 --- server_addon/tvpaint/package.py | 1 - 1 file changed, 1 deletion(-) diff --git a/server_addon/tvpaint/package.py b/server_addon/tvpaint/package.py index c9e482efe7..073d04c07e 100644 --- a/server_addon/tvpaint/package.py +++ b/server_addon/tvpaint/package.py @@ -1,7 +1,6 @@ name = "tvpaint" title = "TVPaint" version = "0.2.0" -app_host_name = "tvpaint" client_dir = "ayon_tvpaint" ayon_required_addons = { From 4bef6c9911ff47edf88dfa1b45fbb36c945e90e6 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Thu, 23 May 2024 12:34:54 +0300 Subject: [PATCH 231/269] refactor an if condition Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../plugins/publish/validate_export_is_a_single_frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/validate_export_is_a_single_frame.py b/client/ayon_core/hosts/houdini/plugins/publish/validate_export_is_a_single_frame.py index 6775699adf..b188055bc7 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/validate_export_is_a_single_frame.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/validate_export_is_a_single_frame.py @@ -42,7 +42,7 @@ class ValidateSingleFrame(pyblish.api.InstancePlugin, frame_end = instance.data.get("frameEndHandle") # This happens if instance node has no 'trange' parameter. - if (frame_start or frame_end) is None: + if frame_start is None or frame_end is None: cls.log.debug( "No frame data, skipping check.." ) From c86c3770b54f03b898188ed74c780db18a75d517 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 14:39:47 +0200 Subject: [PATCH 232/269] bump version to '0.3.2' --- client/ayon_core/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/version.py b/client/ayon_core/version.py index 275e1b1dd6..655595d9f4 100644 --- a/client/ayon_core/version.py +++ b/client/ayon_core/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON core addon version.""" -__version__ = "0.3.2-dev.1" +__version__ = "0.3.2" diff --git a/package.py b/package.py index b7b8d2dae6..cf9d7b2035 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "core" title = "Core" -version = "0.3.2-dev.1" +version = "0.3.2" client_dir = "ayon_core" From 5be9f4e253f9765e635a3c98444712bfdf5365e9 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 14:40:20 +0200 Subject: [PATCH 233/269] bump version to '0.3.3-dev.1' --- client/ayon_core/version.py | 2 +- package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/version.py b/client/ayon_core/version.py index 655595d9f4..e4297e2000 100644 --- a/client/ayon_core/version.py +++ b/client/ayon_core/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON core addon version.""" -__version__ = "0.3.2" +__version__ = "0.3.3-dev.1" diff --git a/package.py b/package.py index cf9d7b2035..73f7174b6f 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,6 @@ name = "core" title = "Core" -version = "0.3.2" +version = "0.3.3-dev.1" client_dir = "ayon_core" From a25bda81a1a29f3987a88181ff11ea93bb64d360 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 23 May 2024 15:01:47 +0200 Subject: [PATCH 234/269] fix version requirements --- server_addon/clockify/package.py | 2 +- server_addon/tvpaint/package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/clockify/package.py b/server_addon/clockify/package.py index 9482d7e0f7..61e0685191 100644 --- a/server_addon/clockify/package.py +++ b/server_addon/clockify/package.py @@ -4,6 +4,6 @@ version = "0.2.0" client_dir = "ayon_clockify" ayon_required_addons = { - "core": ">0.3.1", + "core": ">0.3.2", } ayon_compatible_addons = {} diff --git a/server_addon/tvpaint/package.py b/server_addon/tvpaint/package.py index 073d04c07e..3ab35f727e 100644 --- a/server_addon/tvpaint/package.py +++ b/server_addon/tvpaint/package.py @@ -4,6 +4,6 @@ version = "0.2.0" client_dir = "ayon_tvpaint" ayon_required_addons = { - "core": ">0.3.1", + "core": ">0.3.2", } ayon_compatible_addons = {} From a75cb56dc5f31e16184322becd01bc56aa00c7d8 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Thu, 23 May 2024 16:16:07 +0100 Subject: [PATCH 235/269] 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 236/269] 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 237/269] 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 238/269] 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 239/269] 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 240/269] 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 241/269] 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 242/269] 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 243/269] 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 244/269] 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 245/269] 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 246/269] 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 247/269] 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 248/269] 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 249/269] 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 250/269] 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 251/269] 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 252/269] 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 253/269] 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 254/269] 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 255/269] 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 256/269] 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 257/269] 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 258/269] 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 259/269] 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 260/269] 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 From 158e9b75536af222632571d40758e8cdc43851c0 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 24 May 2024 16:19:50 +0200 Subject: [PATCH 261/269] Publish representation with `isIntermediate` flag in data - Adjusted method parameters in ExporterReview class for better readability. - Added colorspace parameter to get_representation_data method. - Included representation data with isIntermediate flag for identifying intermediate files. --- client/ayon_core/hosts/nuke/api/plugin.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/plugin.py b/client/ayon_core/hosts/nuke/api/plugin.py index ec13104d4d..ffe0cf2a2c 100644 --- a/client/ayon_core/hosts/nuke/api/plugin.py +++ b/client/ayon_core/hosts/nuke/api/plugin.py @@ -572,8 +572,11 @@ class ExporterReview(object): self.fhead = self.fhead.replace("#", "")[:-1] def get_representation_data( - self, tags=None, range=False, - custom_tags=None, colorspace=None + self, + tags=None, + range=False, + custom_tags=None, + colorspace=None, ): """ Add representation data to self.data @@ -584,6 +587,8 @@ class ExporterReview(object): Defaults to False. custom_tags (list[str], optional): user inputted custom tags. Defaults to None. + colorspace (str, optional): colorspace name. + Defaults to None. """ add_tags = tags or [] repre = { @@ -591,7 +596,13 @@ class ExporterReview(object): "ext": self.ext, "files": self.file, "stagingDir": self.staging_dir, - "tags": [self.name.replace("_", "-")] + add_tags + "tags": [self.name.replace("_", "-")] + add_tags, + "data": { + # making sure that once intermediate file is published + # as representation, we will be able to then identify it + # from representation.data.isIntermediate + "isIntermediate": True + }, } if custom_tags: @@ -999,7 +1010,7 @@ class ExporterReviewMov(ExporterReview): tags=tags + add_tags, custom_tags=add_custom_tags, range=True, - colorspace=colorspace + colorspace=colorspace, ) self.log.debug("Representation... `{}`".format(self.data)) From 3d6f1a7c27a9e029c81d92a57cccaf305d32d330 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 27 May 2024 14:20:20 +0200 Subject: [PATCH 262/269] nuke host folder migrated into server_addons --- .../nuke/client/ayon_nuke}/__init__.py | 0 .../nuke/client/ayon_nuke}/addon.py | 0 .../nuke/client/ayon_nuke}/api/__init__.py | 0 .../nuke/client/ayon_nuke}/api/actions.py | 0 .../nuke/client/ayon_nuke}/api/command.py | 0 .../nuke/client/ayon_nuke}/api/constants.py | 0 .../nuke/client/ayon_nuke}/api/gizmo_menu.py | 0 .../nuke/client/ayon_nuke}/api/lib.py | 10 +++++----- .../nuke/client/ayon_nuke}/api/pipeline.py | 8 ++++---- .../nuke/client/ayon_nuke}/api/plugin.py | 2 +- .../nuke/client/ayon_nuke}/api/utils.py | 0 .../client/ayon_nuke}/api/workfile_template_builder.py | 0 .../nuke/client/ayon_nuke}/api/workio.py | 0 .../client/ayon_nuke}/hooks/pre_nukeassist_setup.py | 0 .../nuke/client/ayon_nuke}/plugins/__init__.py | 0 .../nuke/client/ayon_nuke}/plugins/create/__init__.py | 0 .../client/ayon_nuke}/plugins/create/convert_legacy.py | 4 ++-- .../ayon_nuke}/plugins/create/create_backdrop.py | 2 +- .../client/ayon_nuke}/plugins/create/create_camera.py | 4 ++-- .../client/ayon_nuke}/plugins/create/create_gizmo.py | 2 +- .../client/ayon_nuke}/plugins/create/create_model.py | 2 +- .../client/ayon_nuke}/plugins/create/create_source.py | 2 +- .../ayon_nuke}/plugins/create/create_write_image.py | 2 +- .../plugins/create/create_write_prerender.py | 2 +- .../ayon_nuke}/plugins/create/create_write_render.py | 2 +- .../ayon_nuke}/plugins/create/workfile_creator.py | 4 ++-- .../ayon_nuke}/plugins/inventory/repair_old_loaders.py | 2 +- .../ayon_nuke}/plugins/inventory/select_containers.py | 2 +- .../nuke/client/ayon_nuke}/plugins/load/actions.py | 2 +- .../client/ayon_nuke}/plugins/load/load_backdrop.py | 6 +++--- .../client/ayon_nuke}/plugins/load/load_camera_abc.py | 4 ++-- .../nuke/client/ayon_nuke}/plugins/load/load_clip.py | 6 +++--- .../client/ayon_nuke}/plugins/load/load_effects.py | 2 +- .../client/ayon_nuke}/plugins/load/load_effects_ip.py | 4 ++-- .../nuke/client/ayon_nuke}/plugins/load/load_gizmo.py | 4 ++-- .../client/ayon_nuke}/plugins/load/load_gizmo_ip.py | 4 ++-- .../nuke/client/ayon_nuke}/plugins/load/load_image.py | 4 ++-- .../client/ayon_nuke}/plugins/load/load_matchmove.py | 0 .../nuke/client/ayon_nuke}/plugins/load/load_model.py | 4 ++-- .../client/ayon_nuke}/plugins/load/load_ociolook.py | 2 +- .../ayon_nuke}/plugins/load/load_script_precomp.py | 4 ++-- .../ayon_nuke}/plugins/publish/collect_backdrop.py | 2 +- .../ayon_nuke}/plugins/publish/collect_context_data.py | 2 +- .../ayon_nuke}/plugins/publish/collect_framerate.py | 0 .../client/ayon_nuke}/plugins/publish/collect_gizmo.py | 0 .../plugins/publish/collect_headless_farm.py | 0 .../client/ayon_nuke}/plugins/publish/collect_model.py | 0 .../plugins/publish/collect_nuke_instance_data.py | 0 .../client/ayon_nuke}/plugins/publish/collect_reads.py | 0 .../ayon_nuke}/plugins/publish/collect_slate_node.py | 0 .../ayon_nuke}/plugins/publish/collect_workfile.py | 0 .../ayon_nuke}/plugins/publish/collect_writes.py | 0 .../ayon_nuke}/plugins/publish/extract_backdrop.py | 2 +- .../ayon_nuke}/plugins/publish/extract_camera.py | 2 +- .../client/ayon_nuke}/plugins/publish/extract_gizmo.py | 4 ++-- .../plugins/publish/extract_headless_farm.py | 0 .../client/ayon_nuke}/plugins/publish/extract_model.py | 2 +- .../ayon_nuke}/plugins/publish/extract_ouput_node.py | 2 +- .../plugins/publish/extract_output_directory.py | 0 .../ayon_nuke}/plugins/publish/extract_render_local.py | 0 .../ayon_nuke}/plugins/publish/extract_review_data.py | 0 .../plugins/publish/extract_review_data_lut.py | 4 ++-- .../plugins/publish/extract_review_intermediates.py | 4 ++-- .../ayon_nuke}/plugins/publish/extract_script_save.py | 0 .../ayon_nuke}/plugins/publish/extract_slate_frame.py | 2 +- .../plugins/publish/help/validate_asset_context.xml | 0 .../plugins/publish/help/validate_backdrop.xml | 0 .../ayon_nuke}/plugins/publish/help/validate_gizmo.xml | 0 .../ayon_nuke}/plugins/publish/help/validate_knobs.xml | 0 .../publish/help/validate_output_resolution.xml | 0 .../plugins/publish/help/validate_proxy_mode.xml | 0 .../plugins/publish/help/validate_rendered_frames.xml | 0 .../publish/help/validate_script_attributes.xml | 0 .../plugins/publish/help/validate_write_nodes.xml | 0 .../plugins/publish/increment_script_version.py | 0 .../ayon_nuke}/plugins/publish/remove_ouput_node.py | 0 .../plugins/publish/validate_asset_context.py | 2 +- .../ayon_nuke}/plugins/publish/validate_backdrop.py | 0 .../plugins/publish/validate_exposed_knobs.py | 2 +- .../ayon_nuke}/plugins/publish/validate_gizmo.py | 0 .../ayon_nuke}/plugins/publish/validate_knobs.py | 0 .../plugins/publish/validate_output_resolution.py | 0 .../ayon_nuke}/plugins/publish/validate_proxy_mode.py | 0 .../plugins/publish/validate_rendered_frames.py | 0 .../plugins/publish/validate_script_attributes.py | 2 +- .../ayon_nuke}/plugins/publish/validate_write_nodes.py | 2 +- .../plugins/workfile_build/create_placeholder.py | 4 ++-- .../plugins/workfile_build/load_placeholder.py | 4 ++-- .../nuke/client/ayon_nuke}/startup/__init__.py | 0 .../nuke/client/ayon_nuke}/startup/clear_rendered.py | 0 .../client/ayon_nuke}/startup/custom_write_node.py | 2 +- .../ayon_nuke}/startup/frame_setting_for_read_nodes.py | 0 .../nuke/client/ayon_nuke}/startup/menu.py | 2 +- .../nuke/client/ayon_nuke}/startup/write_to_read.py | 0 .../ayon_nuke}/vendor/google/protobuf/__init__.py | 0 .../ayon_nuke}/vendor/google/protobuf/any_pb2.py | 0 .../ayon_nuke}/vendor/google/protobuf/api_pb2.py | 0 .../vendor/google/protobuf/compiler/__init__.py | 0 .../vendor/google/protobuf/compiler/plugin_pb2.py | 0 .../ayon_nuke}/vendor/google/protobuf/descriptor.py | 0 .../vendor/google/protobuf/descriptor_database.py | 0 .../vendor/google/protobuf/descriptor_pb2.py | 0 .../vendor/google/protobuf/descriptor_pool.py | 0 .../ayon_nuke}/vendor/google/protobuf/duration_pb2.py | 0 .../ayon_nuke}/vendor/google/protobuf/empty_pb2.py | 0 .../vendor/google/protobuf/field_mask_pb2.py | 0 .../vendor/google/protobuf/internal/__init__.py | 0 .../vendor/google/protobuf/internal/_parameterized.py | 0 .../google/protobuf/internal/api_implementation.py | 0 .../vendor/google/protobuf/internal/builder.py | 0 .../vendor/google/protobuf/internal/containers.py | 0 .../vendor/google/protobuf/internal/decoder.py | 0 .../vendor/google/protobuf/internal/encoder.py | 0 .../google/protobuf/internal/enum_type_wrapper.py | 0 .../vendor/google/protobuf/internal/extension_dict.py | 0 .../google/protobuf/internal/message_listener.py | 0 .../protobuf/internal/message_set_extensions_pb2.py | 0 .../protobuf/internal/missing_enum_values_pb2.py | 0 .../protobuf/internal/more_extensions_dynamic_pb2.py | 0 .../google/protobuf/internal/more_extensions_pb2.py | 0 .../google/protobuf/internal/more_messages_pb2.py | 0 .../vendor/google/protobuf/internal/no_package_pb2.py | 0 .../vendor/google/protobuf/internal/python_message.py | 0 .../vendor/google/protobuf/internal/type_checkers.py | 0 .../google/protobuf/internal/well_known_types.py | 0 .../vendor/google/protobuf/internal/wire_format.py | 0 .../ayon_nuke}/vendor/google/protobuf/json_format.py | 0 .../ayon_nuke}/vendor/google/protobuf/message.py | 0 .../vendor/google/protobuf/message_factory.py | 0 .../ayon_nuke}/vendor/google/protobuf/proto_builder.py | 0 .../vendor/google/protobuf/pyext/__init__.py | 0 .../vendor/google/protobuf/pyext/cpp_message.py | 0 .../vendor/google/protobuf/pyext/python_pb2.py | 0 .../ayon_nuke}/vendor/google/protobuf/reflection.py | 0 .../ayon_nuke}/vendor/google/protobuf/service.py | 0 .../vendor/google/protobuf/service_reflection.py | 0 .../vendor/google/protobuf/source_context_pb2.py | 0 .../ayon_nuke}/vendor/google/protobuf/struct_pb2.py | 0 .../vendor/google/protobuf/symbol_database.py | 0 .../ayon_nuke}/vendor/google/protobuf/text_encoding.py | 0 .../ayon_nuke}/vendor/google/protobuf/text_format.py | 0 .../ayon_nuke}/vendor/google/protobuf/timestamp_pb2.py | 0 .../ayon_nuke}/vendor/google/protobuf/type_pb2.py | 0 .../ayon_nuke}/vendor/google/protobuf/util/__init__.py | 0 .../vendor/google/protobuf/util/json_format_pb2.py | 0 .../google/protobuf/util/json_format_proto3_pb2.py | 0 .../ayon_nuke}/vendor/google/protobuf/wrappers_pb2.py | 0 147 files changed, 71 insertions(+), 71 deletions(-) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/addon.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/actions.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/command.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/constants.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/gizmo_menu.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/lib.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/pipeline.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/plugin.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/utils.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/workfile_template_builder.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/api/workio.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/hooks/pre_nukeassist_setup.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/convert_legacy.py (93%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/create_backdrop.py (97%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/create_camera.py (95%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/create_gizmo.py (97%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/create_model.py (97%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/create_source.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/create_write_image.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/create_write_prerender.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/create_write_render.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/create/workfile_creator.py (96%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/inventory/repair_old_loaders.py (94%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/inventory/select_containers.py (88%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/actions.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_backdrop.py (97%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_camera_abc.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_clip.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_effects.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_effects_ip.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_gizmo.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_gizmo_ip.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_image.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_matchmove.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_model.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_ociolook.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/load/load_script_precomp.py (97%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_backdrop.py (97%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_context_data.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_framerate.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_gizmo.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_headless_farm.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_model.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_nuke_instance_data.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_reads.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_slate_node.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_workfile.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/collect_writes.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_backdrop.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_camera.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_gizmo.py (96%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_headless_farm.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_model.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_ouput_node.py (95%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_output_directory.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_render_local.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_review_data.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_review_data_lut.py (95%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_review_intermediates.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_script_save.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/extract_slate_frame.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_asset_context.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_backdrop.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_gizmo.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_knobs.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_output_resolution.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_proxy_mode.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_rendered_frames.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_script_attributes.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/help/validate_write_nodes.xml (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/increment_script_version.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/remove_ouput_node.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_asset_context.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_backdrop.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_exposed_knobs.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_gizmo.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_knobs.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_output_resolution.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_proxy_mode.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_rendered_frames.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_script_attributes.py (98%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/publish/validate_write_nodes.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/workfile_build/create_placeholder.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/plugins/workfile_build/load_placeholder.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/startup/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/startup/clear_rendered.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/startup/custom_write_node.py (99%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/startup/frame_setting_for_read_nodes.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/startup/menu.py (64%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/startup/write_to_read.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/any_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/api_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/compiler/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/compiler/plugin_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/descriptor.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/descriptor_database.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/descriptor_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/descriptor_pool.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/duration_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/empty_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/field_mask_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/_parameterized.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/api_implementation.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/builder.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/containers.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/decoder.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/encoder.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/enum_type_wrapper.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/extension_dict.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/message_listener.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/message_set_extensions_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/missing_enum_values_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/more_extensions_dynamic_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/more_extensions_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/more_messages_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/no_package_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/python_message.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/type_checkers.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/well_known_types.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/internal/wire_format.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/json_format.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/message.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/message_factory.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/proto_builder.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/pyext/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/pyext/cpp_message.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/pyext/python_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/reflection.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/service.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/service_reflection.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/source_context_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/struct_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/symbol_database.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/text_encoding.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/text_format.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/timestamp_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/type_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/util/__init__.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/util/json_format_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/util/json_format_proto3_pb2.py (100%) rename {client/ayon_core/hosts/nuke => server_addon/nuke/client/ayon_nuke}/vendor/google/protobuf/wrappers_pb2.py (100%) diff --git a/client/ayon_core/hosts/nuke/__init__.py b/server_addon/nuke/client/ayon_nuke/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/__init__.py rename to server_addon/nuke/client/ayon_nuke/__init__.py diff --git a/client/ayon_core/hosts/nuke/addon.py b/server_addon/nuke/client/ayon_nuke/addon.py similarity index 100% rename from client/ayon_core/hosts/nuke/addon.py rename to server_addon/nuke/client/ayon_nuke/addon.py diff --git a/client/ayon_core/hosts/nuke/api/__init__.py b/server_addon/nuke/client/ayon_nuke/api/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/api/__init__.py rename to server_addon/nuke/client/ayon_nuke/api/__init__.py diff --git a/client/ayon_core/hosts/nuke/api/actions.py b/server_addon/nuke/client/ayon_nuke/api/actions.py similarity index 100% rename from client/ayon_core/hosts/nuke/api/actions.py rename to server_addon/nuke/client/ayon_nuke/api/actions.py diff --git a/client/ayon_core/hosts/nuke/api/command.py b/server_addon/nuke/client/ayon_nuke/api/command.py similarity index 100% rename from client/ayon_core/hosts/nuke/api/command.py rename to server_addon/nuke/client/ayon_nuke/api/command.py diff --git a/client/ayon_core/hosts/nuke/api/constants.py b/server_addon/nuke/client/ayon_nuke/api/constants.py similarity index 100% rename from client/ayon_core/hosts/nuke/api/constants.py rename to server_addon/nuke/client/ayon_nuke/api/constants.py diff --git a/client/ayon_core/hosts/nuke/api/gizmo_menu.py b/server_addon/nuke/client/ayon_nuke/api/gizmo_menu.py similarity index 100% rename from client/ayon_core/hosts/nuke/api/gizmo_menu.py rename to server_addon/nuke/client/ayon_nuke/api/gizmo_menu.py diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/server_addon/nuke/client/ayon_nuke/api/lib.py similarity index 99% rename from client/ayon_core/hosts/nuke/api/lib.py rename to server_addon/nuke/client/ayon_nuke/api/lib.py index 500a0f9601..09dab4687a 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/server_addon/nuke/client/ayon_nuke/api/lib.py @@ -354,7 +354,7 @@ def imprint(node, data, tab=None): Examples: ``` import nuke - from ayon_core.hosts.nuke.api import lib + from ayon_nuke.api import lib node = nuke.createNode("NoOp") data = { @@ -419,7 +419,7 @@ def add_publish_knob(node): return node -@deprecated("ayon_core.hosts.nuke.api.lib.set_node_data") +@deprecated("ayon_nuke.api.lib.set_node_data") def set_avalon_knob_data(node, data=None, prefix="avalon:"): """[DEPRECATED] Sets data into nodes's avalon knob @@ -485,7 +485,7 @@ def set_avalon_knob_data(node, data=None, prefix="avalon:"): return node -@deprecated("ayon_core.hosts.nuke.api.lib.get_node_data") +@deprecated("ayon_nuke.api.lib.get_node_data") def get_avalon_knob_data(node, prefix="avalon:", create=True): """[DEPRECATED] Gets a data from nodes's avalon knob @@ -1028,7 +1028,7 @@ def add_button_render_on_farm(node): name = "renderOnFarm" label = "Render On Farm" value = ( - "from ayon_core.hosts.nuke.api.utils import submit_render_on_farm;" + "from ayon_nuke.api.utils import submit_render_on_farm;" "submit_render_on_farm(nuke.thisNode())" ) knob = nuke.PyScript_Knob(name, label, value) @@ -2469,7 +2469,7 @@ def _launch_workfile_app(): host_tools.show_workfiles(parent=None, on_top=True) -@deprecated("ayon_core.hosts.nuke.api.lib.start_workfile_template_builder") +@deprecated("ayon_nuke.api.lib.start_workfile_template_builder") def process_workfile_builder(): """ [DEPRECATED] Process workfile builder on nuke start diff --git a/client/ayon_core/hosts/nuke/api/pipeline.py b/server_addon/nuke/client/ayon_nuke/api/pipeline.py similarity index 99% rename from client/ayon_core/hosts/nuke/api/pipeline.py rename to server_addon/nuke/client/ayon_nuke/api/pipeline.py index d35a2e89e0..0425dd20d4 100644 --- a/client/ayon_core/hosts/nuke/api/pipeline.py +++ b/server_addon/nuke/client/ayon_nuke/api/pipeline.py @@ -188,10 +188,10 @@ def reload_config(): """ for module in ( - "ayon_core.hosts.nuke.api.actions", - "ayon_core.hosts.nuke.api.menu", - "ayon_core.hosts.nuke.api.plugin", - "ayon_core.hosts.nuke.api.lib", + "ayon_nuke.api.actions", + "ayon_nuke.api.menu", + "ayon_nuke.api.plugin", + "ayon_nuke.api.lib", ): log.info("Reloading module: {}...".format(module)) diff --git a/client/ayon_core/hosts/nuke/api/plugin.py b/server_addon/nuke/client/ayon_nuke/api/plugin.py similarity index 99% rename from client/ayon_core/hosts/nuke/api/plugin.py rename to server_addon/nuke/client/ayon_nuke/api/plugin.py index ec13104d4d..03b4af3475 100644 --- a/client/ayon_core/hosts/nuke/api/plugin.py +++ b/server_addon/nuke/client/ayon_nuke/api/plugin.py @@ -1038,7 +1038,7 @@ def convert_to_valid_instaces(): } return mapping[product_type] - from ayon_core.hosts.nuke.api import workio + from ayon_nuke.api import workio task_name = get_current_task_name() diff --git a/client/ayon_core/hosts/nuke/api/utils.py b/server_addon/nuke/client/ayon_nuke/api/utils.py similarity index 100% rename from client/ayon_core/hosts/nuke/api/utils.py rename to server_addon/nuke/client/ayon_nuke/api/utils.py diff --git a/client/ayon_core/hosts/nuke/api/workfile_template_builder.py b/server_addon/nuke/client/ayon_nuke/api/workfile_template_builder.py similarity index 100% rename from client/ayon_core/hosts/nuke/api/workfile_template_builder.py rename to server_addon/nuke/client/ayon_nuke/api/workfile_template_builder.py diff --git a/client/ayon_core/hosts/nuke/api/workio.py b/server_addon/nuke/client/ayon_nuke/api/workio.py similarity index 100% rename from client/ayon_core/hosts/nuke/api/workio.py rename to server_addon/nuke/client/ayon_nuke/api/workio.py diff --git a/client/ayon_core/hosts/nuke/hooks/pre_nukeassist_setup.py b/server_addon/nuke/client/ayon_nuke/hooks/pre_nukeassist_setup.py similarity index 100% rename from client/ayon_core/hosts/nuke/hooks/pre_nukeassist_setup.py rename to server_addon/nuke/client/ayon_nuke/hooks/pre_nukeassist_setup.py diff --git a/client/ayon_core/hosts/nuke/plugins/__init__.py b/server_addon/nuke/client/ayon_nuke/plugins/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/__init__.py rename to server_addon/nuke/client/ayon_nuke/plugins/__init__.py diff --git a/client/ayon_core/hosts/nuke/plugins/create/__init__.py b/server_addon/nuke/client/ayon_nuke/plugins/create/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/create/__init__.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/__init__.py diff --git a/client/ayon_core/hosts/nuke/plugins/create/convert_legacy.py b/server_addon/nuke/client/ayon_nuke/plugins/create/convert_legacy.py similarity index 93% rename from client/ayon_core/hosts/nuke/plugins/create/convert_legacy.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/convert_legacy.py index 8fb8abfbbf..65e719d15b 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/convert_legacy.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/convert_legacy.py @@ -1,12 +1,12 @@ from ayon_core.pipeline import AYON_INSTANCE_ID, AVALON_INSTANCE_ID from ayon_core.pipeline.create.creator_plugins import ProductConvertorPlugin -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( INSTANCE_DATA_KNOB, get_node_data, get_avalon_knob_data, NODE_TAB_NAME, ) -from ayon_core.hosts.nuke.api.plugin import convert_to_valid_instaces +from ayon_nuke.api.plugin import convert_to_valid_instaces import nuke diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_backdrop.py similarity index 97% rename from client/ayon_core/hosts/nuke/plugins/create/create_backdrop.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/create_backdrop.py index cefd9501ec..6d50b066d7 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_backdrop.py @@ -1,6 +1,6 @@ from nukescripts import autoBackdrop -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( NukeCreator, maintained_selection, select_nodes diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_camera.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_camera.py similarity index 95% rename from client/ayon_core/hosts/nuke/plugins/create/create_camera.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/create_camera.py index 764de84dcf..acf7448232 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_camera.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_camera.py @@ -1,10 +1,10 @@ import nuke -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( NukeCreator, NukeCreatorError, maintained_selection ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( create_camera_node_by_version ) diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_gizmo.py similarity index 97% rename from client/ayon_core/hosts/nuke/plugins/create/create_gizmo.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/create_gizmo.py index ccc6aa13bd..cc1c4edf82 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_gizmo.py @@ -1,5 +1,5 @@ import nuke -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( NukeCreator, NukeCreatorError, maintained_selection diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_model.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_model.py similarity index 97% rename from client/ayon_core/hosts/nuke/plugins/create/create_model.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/create_model.py index 507b7a1b57..6c1bf612b9 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_model.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_model.py @@ -1,5 +1,5 @@ import nuke -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( NukeCreator, NukeCreatorError, maintained_selection diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_source.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_source.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/create/create_source.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/create_source.py index ac6b8f694b..b2a21f032d 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_source.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_source.py @@ -1,7 +1,7 @@ import nuke import six import sys -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( INSTANCE_DATA_KNOB, NukeCreator, NukeCreatorError, diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/create/create_write_image.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py index fc2538f23d..43f9d4c207 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_image.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py @@ -12,7 +12,7 @@ from ayon_core.lib import ( EnumDef ) from ayon_core.hosts.nuke import api as napi -from ayon_core.hosts.nuke.api.plugin import exposed_write_knobs +from ayon_nuke.api.plugin import exposed_write_knobs class CreateWriteImage(napi.NukeWriteCreator): diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py index 47796d159c..91b0022c86 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_prerender.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py @@ -9,7 +9,7 @@ from ayon_core.lib import ( BoolDef ) from ayon_core.hosts.nuke import api as napi -from ayon_core.hosts.nuke.api.plugin import exposed_write_knobs +from ayon_nuke.api.plugin import exposed_write_knobs class CreateWritePrerender(napi.NukeWriteCreator): diff --git a/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/create/create_write_render.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py index 4cb5ccdfa2..85a09d65b7 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/create_write_render.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py @@ -9,7 +9,7 @@ from ayon_core.lib import ( BoolDef ) from ayon_core.hosts.nuke import api as napi -from ayon_core.hosts.nuke.api.plugin import exposed_write_knobs +from ayon_nuke.api.plugin import exposed_write_knobs class CreateWriteRender(napi.NukeWriteCreator): diff --git a/client/ayon_core/hosts/nuke/plugins/create/workfile_creator.py b/server_addon/nuke/client/ayon_nuke/plugins/create/workfile_creator.py similarity index 96% rename from client/ayon_core/hosts/nuke/plugins/create/workfile_creator.py rename to server_addon/nuke/client/ayon_nuke/plugins/create/workfile_creator.py index b9d83a2b48..c49ca1f502 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/workfile_creator.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/workfile_creator.py @@ -1,11 +1,11 @@ import ayon_api -import ayon_core.hosts.nuke.api as api +import ayon_nuke.api as api from ayon_core.pipeline import ( AutoCreator, CreatedInstance, ) -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( INSTANCE_DATA_KNOB, set_node_data ) diff --git a/client/ayon_core/hosts/nuke/plugins/inventory/repair_old_loaders.py b/server_addon/nuke/client/ayon_nuke/plugins/inventory/repair_old_loaders.py similarity index 94% rename from client/ayon_core/hosts/nuke/plugins/inventory/repair_old_loaders.py rename to server_addon/nuke/client/ayon_nuke/plugins/inventory/repair_old_loaders.py index 7bb5c8ef20..11d65d4b8c 100644 --- a/client/ayon_core/hosts/nuke/plugins/inventory/repair_old_loaders.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/inventory/repair_old_loaders.py @@ -1,6 +1,6 @@ from ayon_core.lib import Logger from ayon_core.pipeline import InventoryAction -from ayon_core.hosts.nuke.api.lib import set_avalon_knob_data +from ayon_nuke.api.lib import set_avalon_knob_data class RepairOldLoaders(InventoryAction): diff --git a/client/ayon_core/hosts/nuke/plugins/inventory/select_containers.py b/server_addon/nuke/client/ayon_nuke/plugins/inventory/select_containers.py similarity index 88% rename from client/ayon_core/hosts/nuke/plugins/inventory/select_containers.py rename to server_addon/nuke/client/ayon_nuke/plugins/inventory/select_containers.py index 2fa9c06984..f67c8c16e9 100644 --- a/client/ayon_core/hosts/nuke/plugins/inventory/select_containers.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/inventory/select_containers.py @@ -1,5 +1,5 @@ from ayon_core.pipeline import InventoryAction -from ayon_core.hosts.nuke.api.command import viewer_update_and_undo_stop +from ayon_nuke.api.command import viewer_update_and_undo_stop class SelectContainers(InventoryAction): diff --git a/client/ayon_core/hosts/nuke/plugins/load/actions.py b/server_addon/nuke/client/ayon_nuke/plugins/load/actions.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/load/actions.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/actions.py index 53cb03087b..a4e2b156a3 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/actions.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/actions.py @@ -4,7 +4,7 @@ from ayon_core.lib import Logger from ayon_core.pipeline import load -from ayon_core.hosts.nuke.api import lib +from ayon_nuke.api import lib log = Logger.get_logger(__name__) diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_backdrop.py similarity index 97% rename from client/ayon_core/hosts/nuke/plugins/load/load_backdrop.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_backdrop.py index 50af8a4eb9..f21920cdd2 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_backdrop.py @@ -6,7 +6,7 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( find_free_space_to_paste_nodes, maintained_selection, reset_selection, @@ -14,8 +14,8 @@ from ayon_core.hosts.nuke.api.lib import ( get_avalon_knob_data, set_avalon_knob_data ) -from ayon_core.hosts.nuke.api.command import viewer_update_and_undo_stop -from ayon_core.hosts.nuke.api import containerise, update_container +from ayon_nuke.api.command import viewer_update_and_undo_stop +from ayon_nuke.api import containerise, update_container class LoadBackdropNodes(load.LoaderPlugin): diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_camera_abc.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_camera_abc.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/load/load_camera_abc.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_camera_abc.py index 3c7d4f3bb2..a1e0eb0ecc 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_camera_abc.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_camera_abc.py @@ -5,12 +5,12 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( maintained_selection ) diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_clip.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_clip.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/load/load_clip.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_clip.py index 7fa90da86f..cc2e7359b9 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_clip.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_clip.py @@ -12,11 +12,11 @@ from ayon_core.pipeline.colorspace import ( get_imageio_file_rules_colorspace_from_filepath, get_current_context_imageio_config_preset, ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( get_imageio_input_colorspace, maintained_selection ) -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop, @@ -26,7 +26,7 @@ from ayon_core.lib.transcoding import ( VIDEO_EXTENSIONS, IMAGE_EXTENSIONS ) -from ayon_core.hosts.nuke.api import plugin +from ayon_nuke.api import plugin class LoadClip(plugin.NukeLoader): diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_effects.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/load/load_effects.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_effects.py index be7420fcf0..ea397a6ae3 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_effects.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects.py @@ -8,7 +8,7 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_effects_ip.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects_ip.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/load/load_effects_ip.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_effects_ip.py index 9bb430b37b..3ced3fb4f0 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_effects_ip.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects_ip.py @@ -8,8 +8,8 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api import lib -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import lib +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/load/load_gizmo.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo.py index 57d00795ae..b3822e9de2 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo.py @@ -5,13 +5,13 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( maintained_selection, get_avalon_knob_data, set_avalon_knob_data, swap_node_with_dependency, ) -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_gizmo_ip.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo_ip.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/load/load_gizmo_ip.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo_ip.py index ed2b1ec458..2fb3201108 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_gizmo_ip.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo_ip.py @@ -6,14 +6,14 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( maintained_selection, create_backdrop, get_avalon_knob_data, set_avalon_knob_data, swap_node_with_dependency, ) -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_image.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_image.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/load/load_image.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_image.py index b5fccd8a0d..b98668d983 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_image.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_image.py @@ -7,10 +7,10 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( get_imageio_input_colorspace ) -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_matchmove.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_matchmove.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/load/load_matchmove.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_matchmove.py diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_model.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_model.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/load/load_model.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_model.py index 40862cd1e0..2d509775f5 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_model.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_model.py @@ -5,8 +5,8 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api.lib import maintained_selection -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api.lib import maintained_selection +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_ociolook.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_ociolook.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/load/load_ociolook.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_ociolook.py index c369030b65..9210e83d6a 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_ociolook.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_ociolook.py @@ -10,7 +10,7 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( containerise, viewer_update_and_undo_stop, update_container, diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_script_precomp.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_script_precomp.py similarity index 97% rename from client/ayon_core/hosts/nuke/plugins/load/load_script_precomp.py rename to server_addon/nuke/client/ayon_nuke/plugins/load/load_script_precomp.py index d6699be164..e68ae2651b 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_script_precomp.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_script_precomp.py @@ -5,8 +5,8 @@ from ayon_core.pipeline import ( load, get_representation_path, ) -from ayon_core.hosts.nuke.api.lib import get_avalon_knob_data -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api.lib import get_avalon_knob_data +from ayon_nuke.api import ( containerise, update_container, viewer_update_and_undo_stop diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_backdrop.py similarity index 97% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_backdrop.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_backdrop.py index fc17de95b4..89136fa52b 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_backdrop.py @@ -1,6 +1,6 @@ from pprint import pformat import pyblish.api -from ayon_core.hosts.nuke.api import lib as pnlib +from ayon_nuke.api import lib as pnlib import nuke diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_context_data.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_context_data.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_context_data.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_context_data.py index 0a032e5a2d..0a5f1563d6 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/collect_context_data.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_context_data.py @@ -2,7 +2,7 @@ import os import nuke import pyblish.api from ayon_core.lib import get_version_from_path -import ayon_core.hosts.nuke.api as napi +import ayon_nuke.api as napi from ayon_core.pipeline import KnownPublishError diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_framerate.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_framerate.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_framerate.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_framerate.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_gizmo.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_gizmo.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_gizmo.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_headless_farm.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_headless_farm.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_model.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_model.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_model.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_model.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_nuke_instance_data.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_nuke_instance_data.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_nuke_instance_data.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_nuke_instance_data.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_reads.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_reads.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_reads.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_reads.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_slate_node.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_slate_node.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_slate_node.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_slate_node.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_workfile.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_workfile.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_workfile.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_workfile.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/collect_writes.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/collect_writes.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_backdrop.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_backdrop.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_backdrop.py index e53ce9015a..ec9e664a7c 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_backdrop.py @@ -5,7 +5,7 @@ import nuke import pyblish.api from ayon_core.pipeline import publish -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( maintained_selection, reset_selection, select_nodes diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_camera.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_camera.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_camera.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_camera.py index a1a5acb63b..dfb4b04f9a 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_camera.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_camera.py @@ -6,7 +6,7 @@ import nuke import pyblish.api from ayon_core.pipeline import publish -from ayon_core.hosts.nuke.api.lib import maintained_selection +from ayon_nuke.api.lib import maintained_selection class ExtractCamera(publish.Extractor): diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_gizmo.py similarity index 96% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_gizmo.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_gizmo.py index 2a2e2255fd..3a8d418ff3 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_gizmo.py @@ -4,8 +4,8 @@ import nuke import pyblish.api from ayon_core.pipeline import publish -from ayon_core.hosts.nuke.api import utils as pnutils -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api import utils as pnutils +from ayon_nuke.api.lib import ( maintained_selection, reset_selection, select_nodes diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_headless_farm.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_headless_farm.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_model.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_model.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_model.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_model.py index 36896fe595..fce47714a4 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_model.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_model.py @@ -4,7 +4,7 @@ import nuke import pyblish.api from ayon_core.pipeline import publish -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( maintained_selection, select_nodes ) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_ouput_node.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_ouput_node.py similarity index 95% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_ouput_node.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_ouput_node.py index b8e038a4f5..c0e5c4334e 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_ouput_node.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_ouput_node.py @@ -1,6 +1,6 @@ import nuke import pyblish.api -from ayon_core.hosts.nuke.api.lib import maintained_selection +from ayon_nuke.api.lib import maintained_selection class CreateOutputNode(pyblish.api.ContextPlugin): diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_output_directory.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_output_directory.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_output_directory.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_output_directory.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_render_local.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_render_local.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_data.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_review_data.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_data_lut.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data_lut.py similarity index 95% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_review_data_lut.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data_lut.py index 0674a2dd55..808ba9d8a7 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_data_lut.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data_lut.py @@ -2,8 +2,8 @@ import os import pyblish.api from ayon_core.pipeline import publish -from ayon_core.hosts.nuke.api import plugin -from ayon_core.hosts.nuke.api.lib import maintained_selection +from ayon_nuke.api import plugin +from ayon_nuke.api.lib import maintained_selection class ExtractReviewDataLut(publish.Extractor): diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_intermediates.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_intermediates.py index 82c7b6e4c5..99e02536a4 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_intermediates.py @@ -4,8 +4,8 @@ from pprint import pformat import pyblish.api from ayon_core.pipeline import publish -from ayon_core.hosts.nuke.api import plugin -from ayon_core.hosts.nuke.api.lib import maintained_selection +from ayon_nuke.api import plugin +from ayon_nuke.api.lib import maintained_selection class ExtractReviewIntermediates(publish.Extractor): diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_script_save.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_script_save.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_script_save.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_script_save.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_slate_frame.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_slate_frame.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/publish/extract_slate_frame.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/extract_slate_frame.py index 627888ac92..ff01779208 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_slate_frame.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_slate_frame.py @@ -7,7 +7,7 @@ import pyblish.api import six from ayon_core.pipeline import publish -from ayon_core.hosts.nuke.api import ( +from ayon_nuke.api import ( maintained_selection, duplicate_node, get_view_process_node diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_asset_context.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_asset_context.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_asset_context.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_asset_context.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_backdrop.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_backdrop.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_backdrop.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_backdrop.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_gizmo.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_gizmo.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_gizmo.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_gizmo.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_knobs.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_knobs.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_knobs.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_knobs.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_output_resolution.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_output_resolution.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_output_resolution.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_output_resolution.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_proxy_mode.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_proxy_mode.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_proxy_mode.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_proxy_mode.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_rendered_frames.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_rendered_frames.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_rendered_frames.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_rendered_frames.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_script_attributes.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_script_attributes.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_script_attributes.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_script_attributes.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/help/validate_write_nodes.xml b/server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_write_nodes.xml similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/help/validate_write_nodes.xml rename to server_addon/nuke/client/ayon_nuke/plugins/publish/help/validate_write_nodes.xml diff --git a/client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/increment_script_version.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/increment_script_version.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/increment_script_version.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/remove_ouput_node.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/remove_ouput_node.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/remove_ouput_node.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/remove_ouput_node.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_asset_context.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_asset_context.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_asset_context.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_asset_context.py index 93a30aa438..f747732cbf 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/validate_asset_context.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_asset_context.py @@ -10,7 +10,7 @@ from ayon_core.pipeline.publish import ( PublishXmlValidationError, OptionalPyblishPluginMixin ) -from ayon_core.hosts.nuke.api import SelectInstanceNodeAction +from ayon_nuke.api import SelectInstanceNodeAction class ValidateCorrectAssetContext( diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_backdrop.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_exposed_knobs.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_exposed_knobs.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_exposed_knobs.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_exposed_knobs.py index 217fe6fb85..7ff13bca30 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/validate_exposed_knobs.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_exposed_knobs.py @@ -1,7 +1,7 @@ import pyblish.api from ayon_core.pipeline.publish import get_errored_instances_from_context -from ayon_core.hosts.nuke.api.lib import link_knobs +from ayon_nuke.api.lib import link_knobs from ayon_core.pipeline.publish import ( OptionalPyblishPluginMixin, PublishValidationError diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_gizmo.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_knobs.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_knobs.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_knobs.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_knobs.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_output_resolution.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_output_resolution.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_proxy_mode.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_proxy_mode.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_proxy_mode.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_proxy_mode.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_rendered_frames.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_rendered_frames.py similarity index 100% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_rendered_frames.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_rendered_frames.py diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_script_attributes.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_script_attributes.py similarity index 98% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_script_attributes.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_script_attributes.py index 2bd2034079..15a586580e 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/validate_script_attributes.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_script_attributes.py @@ -5,7 +5,7 @@ from ayon_core.pipeline import ( OptionalPyblishPluginMixin ) from ayon_core.pipeline.publish import RepairAction -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( WorkfileSettings ) diff --git a/client/ayon_core/hosts/nuke/plugins/publish/validate_write_nodes.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_write_nodes.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/publish/validate_write_nodes.py rename to server_addon/nuke/client/ayon_nuke/plugins/publish/validate_write_nodes.py index 0244c1d504..6a76bf06d1 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/validate_write_nodes.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_write_nodes.py @@ -2,7 +2,7 @@ from collections import defaultdict import pyblish.api from ayon_core.pipeline.publish import get_errored_instances_from_context -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( get_write_node_template_attr, set_node_knobs_from_settings, color_gui_to_int diff --git a/client/ayon_core/hosts/nuke/plugins/workfile_build/create_placeholder.py b/server_addon/nuke/client/ayon_nuke/plugins/workfile_build/create_placeholder.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/workfile_build/create_placeholder.py rename to server_addon/nuke/client/ayon_nuke/plugins/workfile_build/create_placeholder.py index a5490021e4..4d43d59bad 100644 --- a/client/ayon_core/hosts/nuke/plugins/workfile_build/create_placeholder.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/workfile_build/create_placeholder.py @@ -4,7 +4,7 @@ from ayon_core.pipeline.workfile.workfile_template_builder import ( CreatePlaceholderItem, PlaceholderCreateMixin, ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( find_free_space_to_paste_nodes, get_extreme_positions, get_group_io_nodes, @@ -18,7 +18,7 @@ from ayon_core.hosts.nuke.api.lib import ( duplicate_node, node_tempfile, ) -from ayon_core.hosts.nuke.api.workfile_template_builder import ( +from ayon_nuke.api.workfile_template_builder import ( NukePlaceholderPlugin ) diff --git a/client/ayon_core/hosts/nuke/plugins/workfile_build/load_placeholder.py b/server_addon/nuke/client/ayon_nuke/plugins/workfile_build/load_placeholder.py similarity index 99% rename from client/ayon_core/hosts/nuke/plugins/workfile_build/load_placeholder.py rename to server_addon/nuke/client/ayon_nuke/plugins/workfile_build/load_placeholder.py index 258f48c9d3..68bc10e41b 100644 --- a/client/ayon_core/hosts/nuke/plugins/workfile_build/load_placeholder.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/workfile_build/load_placeholder.py @@ -4,7 +4,7 @@ from ayon_core.pipeline.workfile.workfile_template_builder import ( LoadPlaceholderItem, PlaceholderLoadMixin, ) -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( find_free_space_to_paste_nodes, get_extreme_positions, get_group_io_nodes, @@ -18,7 +18,7 @@ from ayon_core.hosts.nuke.api.lib import ( duplicate_node, node_tempfile, ) -from ayon_core.hosts.nuke.api.workfile_template_builder import ( +from ayon_nuke.api.workfile_template_builder import ( NukePlaceholderPlugin ) diff --git a/client/ayon_core/hosts/nuke/startup/__init__.py b/server_addon/nuke/client/ayon_nuke/startup/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/startup/__init__.py rename to server_addon/nuke/client/ayon_nuke/startup/__init__.py diff --git a/client/ayon_core/hosts/nuke/startup/clear_rendered.py b/server_addon/nuke/client/ayon_nuke/startup/clear_rendered.py similarity index 100% rename from client/ayon_core/hosts/nuke/startup/clear_rendered.py rename to server_addon/nuke/client/ayon_nuke/startup/clear_rendered.py diff --git a/client/ayon_core/hosts/nuke/startup/custom_write_node.py b/server_addon/nuke/client/ayon_nuke/startup/custom_write_node.py similarity index 99% rename from client/ayon_core/hosts/nuke/startup/custom_write_node.py rename to server_addon/nuke/client/ayon_nuke/startup/custom_write_node.py index f119e69919..5b0f240a49 100644 --- a/client/ayon_core/hosts/nuke/startup/custom_write_node.py +++ b/server_addon/nuke/client/ayon_nuke/startup/custom_write_node.py @@ -3,7 +3,7 @@ import os import nuke import nukescripts from ayon_core.pipeline import Anatomy, get_current_project_name -from ayon_core.hosts.nuke.api.lib import ( +from ayon_nuke.api.lib import ( set_node_knobs_from_settings, get_nuke_imageio_settings ) diff --git a/client/ayon_core/hosts/nuke/startup/frame_setting_for_read_nodes.py b/server_addon/nuke/client/ayon_nuke/startup/frame_setting_for_read_nodes.py similarity index 100% rename from client/ayon_core/hosts/nuke/startup/frame_setting_for_read_nodes.py rename to server_addon/nuke/client/ayon_nuke/startup/frame_setting_for_read_nodes.py diff --git a/client/ayon_core/hosts/nuke/startup/menu.py b/server_addon/nuke/client/ayon_nuke/startup/menu.py similarity index 64% rename from client/ayon_core/hosts/nuke/startup/menu.py rename to server_addon/nuke/client/ayon_nuke/startup/menu.py index 2559e2142a..c3dd8cda8f 100644 --- a/client/ayon_core/hosts/nuke/startup/menu.py +++ b/server_addon/nuke/client/ayon_nuke/startup/menu.py @@ -1,5 +1,5 @@ from ayon_core.pipeline import install_host -from ayon_core.hosts.nuke.api import NukeHost +from ayon_nuke.api import NukeHost host = NukeHost() install_host(host) diff --git a/client/ayon_core/hosts/nuke/startup/write_to_read.py b/server_addon/nuke/client/ayon_nuke/startup/write_to_read.py similarity index 100% rename from client/ayon_core/hosts/nuke/startup/write_to_read.py rename to server_addon/nuke/client/ayon_nuke/startup/write_to_read.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/__init__.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/__init__.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/__init__.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/any_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/any_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/any_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/any_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/api_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/api_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/api_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/api_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/compiler/__init__.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/compiler/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/compiler/__init__.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/compiler/__init__.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/compiler/plugin_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/compiler/plugin_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/compiler/plugin_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/compiler/plugin_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/descriptor.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/descriptor.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/descriptor.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/descriptor.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/descriptor_database.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/descriptor_database.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/descriptor_database.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/descriptor_database.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/descriptor_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/descriptor_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/descriptor_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/descriptor_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/descriptor_pool.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/descriptor_pool.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/descriptor_pool.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/descriptor_pool.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/duration_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/duration_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/duration_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/duration_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/empty_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/empty_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/empty_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/empty_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/field_mask_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/field_mask_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/field_mask_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/field_mask_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/__init__.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/__init__.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/__init__.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/_parameterized.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/_parameterized.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/_parameterized.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/_parameterized.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/api_implementation.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/api_implementation.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/api_implementation.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/api_implementation.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/builder.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/builder.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/builder.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/builder.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/containers.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/containers.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/containers.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/containers.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/decoder.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/decoder.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/decoder.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/decoder.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/encoder.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/encoder.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/encoder.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/encoder.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/enum_type_wrapper.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/enum_type_wrapper.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/enum_type_wrapper.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/enum_type_wrapper.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/extension_dict.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/extension_dict.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/extension_dict.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/extension_dict.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/message_listener.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/message_listener.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/message_listener.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/message_listener.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/message_set_extensions_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/message_set_extensions_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/message_set_extensions_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/message_set_extensions_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/missing_enum_values_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/missing_enum_values_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/missing_enum_values_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/missing_enum_values_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/more_extensions_dynamic_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/more_extensions_dynamic_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/more_extensions_dynamic_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/more_extensions_dynamic_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/more_extensions_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/more_extensions_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/more_extensions_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/more_extensions_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/more_messages_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/more_messages_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/more_messages_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/more_messages_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/no_package_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/no_package_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/no_package_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/no_package_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/python_message.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/python_message.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/python_message.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/python_message.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/type_checkers.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/type_checkers.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/type_checkers.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/type_checkers.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/well_known_types.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/well_known_types.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/well_known_types.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/well_known_types.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/wire_format.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/wire_format.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/internal/wire_format.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/internal/wire_format.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/json_format.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/json_format.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/json_format.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/json_format.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/message.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/message.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/message.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/message.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/message_factory.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/message_factory.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/message_factory.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/message_factory.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/proto_builder.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/proto_builder.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/proto_builder.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/proto_builder.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/pyext/__init__.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/pyext/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/pyext/__init__.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/pyext/__init__.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/pyext/cpp_message.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/pyext/cpp_message.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/pyext/cpp_message.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/pyext/cpp_message.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/pyext/python_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/pyext/python_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/pyext/python_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/pyext/python_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/reflection.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/reflection.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/reflection.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/reflection.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/service.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/service.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/service.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/service.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/service_reflection.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/service_reflection.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/service_reflection.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/service_reflection.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/source_context_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/source_context_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/source_context_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/source_context_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/struct_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/struct_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/struct_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/struct_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/symbol_database.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/symbol_database.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/symbol_database.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/symbol_database.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/text_encoding.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/text_encoding.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/text_encoding.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/text_encoding.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/text_format.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/text_format.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/text_format.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/text_format.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/timestamp_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/timestamp_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/timestamp_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/timestamp_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/type_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/type_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/type_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/type_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/util/__init__.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/util/__init__.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/util/__init__.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/util/__init__.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/util/json_format_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/util/json_format_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/util/json_format_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/util/json_format_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/util/json_format_proto3_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/util/json_format_proto3_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/util/json_format_proto3_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/util/json_format_proto3_pb2.py diff --git a/client/ayon_core/hosts/nuke/vendor/google/protobuf/wrappers_pb2.py b/server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/wrappers_pb2.py similarity index 100% rename from client/ayon_core/hosts/nuke/vendor/google/protobuf/wrappers_pb2.py rename to server_addon/nuke/client/ayon_nuke/vendor/google/protobuf/wrappers_pb2.py From 6e0491af06fdb1ac28f9b7162979bd15ce6f32dd Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 27 May 2024 20:45:55 +0800 Subject: [PATCH 263/269] add options to read the deepexr file --- .../hosts/nuke/plugins/load/load_clip.py | 33 ++++++++++++++----- server_addon/nuke/package.py | 2 +- .../nuke/server/settings/loader_plugins.py | 7 ++-- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/client/ayon_core/hosts/nuke/plugins/load/load_clip.py b/client/ayon_core/hosts/nuke/plugins/load/load_clip.py index 7fa90da86f..23d8c4ae85 100644 --- a/client/ayon_core/hosts/nuke/plugins/load/load_clip.py +++ b/client/ayon_core/hosts/nuke/plugins/load/load_clip.py @@ -61,7 +61,8 @@ class LoadClip(plugin.NukeLoader): # option gui options_defaults = { "start_at_workfile": True, - "add_retime": True + "add_retime": True, + "deep_exr": False } node_name_template = "{class_name}_{ext}" @@ -78,6 +79,11 @@ class LoadClip(plugin.NukeLoader): "add_retime", help="Load with retime", default=cls.options_defaults["add_retime"] + ), + qargparse.Boolean( + "deep_exr", + help="Read with deep exr", + default=cls.options_defaults["deep_exr"] ) ] @@ -113,6 +119,9 @@ class LoadClip(plugin.NukeLoader): add_retime = options.get( "add_retime", self.options_defaults["add_retime"]) + deep_exr = options.get( + "deep_exr", self.options_defaults["deep_exr"]) + repre_id = repre_entity["id"] self.log.debug( @@ -153,13 +162,21 @@ class LoadClip(plugin.NukeLoader): return read_name = self._get_node_name(context) - - # Create the Loader with the filename path set - read_node = nuke.createNode( - "Read", - "name {}".format(read_name), - inpanel=False - ) + read_node = None + if deep_exr: + # Create the Loader with the filename path set + read_node = nuke.createNode( + "DeepRead", + "name {}".format(read_name), + inpanel=False + ) + else: + # Create the Loader with the filename path set + read_node = nuke.createNode( + "Read", + "name {}".format(read_name), + inpanel=False + ) # get colorspace colorspace = ( diff --git a/server_addon/nuke/package.py b/server_addon/nuke/package.py index d8decef208..e6f3a0bd44 100644 --- a/server_addon/nuke/package.py +++ b/server_addon/nuke/package.py @@ -1,3 +1,3 @@ name = "nuke" title = "Nuke" -version = "0.1.14" +version = "0.1.15" diff --git a/server_addon/nuke/server/settings/loader_plugins.py b/server_addon/nuke/server/settings/loader_plugins.py index 531ea8d986..22cb469e8d 100644 --- a/server_addon/nuke/server/settings/loader_plugins.py +++ b/server_addon/nuke/server/settings/loader_plugins.py @@ -22,7 +22,9 @@ class LoadClipOptionsModel(BaseSettingsModel): add_retime: bool = SettingsField( title="Add retime" ) - + deep_exr: bool = SettingsField( + title="Deep Exr Read Node" + ) class LoadClipModel(BaseSettingsModel): enabled: bool = SettingsField( @@ -65,7 +67,8 @@ DEFAULT_LOADER_PLUGINS_SETTINGS = { "node_name_template": "{class_name}_{ext}", "options_defaults": { "start_at_workfile": True, - "add_retime": True + "add_retime": True, + "deep_exr": False } } } From f18f50ad9cd383cf6c0236bbbd69e28cebf47e9a Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 27 May 2024 14:49:02 +0200 Subject: [PATCH 264/269] Add settings category "nuke" to various plugins for consistency. - Added a common settings category "nuke" to multiple plugin files. --- .../client/ayon_nuke/plugins/create/create_backdrop.py | 2 ++ .../client/ayon_nuke/plugins/create/create_camera.py | 2 ++ .../nuke/client/ayon_nuke/plugins/create/create_gizmo.py | 2 ++ .../nuke/client/ayon_nuke/plugins/create/create_model.py | 2 ++ .../client/ayon_nuke/plugins/create/create_source.py | 2 ++ .../ayon_nuke/plugins/create/create_write_image.py | 3 +++ .../ayon_nuke/plugins/create/create_write_prerender.py | 3 +++ .../ayon_nuke/plugins/create/create_write_render.py | 3 +++ .../client/ayon_nuke/plugins/create/workfile_creator.py | 3 +++ .../nuke/client/ayon_nuke/plugins/load/load_backdrop.py | 2 ++ .../client/ayon_nuke/plugins/load/load_camera_abc.py | 2 ++ .../nuke/client/ayon_nuke/plugins/load/load_clip.py | 2 ++ .../nuke/client/ayon_nuke/plugins/load/load_effects.py | 3 ++- .../client/ayon_nuke/plugins/load/load_effects_ip.py | 2 ++ .../nuke/client/ayon_nuke/plugins/load/load_gizmo.py | 2 ++ .../nuke/client/ayon_nuke/plugins/load/load_gizmo_ip.py | 2 ++ .../nuke/client/ayon_nuke/plugins/load/load_image.py | 6 +++--- .../nuke/client/ayon_nuke/plugins/load/load_matchmove.py | 2 ++ .../nuke/client/ayon_nuke/plugins/load/load_model.py | 2 ++ .../nuke/client/ayon_nuke/plugins/load/load_ociolook.py | 2 ++ .../client/ayon_nuke/plugins/load/load_script_precomp.py | 2 ++ .../client/ayon_nuke/plugins/publish/collect_backdrop.py | 2 ++ .../ayon_nuke/plugins/publish/collect_context_data.py | 2 ++ .../ayon_nuke/plugins/publish/collect_framerate.py | 2 ++ .../client/ayon_nuke/plugins/publish/collect_gizmo.py | 2 ++ .../ayon_nuke/plugins/publish/collect_headless_farm.py | 2 ++ .../client/ayon_nuke/plugins/publish/collect_model.py | 2 ++ .../plugins/publish/collect_nuke_instance_data.py | 2 ++ .../client/ayon_nuke/plugins/publish/collect_reads.py | 2 ++ .../ayon_nuke/plugins/publish/collect_slate_node.py | 2 ++ .../client/ayon_nuke/plugins/publish/collect_workfile.py | 2 ++ .../client/ayon_nuke/plugins/publish/collect_writes.py | 2 ++ .../client/ayon_nuke/plugins/publish/extract_backdrop.py | 2 ++ .../client/ayon_nuke/plugins/publish/extract_camera.py | 2 ++ .../client/ayon_nuke/plugins/publish/extract_gizmo.py | 2 ++ .../ayon_nuke/plugins/publish/extract_headless_farm.py | 2 ++ .../client/ayon_nuke/plugins/publish/extract_model.py | 2 ++ .../ayon_nuke/plugins/publish/extract_ouput_node.py | 4 +++- .../plugins/publish/extract_output_directory.py | 2 +- .../ayon_nuke/plugins/publish/extract_render_local.py | 2 ++ .../ayon_nuke/plugins/publish/extract_review_data.py | 2 ++ .../ayon_nuke/plugins/publish/extract_review_data_lut.py | 2 ++ .../plugins/publish/extract_review_intermediates.py | 2 ++ .../ayon_nuke/plugins/publish/extract_script_save.py | 4 +++- .../ayon_nuke/plugins/publish/extract_slate_frame.py | 2 ++ .../plugins/publish/increment_script_version.py | 5 +++-- .../ayon_nuke/plugins/publish/remove_ouput_node.py | 4 +++- .../ayon_nuke/plugins/publish/validate_asset_context.py | 2 ++ .../ayon_nuke/plugins/publish/validate_backdrop.py | 2 ++ .../ayon_nuke/plugins/publish/validate_exposed_knobs.py | 3 +++ .../client/ayon_nuke/plugins/publish/validate_gizmo.py | 2 ++ .../client/ayon_nuke/plugins/publish/validate_knobs.py | 2 ++ .../plugins/publish/validate_output_resolution.py | 2 ++ .../ayon_nuke/plugins/publish/validate_proxy_mode.py | 2 ++ .../plugins/publish/validate_rendered_frames.py | 2 ++ .../plugins/publish/validate_script_attributes.py | 2 ++ .../ayon_nuke/plugins/publish/validate_write_nodes.py | 2 ++ server_addon/nuke/package.py | 9 ++++++++- 58 files changed, 131 insertions(+), 11 deletions(-) diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_backdrop.py index 6d50b066d7..f97b9efeb6 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_backdrop.py @@ -10,6 +10,8 @@ from ayon_nuke.api import ( class CreateBackdrop(NukeCreator): """Add Publishable Backdrop""" + settings_category = "nuke" + identifier = "create_backdrop" label = "Nukenodes (backdrop)" product_type = "nukenodes" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_camera.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_camera.py index acf7448232..69e5b9c676 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_camera.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_camera.py @@ -12,6 +12,8 @@ from ayon_nuke.api.lib import ( class CreateCamera(NukeCreator): """Add Publishable Camera""" + settings_category = "nuke" + identifier = "create_camera" label = "Camera (3d)" product_type = "camera" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_gizmo.py index cc1c4edf82..6be7cd58db 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_gizmo.py @@ -9,6 +9,8 @@ from ayon_nuke.api import ( class CreateGizmo(NukeCreator): """Add Publishable Group as gizmo""" + settings_category = "nuke" + identifier = "create_gizmo" label = "Gizmo (group)" product_type = "gizmo" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_model.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_model.py index 6c1bf612b9..b7d7b740c2 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_model.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_model.py @@ -9,6 +9,8 @@ from ayon_nuke.api import ( class CreateModel(NukeCreator): """Add Publishable Camera""" + settings_category = "nuke" + identifier = "create_model" label = "Model (3d)" product_type = "model" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_source.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_source.py index b2a21f032d..1579cebb1d 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_source.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_source.py @@ -15,6 +15,8 @@ from ayon_core.pipeline import ( class CreateSource(NukeCreator): """Add Publishable Read with source""" + settings_category = "nuke" + identifier = "create_source" label = "Source (read)" product_type = "source" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py index 43f9d4c207..11f574732a 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py @@ -16,6 +16,9 @@ from ayon_nuke.api.plugin import exposed_write_knobs class CreateWriteImage(napi.NukeWriteCreator): + + settings_category = "nuke" + identifier = "create_write_image" label = "Image (write)" product_type = "image" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py index 91b0022c86..c18217c4c5 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py @@ -13,6 +13,9 @@ from ayon_nuke.api.plugin import exposed_write_knobs class CreateWritePrerender(napi.NukeWriteCreator): + + settings_category = "nuke" + identifier = "create_write_prerender" label = "Prerender (write)" product_type = "prerender" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py index 85a09d65b7..8ff9b2b15e 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py @@ -13,6 +13,9 @@ from ayon_nuke.api.plugin import exposed_write_knobs class CreateWriteRender(napi.NukeWriteCreator): + + settings_category = "nuke" + identifier = "create_write_render" label = "Render (write)" product_type = "render" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/workfile_creator.py b/server_addon/nuke/client/ayon_nuke/plugins/create/workfile_creator.py index c49ca1f502..463d898224 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/workfile_creator.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/workfile_creator.py @@ -13,6 +13,9 @@ import nuke class WorkfileCreator(AutoCreator): + + settings_category = "nuke" + identifier = "workfile" product_type = "workfile" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_backdrop.py index f21920cdd2..054a56d041 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_backdrop.py @@ -25,6 +25,8 @@ class LoadBackdropNodes(load.LoaderPlugin): representations = {"*"} extensions = {"nk"} + settings_category = "nuke" + label = "Import Nuke Nodes" order = 0 icon = "eye" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_camera_abc.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_camera_abc.py index a1e0eb0ecc..3930cf52fa 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_camera_abc.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_camera_abc.py @@ -24,6 +24,8 @@ class AlembicCameraLoader(load.LoaderPlugin): representations = {"*"} extensions = {"abc"} + settings_category = "nuke" + label = "Load Alembic Camera" icon = "camera" color = "orange" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_clip.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_clip.py index cc2e7359b9..8be1c7d109 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_clip.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_clip.py @@ -48,6 +48,8 @@ class LoadClip(plugin.NukeLoader): ext.lstrip(".") for ext in IMAGE_EXTENSIONS.union(VIDEO_EXTENSIONS) ) + settings_category = "nuke" + label = "Load Clip" order = -20 icon = "file-video-o" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects.py index ea397a6ae3..e923a02424 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects.py @@ -22,13 +22,14 @@ class LoadEffects(load.LoaderPlugin): representations = {"*"} extensions = {"json"} + settings_category = "nuke" + label = "Load Effects - nodes" order = 0 icon = "cc" color = "white" ignore_attr = ["useLifetime"] - def load(self, context, name, namespace, data): """ Loading function to get the soft effects to particular read node diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects_ip.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects_ip.py index 3ced3fb4f0..ce7e7debeb 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects_ip.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_effects_ip.py @@ -23,6 +23,8 @@ class LoadEffectsInputProcess(load.LoaderPlugin): representations = {"*"} extensions = {"json"} + settings_category = "nuke" + label = "Load Effects - Input Process" order = 0 icon = "eye" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo.py index b3822e9de2..1c91af0c1c 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo.py @@ -25,6 +25,8 @@ class LoadGizmo(load.LoaderPlugin): representations = {"*"} extensions = {"nk"} + settings_category = "nuke" + label = "Load Gizmo" order = 0 icon = "dropbox" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo_ip.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo_ip.py index 2fb3201108..36e878fdf1 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo_ip.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_gizmo_ip.py @@ -27,6 +27,8 @@ class LoadGizmoInputProcess(load.LoaderPlugin): representations = {"*"} extensions = {"nk"} + settings_category = "nuke" + label = "Load Gizmo - Input Process" order = 0 icon = "eye" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_image.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_image.py index b98668d983..0c43f5a5ca 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_image.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_image.py @@ -33,9 +33,9 @@ class LoadImage(load.LoaderPlugin): "image", } representations = {"*"} - extensions = set( - ext.lstrip(".") for ext in IMAGE_EXTENSIONS - ) + extensions = set(ext.lstrip(".") for ext in IMAGE_EXTENSIONS) + + settings_category = "nuke" label = "Load Image" order = -10 diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_matchmove.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_matchmove.py index beebd0458f..c1b5a24504 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_matchmove.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_matchmove.py @@ -11,6 +11,8 @@ class MatchmoveLoader(load.LoaderPlugin): representations = {"*"} extensions = {"py"} + settings_category = "nuke" + defaults = ["Camera", "Object"] label = "Run matchmove script" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_model.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_model.py index 2d509775f5..551147be96 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_model.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_model.py @@ -22,6 +22,8 @@ class AlembicModelLoader(load.LoaderPlugin): representations = {"*"} extensions = {"abc"} + settings_category = "nuke" + label = "Load Alembic" icon = "cube" color = "orange" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_ociolook.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_ociolook.py index 9210e83d6a..bdff8d7e28 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_ociolook.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_ociolook.py @@ -24,6 +24,8 @@ class LoadOcioLookNodes(load.LoaderPlugin): representations = {"*"} extensions = {"json"} + settings_category = "nuke" + label = "Load OcioLook [nodes]" order = 0 icon = "cc" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/load/load_script_precomp.py b/server_addon/nuke/client/ayon_nuke/plugins/load/load_script_precomp.py index e68ae2651b..cf543dabfd 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/load/load_script_precomp.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/load/load_script_precomp.py @@ -20,6 +20,8 @@ class LinkAsGroup(load.LoaderPlugin): representations = {"*"} extensions = {"nk"} + settings_category = "nuke" + label = "Load Precomp" order = 0 icon = "file" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_backdrop.py index 89136fa52b..1471159380 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_backdrop.py @@ -13,6 +13,8 @@ class CollectBackdrops(pyblish.api.InstancePlugin): hosts = ["nuke"] families = ["nukenodes"] + settings_category = "nuke" + def process(self, instance): self.log.debug(pformat(instance.data)) diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_context_data.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_context_data.py index 0a5f1563d6..33c8e63e82 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_context_data.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_context_data.py @@ -13,6 +13,8 @@ class CollectContextData(pyblish.api.ContextPlugin): label = "Collect context data" hosts = ['nuke'] + settings_category = "nuke" + def process(self, context): # sourcery skip: avoid-builtin-shadow root_node = nuke.root() diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_framerate.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_framerate.py index 88a449e745..cd77eab0f1 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_framerate.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_framerate.py @@ -13,5 +13,7 @@ class CollectFramerate(pyblish.api.ContextPlugin): "nukeassist" ] + settings_category = "nuke" + def process(self, context): context.data["fps"] = nuke.root()["fps"].getValue() diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_gizmo.py index fda1c7ac31..ece9823b37 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_gizmo.py @@ -11,6 +11,8 @@ class CollectGizmo(pyblish.api.InstancePlugin): hosts = ["nuke"] families = ["gizmo"] + settings_category = "nuke" + def process(self, instance): gizmo_node = instance.data["transientData"]["node"] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_headless_farm.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_headless_farm.py index 3f49a2bf01..c00b9a8f5d 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_headless_farm.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_headless_farm.py @@ -13,6 +13,8 @@ class CollectRenderOnFarm(pyblish.api.ContextPlugin): label = "Collect Render On Farm" hosts = ["nuke"] + settings_category = "nuke" + def process(self, context): if not context.data.get("render_on_farm", False): return diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_model.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_model.py index 1a2bc9c019..f4266bbbcb 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_model.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_model.py @@ -11,6 +11,8 @@ class CollectModel(pyblish.api.InstancePlugin): hosts = ["nuke"] families = ["model"] + settings_category = "nuke" + def process(self, instance): geo_node = instance.data["transientData"]["node"] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_nuke_instance_data.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_nuke_instance_data.py index 951072ff3f..d1392a8460 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_nuke_instance_data.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_nuke_instance_data.py @@ -11,6 +11,8 @@ class CollectInstanceData(pyblish.api.InstancePlugin): label = "Collect Nuke Instance Data" hosts = ["nuke", "nukeassist"] + settings_category = "nuke" + # presets sync_workfile_version_on_families = [] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_reads.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_reads.py index af17933eb1..439374e825 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_reads.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_reads.py @@ -12,6 +12,8 @@ class CollectNukeReads(pyblish.api.InstancePlugin): hosts = ["nuke", "nukeassist"] families = ["source"] + settings_category = "nuke" + def process(self, instance): self.log.debug("checking instance: {}".format(instance)) diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_slate_node.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_slate_node.py index ac30bd6051..bb3b0083ab 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_slate_node.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_slate_node.py @@ -10,6 +10,8 @@ class CollectSlate(pyblish.api.InstancePlugin): hosts = ["nuke"] families = ["render"] + settings_category = "nuke" + def process(self, instance): node = instance.data["transientData"]["node"] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_workfile.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_workfile.py index 0f03572f8b..e4bd5ed129 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_workfile.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_workfile.py @@ -11,6 +11,8 @@ class CollectWorkfile(pyblish.api.InstancePlugin): hosts = ['nuke'] families = ["workfile"] + settings_category = "nuke" + def process(self, instance): # sourcery skip: avoid-builtin-shadow script_data = instance.context.data["scriptData"] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py index 27525bcad1..c90f335d07 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py @@ -14,6 +14,8 @@ class CollectNukeWrites(pyblish.api.InstancePlugin, hosts = ["nuke", "nukeassist"] families = ["render", "prerender", "image"] + settings_category = "nuke" + # cache _write_nodes = {} _frame_ranges = {} diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_backdrop.py index ec9e664a7c..8c42920979 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_backdrop.py @@ -25,6 +25,8 @@ class ExtractBackdropNode(publish.Extractor): hosts = ["nuke"] families = ["nukenodes"] + settings_category = "nuke" + def process(self, instance): tmp_nodes = [] child_nodes = instance.data["transientData"]["childNodes"] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_camera.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_camera.py index dfb4b04f9a..83914087e3 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_camera.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_camera.py @@ -17,6 +17,8 @@ class ExtractCamera(publish.Extractor): families = ["camera"] hosts = ["nuke"] + settings_category = "nuke" + # presets write_geo_knobs = [ ("file_type", "abc"), diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_gizmo.py index 3a8d418ff3..05e3164163 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_gizmo.py @@ -23,6 +23,8 @@ class ExtractGizmo(publish.Extractor): hosts = ["nuke"] families = ["gizmo"] + settings_category = "nuke" + def process(self, instance): tmp_nodes = [] orig_grpn = instance.data["transientData"]["node"] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_headless_farm.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_headless_farm.py index 4ba55f8c46..4721fe4462 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_headless_farm.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_headless_farm.py @@ -15,6 +15,8 @@ class ExtractRenderOnFarm(pyblish.api.InstancePlugin): hosts = ["nuke"] families = ["render_on_farm"] + settings_category = "nuke" + def process(self, instance): if not instance.context.data.get("render_on_farm", False): return diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_model.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_model.py index fce47714a4..58b9d4179b 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_model.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_model.py @@ -18,6 +18,8 @@ class ExtractModel(publish.Extractor): families = ["model"] hosts = ["nuke"] + settings_category = "nuke" + # presets write_geo_knobs = [ ("file_type", "abc"), diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_ouput_node.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_ouput_node.py index c0e5c4334e..52072cddc5 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_ouput_node.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_ouput_node.py @@ -11,7 +11,9 @@ class CreateOutputNode(pyblish.api.ContextPlugin): label = 'Output Node Create' order = pyblish.api.ExtractorOrder + 0.4 families = ["workfile"] - hosts = ['nuke'] + hosts = ["nuke"] + + settings_category = "nuke" def process(self, context): # capture selection state diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_output_directory.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_output_directory.py index d999d200de..45156ca9ae 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_output_directory.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_output_directory.py @@ -10,7 +10,7 @@ class ExtractOutputDirectory(pyblish.api.InstancePlugin): label = "Output Directory" optional = True - # targets = ["process"] + settings_category = "nuke" def process(self, instance): diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py index c8be2a5564..55a2beea81 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py @@ -25,6 +25,8 @@ class NukeRenderLocal(publish.Extractor, hosts = ["nuke"] families = ["render.local", "prerender.local", "image.local"] + settings_category = "nuke" + def process(self, instance): child_nodes = ( instance.data.get("transientData", {}).get("childNodes") diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data.py index 258a019319..856616898b 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data.py @@ -16,6 +16,8 @@ class ExtractReviewData(publish.Extractor): families = ["review"] hosts = ["nuke"] + settings_category = "nuke" + def process(self, instance): fpath = instance.data["path"] ext = os.path.splitext(fpath)[-1][1:] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data_lut.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data_lut.py index 808ba9d8a7..d3377807ea 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data_lut.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_data_lut.py @@ -19,6 +19,8 @@ class ExtractReviewDataLut(publish.Extractor): families = ["review"] hosts = ["nuke"] + settings_category = "nuke" + def process(self, instance): self.log.debug("Creating staging dir...") if "representations" in instance.data: diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_intermediates.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_intermediates.py index 99e02536a4..c12d14adf4 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_intermediates.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_review_intermediates.py @@ -22,6 +22,8 @@ class ExtractReviewIntermediates(publish.Extractor): families = ["review"] hosts = ["nuke"] + settings_category = "nuke" + # presets viewer_lut_raw = None outputs = {} diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_script_save.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_script_save.py index d325684a7c..ea584b6529 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_script_save.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_script_save.py @@ -6,7 +6,9 @@ class ExtractScriptSave(pyblish.api.InstancePlugin): """Save current Nuke workfile script""" label = 'Script Save' order = pyblish.api.ExtractorOrder - 0.1 - hosts = ['nuke'] + hosts = ["nuke"] + + settings_category = "nuke" def process(self, instance): diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_slate_frame.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_slate_frame.py index ff01779208..47750ea637 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_slate_frame.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_slate_frame.py @@ -27,6 +27,8 @@ class ExtractSlateFrame(publish.Extractor): families = ["slate"] hosts = ["nuke"] + settings_category = "nuke" + # Settings values key_value_mapping = { "f_submission_note": { diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/increment_script_version.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/increment_script_version.py index 70fd04a985..36659aa2d2 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/increment_script_version.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/increment_script_version.py @@ -1,4 +1,3 @@ - import nuke import pyblish.api @@ -10,7 +9,9 @@ class IncrementScriptVersion(pyblish.api.ContextPlugin): label = "Increment Script Version" optional = True families = ["workfile"] - hosts = ['nuke'] + hosts = ["nuke"] + + settings_category = "nuke" def process(self, context): if not context.data.get("increment_script_version", True): diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/remove_ouput_node.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/remove_ouput_node.py index fb77e8638c..4c17cb5f56 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/remove_ouput_node.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/remove_ouput_node.py @@ -9,7 +9,9 @@ class RemoveOutputNode(pyblish.api.ContextPlugin): label = 'Output Node Remove' order = pyblish.api.IntegratorOrder + 0.4 families = ["workfile"] - hosts = ['nuke'] + hosts = ["nuke"] + + settings_category = "nuke" def process(self, context): try: diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_asset_context.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_asset_context.py index f747732cbf..903648fd1b 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_asset_context.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_asset_context.py @@ -34,6 +34,8 @@ class ValidateCorrectAssetContext( ] optional = True + settings_category = "nuke" + @classmethod def apply_settings(cls, project_settings): """Apply deprecated settings from project settings. diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py index 22344c661e..133dc6ec93 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py @@ -65,6 +65,8 @@ class ValidateBackdrop( hosts = ["nuke"] actions = [SelectCenterInNodeGraph] + settings_category = "nuke" + def process(self, instance): if not self.is_active(instance.data): return diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_exposed_knobs.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_exposed_knobs.py index 7ff13bca30..d1b7c146fb 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_exposed_knobs.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_exposed_knobs.py @@ -52,6 +52,9 @@ class ValidateExposedKnobs( label = "Validate Exposed Knobs" actions = [RepairExposedKnobs] hosts = ["nuke"] + + settings_category = "nuke" + product_types_mapping = { "render": "CreateWriteRender", "prerender": "CreateWritePrerender", diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py index 2cdcb90d70..3804efc9ae 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py @@ -43,6 +43,8 @@ class ValidateGizmo(pyblish.api.InstancePlugin): hosts = ["nuke"] actions = [OpenFailedGroupNode] + settings_category = "nuke" + def process(self, instance): grpn = instance.data["transientData"]["node"] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_knobs.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_knobs.py index 8bcde9609d..ea03bd94b2 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_knobs.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_knobs.py @@ -32,6 +32,8 @@ class ValidateKnobs(pyblish.api.ContextPlugin): actions = [RepairContextAction] optional = True + settings_category = "nuke" + knobs = "{}" def process(self, context): diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py index e8a00d2294..c7a6f7d47c 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py @@ -27,6 +27,8 @@ class ValidateOutputResolution( hosts = ["nuke"] actions = [RepairAction] + settings_category = "nuke" + missing_msg = "Missing Reformat node in render group node" resolution_msg = "Reformat is set to wrong format" diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_proxy_mode.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_proxy_mode.py index 26e54295c9..1eb858b17e 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_proxy_mode.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_proxy_mode.py @@ -25,6 +25,8 @@ class ValidateProxyMode(pyblish.api.ContextPlugin): hosts = ["nuke"] actions = [FixProxyMode] + settings_category = "nuke" + def process(self, context): rootNode = nuke.root() diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_rendered_frames.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_rendered_frames.py index 76ac7e97ad..20b7f6a6ac 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_rendered_frames.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_rendered_frames.py @@ -54,6 +54,8 @@ class ValidateRenderedFrames(pyblish.api.InstancePlugin): hosts = ["nuke", "nukestudio"] actions = [RepairCollectionActionToLocal, RepairCollectionActionToFarm] + settings_category = "nuke" + def process(self, instance): node = instance.data["transientData"]["node"] diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_script_attributes.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_script_attributes.py index 15a586580e..617d8d835b 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_script_attributes.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_script_attributes.py @@ -23,6 +23,8 @@ class ValidateScriptAttributes( optional = True actions = [RepairAction] + settings_category = "nuke" + def process(self, instance): if not self.is_active(instance.data): return diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_write_nodes.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_write_nodes.py index 6a76bf06d1..d642a4314c 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_write_nodes.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_write_nodes.py @@ -59,6 +59,8 @@ class ValidateNukeWriteNode( actions = [RepairNukeWriteNodeAction] hosts = ["nuke"] + settings_category = "nuke" + def process(self, instance): if not self.is_active(instance.data): return diff --git a/server_addon/nuke/package.py b/server_addon/nuke/package.py index d8decef208..af36e61cef 100644 --- a/server_addon/nuke/package.py +++ b/server_addon/nuke/package.py @@ -1,3 +1,10 @@ name = "nuke" title = "Nuke" -version = "0.1.14" +version = "0.2.0" + +client_dir = "ayon_nuke" + +ayon_required_addons = { + "core": ">0.3.2", +} +ayon_compatible_addons = {} From 18b7e6ec9e0e8b21a3926e15f8575e04aae004d0 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 27 May 2024 15:08:54 +0200 Subject: [PATCH 265/269] Add new version info for "nuke" addon. - Update the MOVED_ADDON_MILESTONE_VERSIONS dictionary to include the "nuke" addon with version 0.2.0. --- 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 dba25510be..64627ef32e 100644 --- a/client/ayon_core/addon/base.py +++ b/client/ayon_core/addon/base.py @@ -54,6 +54,7 @@ MOVED_ADDON_MILESTONE_VERSIONS = { "clockify": VersionInfo(0, 2, 0), "traypublisher": VersionInfo(0, 2, 0), "tvpaint": VersionInfo(0, 2, 0), + "nuke": VersionInfo(0, 2, 0), } # Inherit from `object` for Python 2 hosts From ca29fe77c7ec1939b863cbdb5f916f381ecfbbf5 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 27 May 2024 15:13:25 +0200 Subject: [PATCH 266/269] add line --- 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 64627ef32e..939fab68b8 100644 --- a/client/ayon_core/addon/base.py +++ b/client/ayon_core/addon/base.py @@ -57,6 +57,7 @@ MOVED_ADDON_MILESTONE_VERSIONS = { "nuke": VersionInfo(0, 2, 0), } + # Inherit from `object` for Python 2 hosts class _ModuleClass(object): """Fake module class for storing AYON addons. From 007d4a453d2a69d143cf574db837a3f32ae930fb Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 27 May 2024 15:24:14 +0200 Subject: [PATCH 267/269] import statements to use the correct module path for Nuke host API. --- server_addon/nuke/client/ayon_nuke/api/pipeline.py | 2 +- .../nuke/client/ayon_nuke/plugins/create/create_write_image.py | 2 +- .../client/ayon_nuke/plugins/create/create_write_prerender.py | 2 +- .../nuke/client/ayon_nuke/plugins/create/create_write_render.py | 2 +- .../nuke/client/ayon_nuke/plugins/publish/collect_writes.py | 2 +- .../client/ayon_nuke/plugins/publish/extract_render_local.py | 2 +- .../nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py | 2 +- .../nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py | 2 +- .../ayon_nuke/plugins/publish/validate_output_resolution.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/server_addon/nuke/client/ayon_nuke/api/pipeline.py b/server_addon/nuke/client/ayon_nuke/api/pipeline.py index 0425dd20d4..ad8e17b1f6 100644 --- a/server_addon/nuke/client/ayon_nuke/api/pipeline.py +++ b/server_addon/nuke/client/ayon_nuke/api/pipeline.py @@ -28,7 +28,7 @@ from ayon_core.pipeline import ( ) from ayon_core.pipeline.workfile import BuildWorkfile from ayon_core.tools.utils import host_tools -from ayon_core.hosts.nuke import NUKE_ROOT_DIR +from ayon_nuke import NUKE_ROOT_DIR from ayon_core.tools.workfile_template_build import open_template_ui from .lib import ( diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py index 11f574732a..2268817e76 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_image.py @@ -11,7 +11,7 @@ from ayon_core.lib import ( UISeparatorDef, EnumDef ) -from ayon_core.hosts.nuke import api as napi +from ayon_nuke import api as napi from ayon_nuke.api.plugin import exposed_write_knobs diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py index c18217c4c5..014e91e81c 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_prerender.py @@ -8,7 +8,7 @@ from ayon_core.pipeline import ( from ayon_core.lib import ( BoolDef ) -from ayon_core.hosts.nuke import api as napi +from ayon_nuke import api as napi from ayon_nuke.api.plugin import exposed_write_knobs diff --git a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py index 8ff9b2b15e..bed081c882 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/create/create_write_render.py @@ -8,7 +8,7 @@ from ayon_core.pipeline import ( from ayon_core.lib import ( BoolDef ) -from ayon_core.hosts.nuke import api as napi +from ayon_nuke import api as napi from ayon_nuke.api.plugin import exposed_write_knobs diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py index c90f335d07..816f493d72 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/collect_writes.py @@ -1,7 +1,7 @@ import os import nuke import pyblish.api -from ayon_core.hosts.nuke import api as napi +from ayon_nuke import api as napi from ayon_core.pipeline import publish diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py index 55a2beea81..c865684e7a 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/extract_render_local.py @@ -4,7 +4,7 @@ import shutil import pyblish.api import clique import nuke -from ayon_core.hosts.nuke import api as napi +from ayon_nuke import api as napi from ayon_core.pipeline import publish from ayon_core.lib import collect_frames diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py index 133dc6ec93..f7b94e0c82 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_backdrop.py @@ -1,6 +1,6 @@ import nuke import pyblish -from ayon_core.hosts.nuke import api as napi +from ayon_nuke import api as napi from ayon_core.pipeline.publish import ( ValidateContentsOrder, diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py index 3804efc9ae..55249ae931 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_gizmo.py @@ -1,6 +1,6 @@ import pyblish from ayon_core.pipeline import PublishXmlValidationError -from ayon_core.hosts.nuke import api as napi +from ayon_nuke import api as napi import nuke diff --git a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py index c7a6f7d47c..440cb8b758 100644 --- a/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py +++ b/server_addon/nuke/client/ayon_nuke/plugins/publish/validate_output_resolution.py @@ -1,6 +1,6 @@ import pyblish.api -from ayon_core.hosts.nuke import api as napi +from ayon_nuke import api as napi from ayon_core.pipeline.publish import RepairAction from ayon_core.pipeline import ( PublishXmlValidationError, From 45fc7f02d1e170f38249541d6dba77b519980884 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 27 May 2024 15:38:06 +0200 Subject: [PATCH 268/269] fix support for PySide6 in loader --- client/ayon_core/tools/loader/ui/products_delegates.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/tools/loader/ui/products_delegates.py b/client/ayon_core/tools/loader/ui/products_delegates.py index 6bcb78ec66..51424034aa 100644 --- a/client/ayon_core/tools/loader/ui/products_delegates.py +++ b/client/ayon_core/tools/loader/ui/products_delegates.py @@ -107,7 +107,10 @@ class VersionDelegate(QtWidgets.QStyledItemDelegate): style = QtWidgets.QApplication.style() style.drawControl( - style.CE_ItemViewItem, option, painter, option.widget + QtWidgets.QCommonStyle.CE_ItemViewItem, + option, + painter, + option.widget ) painter.save() @@ -207,7 +210,10 @@ class StatusDelegate(QtWidgets.QStyledItemDelegate): style = QtWidgets.QApplication.style() style.drawControl( - style.CE_ItemViewItem, option, painter, option.widget + QtWidgets.QCommonStyle.CE_ItemViewItem, + option, + painter, + option.widget ) painter.save() From afe0887d96e686937d3e1dca4acdaf7163eb11bf Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 27 May 2024 15:45:53 +0200 Subject: [PATCH 269/269] fix more constants --- .../tools/loader/ui/products_delegates.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/tools/loader/ui/products_delegates.py b/client/ayon_core/tools/loader/ui/products_delegates.py index 51424034aa..1ac19b53eb 100644 --- a/client/ayon_core/tools/loader/ui/products_delegates.py +++ b/client/ayon_core/tools/loader/ui/products_delegates.py @@ -122,9 +122,14 @@ class VersionDelegate(QtWidgets.QStyledItemDelegate): pen.setColor(fg_color) painter.setPen(pen) - text_rect = style.subElementRect(style.SE_ItemViewItemText, option) + text_rect = style.subElementRect( + QtWidgets.QCommonStyle.SE_ItemViewItemText, + option + ) text_margin = style.proxy().pixelMetric( - style.PM_FocusFrameHMargin, option, option.widget + QtWidgets.QCommonStyle.PM_FocusFrameHMargin, + option, + option.widget ) + 1 painter.drawText( @@ -218,9 +223,14 @@ class StatusDelegate(QtWidgets.QStyledItemDelegate): painter.save() - text_rect = style.subElementRect(style.SE_ItemViewItemText, option) + text_rect = style.subElementRect( + QtWidgets.QCommonStyle.SE_ItemViewItemText, + option + ) text_margin = style.proxy().pixelMetric( - style.PM_FocusFrameHMargin, option, option.widget + QtWidgets.QCommonStyle.PM_FocusFrameHMargin, + option, + option.widget ) + 1 padded_text_rect = text_rect.adjusted( text_margin, 0, - text_margin, 0