From b86201546fbd498c966ccda59d659b9f61ca8da6 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 4 Mar 2022 18:16:19 +0900 Subject: [PATCH 01/91] create dummy creator plugin for multiverse usd --- .../hosts/maya/plugins/create/create_multiverse_usd.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 openpype/hosts/maya/plugins/create/create_multiverse_usd.py diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py new file mode 100644 index 0000000000..2dc57823f1 --- /dev/null +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py @@ -0,0 +1,10 @@ +from openpype.hosts.maya.api import plugin + + +class CreateMultiverseUsd(plugin.Creator): + """Multiverse USD data""" + + name = "usd" + label = "Multiverse USD" + family = "usd" + icon = "cubes" From 2cb1925790555c7bea45e343ebce7ac25cd7d664 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 4 Mar 2022 18:16:48 +0900 Subject: [PATCH 02/91] create first version of multiverse usd extractor --- .../plugins/publish/extract_multiverse_usd.py | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py new file mode 100644 index 0000000000..72b1dcbbe5 --- /dev/null +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -0,0 +1,54 @@ +import os + +import avalon.maya +import openpype.api + +from maya import cmds + + +class ExtractMultiverseUsd(openpype.api.Extractor): + """Extractor for USD by Multiverse.""" + + label = "Extract Multiverse USD" + hosts = ["maya"] + families = ["usd"] + + def process(self, instance): + # Load plugin firstly + cmds.loadPlugin("MultiverseForMaya", quiet=True) + + # Define output file path + staging_dir = self.staging_dir(instance) + file_name = "{}.usd".format(instance.name) + file_path = os.path.join(staging_dir, file_name) + file_path = file_path.replace('\\', '/') + + # Perform extraction + self.log.info("Performing extraction ...") + + with avalon.maya.maintained_selection(): + members = instance.data("setMembers") + members = cmds.ls(members, + dag=True, + shapes=True, + type=("mesh"), + noIntermediate=True, + long=True) + + # TODO: Deal with asset, composition, overide with options. + import multiverse + options = multiverse.AssetWriteOptions() + multiverse.WriteAsset(file_path, members, options) + + if "representations" not in instance.data: + instance.data["representations"] = [] + + representation = { + 'name': 'usd', + 'ext': 'usd', + 'files': file_name, + "stagingDir": staging_dir + } + instance.data["representations"].append(representation) + + self.log.info("Extracted {} to {}".format(instance, file_path)) From d155f6024903070ebbcfd942e89dff49541a59e7 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 8 Mar 2022 12:11:40 +0900 Subject: [PATCH 03/91] fill attributes to creator CreateMultiverseUsd --- .../plugins/create/create_multiverse_usd.py | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py index 2dc57823f1..fcc6ce231d 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py @@ -1,4 +1,4 @@ -from openpype.hosts.maya.api import plugin +from openpype.hosts.maya.api import plugin, lib class CreateMultiverseUsd(plugin.Creator): @@ -8,3 +8,49 @@ class CreateMultiverseUsd(plugin.Creator): label = "Multiverse USD" family = "usd" icon = "cubes" + + def __init__(self, *args, **kwargs): + super(CreateMultiverseUsd, self).__init__(*args, **kwargs) + + self.data["stripNamespaces"] = False + self.data["mergeTransformAndShape"] = False + self.data["writeAncestors"] = True + self.data["flattenParentXforms"] = False + self.data["writeSparseOverrides"] = False + self.data["useMetaPrimPath"] = False + self.data["customRootPath"] = '' + self.data["customAttributes"] = '' + self.data["nodeTypesToIgnore"] = '' + self.data["writeMeshes"] = True + self.data["writeCurves"] = True + self.data["writeParticles"] = True + self.data["writeCameras"] = False + self.data["writeLights"] = False + self.data["writeJoints"] = False + self.data["writeCollections"] = False + self.data["writePositions"] = True + self.data["writeNormals"] = True + self.data["writeUVs"] = True + self.data["writeColorSets"] = False + self.data["writeTangents"] = False + self.data["writeRefPositions"] = False + self.data["writeBlendShapes"] = False + self.data["writeDisplayColor"] = False + self.data["writeSkinWeights"] = False + self.data["writeMaterialAssignment"] = False + self.data["writeHardwareShader"] = False + self.data["writeShadingNetworks"] = False + self.data["writeTransformMatrix"] = True + self.data["writeUsdAttributes"] = False + self.data["timeVaryingTopology"] = False + self.data["customMaterialNamespace"] = '' + + animation_data = lib.collect_animation_data() + + self.data["writeTimeRange"] = False + self.data["timeRangeStart"] = animation_data["frameStart"] + self.data["timeRangeEnd"] = animation_data["frameEnd"] + self.data["timeRangeIncrement"] = animation_data["step"] + self.data["timeRangeNumTimeSamples"] = 0 + self.data["timeRangeSamplesSpan"] = 0.0 + self.data["timeRangeFramesPerSecond"] = 24.0 From 1c58a3d1dfbbd2122a83607aebb574ba328f717d Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 8 Mar 2022 13:00:00 +0900 Subject: [PATCH 04/91] created load plugin to read USD file by multiverse --- .../maya/plugins/load/load_multiverse_usd.py | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 openpype/hosts/maya/plugins/load/load_multiverse_usd.py diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py new file mode 100644 index 0000000000..b46dbdc56b --- /dev/null +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -0,0 +1,45 @@ +from avalon import api + +class MultiverseUsdLoader(api.Loader): + """Load the USD by Multiverse""" + + families = ["usd"] + representations = ["usd", "usda", "usdc", "usdz", "abc"] + + label = "Read USD by Multiverse" + order = -10 + icon = "code-fork" + color = "orange" + + def load(self, context, name=None, namespace=None, options=None): + + import maya.cmds as cmds + from openpype.hosts.maya.api.pipeline import containerise + from openpype.hosts.maya.api.lib import unique_namespace + + asset = context['asset']['name'] + namespace = namespace or unique_namespace( + asset + "_", + prefix="_" if asset[0].isdigit() else "", + suffix="_", + ) + + cmds.loadPlugin("MultiverseForMaya", quiet=True) + + # Root group + label = "{}:{}".format(namespace, name) + root = cmds.group(name=label, empty=True) + + # Create shape and move it under root + import multiverse + shape = multiverse.CreateUsdCompound(self.fname) + cmds.parent(shape, root) + + def update(self, container, representation): + pass + + def switch(self, container, representation): + self.update(container, representation) + + def remove(self, container): + pass From 9f83eec3244ce83a43a5c2240f2f989427d7a2c3 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Wed, 9 Mar 2022 10:21:26 +0900 Subject: [PATCH 05/91] imroved data for creator of multiverse usd on animated parameters --- .../maya/plugins/create/create_multiverse_usd.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py index fcc6ce231d..b7f892deb4 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py @@ -45,12 +45,14 @@ class CreateMultiverseUsd(plugin.Creator): self.data["timeVaryingTopology"] = False self.data["customMaterialNamespace"] = '' - animation_data = lib.collect_animation_data() - + # The attributes below are about animated cache. self.data["writeTimeRange"] = False + self.data["timeRangeNumTimeSamples"] = 0 + self.data["timeRangeSamplesSpan"] = 0.0 + + animation_data = lib.collect_animation_data(True) + self.data["timeRangeStart"] = animation_data["frameStart"] self.data["timeRangeEnd"] = animation_data["frameEnd"] self.data["timeRangeIncrement"] = animation_data["step"] - self.data["timeRangeNumTimeSamples"] = 0 - self.data["timeRangeSamplesSpan"] = 0.0 - self.data["timeRangeFramesPerSecond"] = 24.0 + self.data["timeRangeFramesPerSecond"] = animation_data["fps"] From 2adbe78122c10b159341b78d2e542b4f455658d5 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Wed, 9 Mar 2022 10:27:51 +0900 Subject: [PATCH 06/91] implemented load method of multiverse usd loader --- .../maya/plugins/load/load_multiverse_usd.py | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index b46dbdc56b..4e9952b1a1 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -1,5 +1,9 @@ +# -*- coding: utf-8 -*- from avalon import api +import maya.cmds as cmds + + class MultiverseUsdLoader(api.Loader): """Load the USD by Multiverse""" @@ -10,10 +14,9 @@ class MultiverseUsdLoader(api.Loader): order = -10 icon = "code-fork" color = "orange" - + def load(self, context, name=None, namespace=None, options=None): - import maya.cmds as cmds from openpype.hosts.maya.api.pipeline import containerise from openpype.hosts.maya.api.lib import unique_namespace @@ -36,10 +39,25 @@ class MultiverseUsdLoader(api.Loader): cmds.parent(shape, root) def update(self, container, representation): - pass + + path = api.get_representation_path(representation) + + # Update the shape + members = cmds.sets(container['objectName'], query=True) + shapes = cmds.ls(members, type="mvUsdPackedShape", long=True) + + assert len(shapes) == 1, "This is a bug" + + import multiverse + for shape in shapes: + multiverse.SetUsdCompoundAssetPaths(shape, [path]) + + cmds.setAttr(container["objectName"] + ".representation", + str(representation["_id"]), + type="string") def switch(self, container, representation): self.update(container, representation) def remove(self, container): - pass + pass From d6a0d2cd2e4a9ff2ec915eb8c25a9d38ee34286d Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Wed, 9 Mar 2022 10:34:25 +0900 Subject: [PATCH 07/91] use time options for multiverse usd extractor --- .../plugins/publish/extract_multiverse_usd.py | 137 +++++++++++++++++- 1 file changed, 134 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 72b1dcbbe5..a45ebf2f9b 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -13,6 +13,110 @@ class ExtractMultiverseUsd(openpype.api.Extractor): hosts = ["maya"] families = ["usd"] + @property + def options(self): + """Overridable options for Multiverse USD Export + + Given in the following format + - {NAME: EXPECTED TYPE} + + If the overridden option's type does not match, + the option is not included and a warning is logged. + + """ + + return { + "stripNamespaces": bool, + "mergeTransformAndShape": bool, + "writeAncestors": bool, + "flattenParentXforms": bool, + "writeSparseOverrides": bool, + "useMetaPrimPath": bool, + "customRootPath": str, + "customAttributes": str, + "nodeTypesToIgnore": str, + "writeMeshes": bool, + "writeCurves": bool, + "writeParticles": bool, + "writeCameras": bool, + "writeLights": bool, + "writeJoints": bool, + "writeCollections": bool, + "writePositions": bool, + "writeNormals": bool, + "writeUVs": bool, + "writeColorSets": bool, + "writeTangents": bool, + "writeRefPositions": bool, + "writeBlendShapes": bool, + "writeDisplayColor": bool, + "writeSkinWeights": bool, + "writeMaterialAssignment": bool, + "writeHardwareShader": bool, + "writeShadingNetworks": bool, + "writeTransformMatrix": bool, + "writeUsdAttributes": bool, + "timeVaryingTopology": bool, + "customMaterialNamespace": str, + "writeTimeRange": bool, + "timeRangeStart": int, + "timeRangeEnd": int, + "timeRangeIncrement": int, + "timeRangeNumTimeSamples": int, + "timeRangeSamplesSpan": float, + "timeRangeFramesPerSecond": float + } + + @property + def default_options(self): + """The default options for Multiverse USD extraction.""" + start_frame = int(cmds.playbackOptions(query=True, + animationStartTime=True)) + end_frame = int(cmds.playbackOptions(query=True, + animationEndTime=True)) + + return { + "stripNamespaces": False, + "mergeTransformAndShape": False, + "writeAncestors": True, + "flattenParentXforms": False, + "writeSparseOverrides": False, + "useMetaPrimPath": False, + "customRootPath": '', + "customAttributes": '', + "nodeTypesToIgnore": '', + "writeMeshes": True, + "writeCurves": True, + "writeParticles": True, + "writeCameras": False, + "writeLights": False, + "writeJoints": False, + "writeCollections": False, + "writePositions": True, + "writeNormals": True, + "writeUVs": True, + "writeColorSets": False, + "writeTangents": False, + "writeRefPositions": False, + "writeBlendShapes": False, + "writeDisplayColor": False, + "writeSkinWeights": False, + "writeMaterialAssignment": False, + "writeHardwareShader": False, + "writeShadingNetworks": False, + "writeTransformMatrix": True, + "writeUsdAttributes": False, + "timeVaryingTopology": False, + "customMaterialNamespace": '', + "writeTimeRange": False, + "timeRangeStart": 1, + "timeRangeEnd": 1, + "timeRangeIncrement": 1, + "timeRangeNumTimeSamples": 0, + "timeRangeSamplesSpan": 0.0, + "timeRangeFramesPerSecond": 24.0 + } + def process(self, instance): # Load plugin firstly cmds.loadPlugin("MultiverseForMaya", quiet=True) @@ -23,6 +127,10 @@ class ExtractMultiverseUsd(openpype.api.Extractor): file_path = os.path.join(staging_dir, file_name) file_path = file_path.replace('\\', '/') + # Parse export options + options = self.default_options + self.log.info("Export options: {0}".format(options)) + # Perform extraction self.log.info("Performing extraction ...") @@ -34,11 +142,33 @@ class ExtractMultiverseUsd(openpype.api.Extractor): type=("mesh"), noIntermediate=True, long=True) + self.log.info('Collected object {}'.format(members)) # TODO: Deal with asset, composition, overide with options. import multiverse - options = multiverse.AssetWriteOptions() - multiverse.WriteAsset(file_path, members, options) + + time_opts = None + if options["writeTimeRange"]: + time_opts = multiverse.TimeOptions() + + time_opts.writeTimeRange = True + + time_range_start = options["timeRangeStart"] + time_range_end = options["timeRangeEnd"] + time_opts.frameRange = (time_range_start, time_range_end) + + time_opts.frameIncrement = options["timeRangeIncrement"] + time_opts.numTimeSamples = options["timeRangeNumTimeSamples"] + time_opts.timeSamplesSpan = options["timeRangeSamplesSpan"] + time_opts.framePerSecond = options["timeRangeFramesPerSecond"] + + asset_write_opts = multiverse.AssetWriteOptions(time_opts) + for (k, v) in options.iteritems(): + if k == "writeTimeRange" or k.startswith("timeRange"): + continue + setattr(asset_write_opts, k, v) + + multiverse.WriteAsset(file_path, members, asset_write_opts) if "representations" not in instance.data: instance.data["representations"] = [] @@ -51,4 +181,5 @@ class ExtractMultiverseUsd(openpype.api.Extractor): } instance.data["representations"].append(representation) - self.log.info("Extracted {} to {}".format(instance, file_path)) + self.log.info("Extracted instance {} to {}".format( + instance.name, file_path)) From 9418a496c8cb96b18644bc9da08904cf4602b053 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 10 Mar 2022 16:32:38 +0900 Subject: [PATCH 08/91] improved multiverse usd loader --- .../maya/plugins/load/load_multiverse_usd.py | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index 4e9952b1a1..d5006cccb7 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -30,13 +30,24 @@ class MultiverseUsdLoader(api.Loader): cmds.loadPlugin("MultiverseForMaya", quiet=True) # Root group - label = "{}:{}".format(namespace, name) - root = cmds.group(name=label, empty=True) + rootName = "{}:{}".format(namespace, name) + root = cmds.group(name=rootName, empty=True) - # Create shape and move it under root + # Create shape with transform and move it under root import multiverse - shape = multiverse.CreateUsdCompound(self.fname) - cmds.parent(shape, root) + transform = multiverse.CreateUsdCompound(self.fname) + cmds.parent(transform, root) + + # Rename transform + nodes = [root, transform] + self[:] = nodes + + return containerise( + name=name, + namespace=namespace, + nodes=nodes, + context=context, + loader=self.__class__.__name__) def update(self, container, representation): @@ -44,7 +55,7 @@ class MultiverseUsdLoader(api.Loader): # Update the shape members = cmds.sets(container['objectName'], query=True) - shapes = cmds.ls(members, type="mvUsdPackedShape", long=True) + shapes = cmds.ls(members, type="mvUsdCompoundShape", long=True) assert len(shapes) == 1, "This is a bug" From 310c572e65e5505996efc0fd8d1aa7307a385267 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 11 Mar 2022 11:40:32 +0900 Subject: [PATCH 09/91] added creator for multiverse usd override --- .../create/create_multiverse_usd_over.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py new file mode 100644 index 0000000000..522487e99b --- /dev/null +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py @@ -0,0 +1,35 @@ +from openpype.hosts.maya.api import plugin, lib + + +class CreateMultiverseUsdOver(plugin.Creator): + """Multiverse USD data""" + + name = "usd" + label = "Multiverse USD" + family = "usd" + icon = "cubes" + + def __init__(self, *args, **kwargs): + super(CreateMultiverseUsdOver, self).__init__(*args, **kwargs) + + self.data["writeAll"] = False + self.data["writeTransforms"] = True + self.data["writeVisibility"] = True + self.data["writeAttributes"] = True + self.data["writeMaterials"] = True + self.data["writeVariants"] = True + self.data["writeVariantsDefinition"] = True + self.data["writeActiveState"] = True + self.data["writeNamespaces"] = False + + # The attributes below are about animated cache. + self.data["writeTimeRange"] = True + self.data["timeRangeNumTimeSamples"] = 0 + self.data["timeRangeSamplesSpan"] = 0.0 + + animation_data = lib.collect_animation_data(True) + + self.data["timeRangeStart"] = animation_data["frameStart"] + self.data["timeRangeEnd"] = animation_data["frameEnd"] + self.data["timeRangeIncrement"] = animation_data["step"] + self.data["timeRangeFramesPerSecond"] = animation_data["fps"] From 8ab9a146525219ff6b73483c2ead4e418b2f2933 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 11 Mar 2022 12:15:42 +0900 Subject: [PATCH 10/91] Changed name, label family of multiverse usd override creator --- .../hosts/maya/plugins/create/create_multiverse_usd_over.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py index 522487e99b..3bb563d20c 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py @@ -4,9 +4,9 @@ from openpype.hosts.maya.api import plugin, lib class CreateMultiverseUsdOver(plugin.Creator): """Multiverse USD data""" - name = "usd" - label = "Multiverse USD" - family = "usd" + name = "usdOverrideMain" + label = "Multiverse USD Override" + family = "usd_override" icon = "cubes" def __init__(self, *args, **kwargs): From ab4849ab968203e00db2cc4503f92a9faf83be82 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 11 Mar 2022 12:16:48 +0900 Subject: [PATCH 11/91] Changed name and writeTimeRange of multiverse usd creator --- openpype/hosts/maya/plugins/create/create_multiverse_usd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py index b7f892deb4..6851e0f6bc 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py @@ -4,7 +4,7 @@ from openpype.hosts.maya.api import plugin, lib class CreateMultiverseUsd(plugin.Creator): """Multiverse USD data""" - name = "usd" + name = "usdMain" label = "Multiverse USD" family = "usd" icon = "cubes" @@ -46,7 +46,7 @@ class CreateMultiverseUsd(plugin.Creator): self.data["customMaterialNamespace"] = '' # The attributes below are about animated cache. - self.data["writeTimeRange"] = False + self.data["writeTimeRange"] = True self.data["timeRangeNumTimeSamples"] = 0 self.data["timeRangeSamplesSpan"] = 0.0 From 3151784b1826392228776901abd0f93f8a94da79 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 11 Mar 2022 12:18:14 +0900 Subject: [PATCH 12/91] Updated multiverse usd extracor for default option values --- .../hosts/maya/plugins/publish/extract_multiverse_usd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index a45ebf2f9b..565fbd1ee3 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -108,9 +108,9 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeUsdAttributes": False, "timeVaryingTopology": False, "customMaterialNamespace": '', - "writeTimeRange": False, - "timeRangeStart": 1, - "timeRangeEnd": 1, + "writeTimeRange": True, + "timeRangeStart": start_frame, + "timeRangeEnd": end_frame, "timeRangeIncrement": 1, "timeRangeNumTimeSamples": 0, "timeRangeSamplesSpan": 0.0, From b36e3127dc50314cf7adc72749ebab2bbbc40451 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 11 Mar 2022 12:20:10 +0900 Subject: [PATCH 13/91] add multiverse usd override extractor plugin --- .../publish/extract_multiverse_usd_over.py | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py new file mode 100644 index 0000000000..f1b9ca88f0 --- /dev/null +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -0,0 +1,141 @@ +import os + +import avalon.maya +import openpype.api + +from maya import cmds + + +class ExtractMultiverseUsdOverride(openpype.api.Extractor): + """Extractor for USD Override by Multiverse.""" + + label = "Extract Multiverse USD Override" + hosts = ["maya"] + families = ["usd_override"] + + @property + def options(self): + """Overridable options for Multiverse USD Export + + Given in the following format + - {NAME: EXPECTED TYPE} + + If the overridden option's type does not match, + the option is not included and a warning is logged. + + """ + + return { + "writeAll": bool, + "writeTransforms": bool, + "writeVisibility": bool, + "writeAttributes": bool, + "writeMaterials": bool, + "writeVariants": bool, + "writeVariantsDefinition": bool, + "writeActiveState": bool, + "writeNamespaces": bool, + "writeTimeRange": bool, + "timeRangeStart": int, + "timeRangeEnd": int, + "timeRangeIncrement": int, + "timeRangeNumTimeSamples": int, + "timeRangeSamplesSpan": float, + "timeRangeFramesPerSecond": float + } + + @property + def default_options(self): + """The default options for Multiverse USD extraction.""" + start_frame = int(cmds.playbackOptions(query=True, + animationStartTime=True)) + end_frame = int(cmds.playbackOptions(query=True, + animationEndTime=True)) + + return { + "writeAll": False, + "writeTransforms": True, + "writeVisibility": True, + "writeAttributes": True, + "writeMaterials": True, + "writeVariants": True, + "writeVariantsDefinition": True, + "writeActiveState": True, + "writeNamespaces": False, + "writeTimeRange": True, + "timeRangeStart": start_frame, + "timeRangeEnd": end_frame, + "timeRangeIncrement": 1, + "timeRangeNumTimeSamples": 0, + "timeRangeSamplesSpan": 0.0, + "timeRangeFramesPerSecond": 24.0 + } + + def process(self, instance): + # Load plugin firstly + cmds.loadPlugin("MultiverseForMaya", quiet=True) + + # Define output file path + staging_dir = self.staging_dir(instance) + file_name = "{}.usda".format(instance.name) + file_path = os.path.join(staging_dir, file_name) + file_path = file_path.replace('\\', '/') + + # Parse export options + options = self.default_options + self.log.info("Export options: {0}".format(options)) + + # Perform extraction + self.log.info("Performing extraction ...") + + with avalon.maya.maintained_selection(): + members = instance.data("setMembers") + members = cmds.ls(members, + dag=True, + shapes=True, + type=("mvUsdCompoundShape"), + noIntermediate=True, + long=True) + self.log.info('Collected object {}'.format(members)) + + # TODO: Deal with asset, composition, overide with options. + import multiverse + + time_opts = None + if options["writeTimeRange"]: + time_opts = multiverse.TimeOptions() + + time_opts.writeTimeRange = True + + time_range_start = options["timeRangeStart"] + time_range_end = options["timeRangeEnd"] + time_opts.frameRange = (time_range_start, time_range_end) + + time_opts.frameIncrement = options["timeRangeIncrement"] + time_opts.numTimeSamples = options["timeRangeNumTimeSamples"] + time_opts.timeSamplesSpan = options["timeRangeSamplesSpan"] + time_opts.framePerSecond = options["timeRangeFramesPerSecond"] + + over_write_opts = multiverse.OverridesWriteOptions() + for (k, v) in options.iteritems(): + if k == "writeTimeRange" or k.startswith("timeRange"): + continue + setattr(over_write_opts, k, v) + over_write_opts.timeOptions = time_opts + + for member in members: + multiverse.WriteOverrides(file_path, member, over_write_opts) + + if "representations" not in instance.data: + instance.data["representations"] = [] + + representation = { + 'name': 'usda', + 'ext': 'usda', + 'files': file_name, + "stagingDir": staging_dir + } + instance.data["representations"].append(representation) + + self.log.info("Extracted instance {} to {}".format( + instance.name, file_path)) From bf5f5365b1dc90f51cdf5200420d3a0e6954317d Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 11 Mar 2022 12:22:07 +0900 Subject: [PATCH 14/91] added new family usd_override --- openpype/plugins/publish/integrate_new.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/plugins/publish/integrate_new.py b/openpype/plugins/publish/integrate_new.py index e8dab089af..fc98327f2d 100644 --- a/openpype/plugins/publish/integrate_new.py +++ b/openpype/plugins/publish/integrate_new.py @@ -103,7 +103,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): "effect", "xgen", "hda", - "usd" + "usd", + "usd_override" ] exclude_families = ["clip"] db_representation_context_keys = [ From 28f57a045b714d01113d3efc5317a5c02df63369 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Mon, 14 Mar 2022 12:13:51 +0900 Subject: [PATCH 15/91] added new creator for multiverse usd composition --- .../create/create_multiverse_usd_comp.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py new file mode 100644 index 0000000000..397f31d577 --- /dev/null +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py @@ -0,0 +1,30 @@ +from openpype.hosts.maya.api import plugin, lib + + +class CreateMultiverseUsdComp(plugin.Creator): + """Create Multiverse USD Composition""" + + name = "usdOverrideMain" + label = "Multiverse USD Override" + family = "usd_override" + icon = "cubes" + + def __init__(self, *args, **kwargs): + super(CreateMultiverseUsdComp, self).__init__(*args, **kwargs) + + self.data["stripNamespaces"] = False + self.data["mergeTransformAndShape"] = False + self.data["flattenContent"] = False + self.data["writePendingOverrides"] = False + + # The attributes below are about animated cache. + self.data["writeTimeRange"] = True + self.data["timeRangeNumTimeSamples"] = 0 + self.data["timeRangeSamplesSpan"] = 0.0 + + animation_data = lib.collect_animation_data(True) + + self.data["timeRangeStart"] = animation_data["frameStart"] + self.data["timeRangeEnd"] = animation_data["frameEnd"] + self.data["timeRangeIncrement"] = animation_data["step"] + self.data["timeRangeFramesPerSecond"] = animation_data["fps"] From 9f54faed1c989ac6fa1b1cb904daa0f37fd24e43 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Mon, 14 Mar 2022 12:37:09 +0900 Subject: [PATCH 16/91] fixed label and family for multiverse usd composition creator --- .../hosts/maya/plugins/create/create_multiverse_usd_comp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py index 397f31d577..2f57ccec6c 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py @@ -5,8 +5,8 @@ class CreateMultiverseUsdComp(plugin.Creator): """Create Multiverse USD Composition""" name = "usdOverrideMain" - label = "Multiverse USD Override" - family = "usd_override" + label = "Multiverse USD Composition" + family = "usdComposition" icon = "cubes" def __init__(self, *args, **kwargs): From 86d51270e22650effeff64e16f6943b67c622b6f Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Mon, 14 Mar 2022 14:04:58 +0900 Subject: [PATCH 17/91] declare more families for multiverse usd loader --- openpype/hosts/maya/plugins/load/load_multiverse_usd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index d5006cccb7..7214e1cbb6 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -7,7 +7,7 @@ import maya.cmds as cmds class MultiverseUsdLoader(api.Loader): """Load the USD by Multiverse""" - families = ["usd"] + families = ["model", "usd", "usdComposition", "usd_override"] representations = ["usd", "usda", "usdc", "usdz", "abc"] label = "Read USD by Multiverse" From 82929bba785bd1966038002ae63a69bde566f378 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Mon, 14 Mar 2022 14:06:26 +0900 Subject: [PATCH 18/91] renamed family usd_override to usdOverride --- .../hosts/maya/plugins/create/create_multiverse_usd_over.py | 2 +- openpype/hosts/maya/plugins/load/load_multiverse_usd.py | 2 +- .../hosts/maya/plugins/publish/extract_multiverse_usd_over.py | 2 +- openpype/plugins/publish/integrate_new.py | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py index 3bb563d20c..bdec96c2ff 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py @@ -6,7 +6,7 @@ class CreateMultiverseUsdOver(plugin.Creator): name = "usdOverrideMain" label = "Multiverse USD Override" - family = "usd_override" + family = "usdOverride" icon = "cubes" def __init__(self, *args, **kwargs): diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index 7214e1cbb6..3370033141 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -7,7 +7,7 @@ import maya.cmds as cmds class MultiverseUsdLoader(api.Loader): """Load the USD by Multiverse""" - families = ["model", "usd", "usdComposition", "usd_override"] + families = ["model", "usd", "usdComposition", "usdOverride"] representations = ["usd", "usda", "usdc", "usdz", "abc"] label = "Read USD by Multiverse" diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index f1b9ca88f0..e0e65d83d1 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -11,7 +11,7 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): label = "Extract Multiverse USD Override" hosts = ["maya"] - families = ["usd_override"] + families = ["usdOverride"] @property def options(self): diff --git a/openpype/plugins/publish/integrate_new.py b/openpype/plugins/publish/integrate_new.py index fc98327f2d..4118583787 100644 --- a/openpype/plugins/publish/integrate_new.py +++ b/openpype/plugins/publish/integrate_new.py @@ -104,7 +104,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): "xgen", "hda", "usd", - "usd_override" + "usdComposition", + "usdOverride" ] exclude_families = ["clip"] db_representation_context_keys = [ From 99288ee03aa06613734c7feac627281bb94cb938 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 17 Mar 2022 17:29:54 +0900 Subject: [PATCH 19/91] added multiverse usd composition extractor --- .../publish/extract_multiverse_usd_comp.py | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py new file mode 100644 index 0000000000..f35096e516 --- /dev/null +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -0,0 +1,129 @@ +import os + +import avalon.maya +import openpype.api + +from maya import cmds + + +class ExtractMultiverseUsdComposition(openpype.api.Extractor): + """Extractor of Multiverse USD Composition.""" + + label = "Extract Multiverse USD Composition" + hosts = ["maya"] + families = ["usdComposition"] + + @property + def options(self): + """Overridable options for Multiverse USD Export + + Given in the following format + - {NAME: EXPECTED TYPE} + + If the overridden option's type does not match, + the option is not included and a warning is logged. + + """ + + return { + "stripNamespaces": bool, + "mergeTransformAndShape": bool, + "flattenContent": bool, + "writePendingOverrides": bool, + "writeTimeRange": bool, + "timeRangeStart": int, + "timeRangeEnd": int, + "timeRangeIncrement": int, + "timeRangeNumTimeSamples": int, + "timeRangeSamplesSpan": float, + "timeRangeFramesPerSecond": float + } + + @property + def default_options(self): + """The default options for Multiverse USD extraction.""" + start_frame = int(cmds.playbackOptions(query=True, + animationStartTime=True)) + end_frame = int(cmds.playbackOptions(query=True, + animationEndTime=True)) + + return { + "stripNamespaces": False, + "mergeTransformAndShape": False, + "flattenContent": False, + "writePendingOverrides": False, + "writeTimeRange": True, + "timeRangeStart": start_frame, + "timeRangeEnd": end_frame, + "timeRangeIncrement": 1, + "timeRangeNumTimeSamples": 0, + "timeRangeSamplesSpan": 0.0, + "timeRangeFramesPerSecond": 24.0 + } + + def process(self, instance): + # Load plugin firstly + cmds.loadPlugin("MultiverseForMaya", quiet=True) + + # Define output file path + staging_dir = self.staging_dir(instance) + file_name = "{}.usda".format(instance.name) + file_path = os.path.join(staging_dir, file_name) + file_path = file_path.replace('\\', '/') + + # Parse export options + options = self.default_options + self.log.info("Export options: {0}".format(options)) + + # Perform extraction + self.log.info("Performing extraction ...") + + with avalon.maya.maintained_selection(): + members = instance.data("setMembers") + members = cmds.ls(members, + dag=True, + shapes=True, + type=("mvUsdCompoundShape"), + noIntermediate=True, + long=True) + self.log.info('Collected object {}'.format(members)) + + # TODO: Deal with asset, composition, overide with options. + import multiverse + + time_opts = None + if options["writeTimeRange"]: + time_opts = multiverse.TimeOptions() + + time_opts.writeTimeRange = True + + time_range_start = options["timeRangeStart"] + time_range_end = options["timeRangeEnd"] + time_opts.frameRange = (time_range_start, time_range_end) + + time_opts.frameIncrement = options["timeRangeIncrement"] + time_opts.numTimeSamples = options["timeRangeNumTimeSamples"] + time_opts.timeSamplesSpan = options["timeRangeSamplesSpan"] + time_opts.framePerSecond = options["timeRangeFramesPerSecond"] + + comp_write_opts = multiverse.CompositionWriteOptions() + for (k, v) in options.iteritems(): + if k == "writeTimeRange" or k.startswith("timeRange"): + continue + setattr(comp_write_opts, k, v) + comp_write_opts.timeOptions = time_opts + multiverse.WriteComposition(file_path, members, comp_write_opts) + + if "representations" not in instance.data: + instance.data["representations"] = [] + + representation = { + 'name': 'usda', + 'ext': 'usda', + 'files': file_name, + "stagingDir": staging_dir + } + instance.data["representations"].append(representation) + + self.log.info("Extracted instance {} to {}".format( + instance.name, file_path)) From f8c06e0e1fb0d91b09a76c4611cfdf4d1ac546d8 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 18 Mar 2022 11:15:19 +0900 Subject: [PATCH 20/91] fix iteration for options among multiverse extractor --- openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py | 3 ++- .../hosts/maya/plugins/publish/extract_multiverse_usd_comp.py | 3 ++- .../hosts/maya/plugins/publish/extract_multiverse_usd_over.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 565fbd1ee3..96e0e79c29 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -163,7 +163,8 @@ class ExtractMultiverseUsd(openpype.api.Extractor): time_opts.framePerSecond = options["timeRangeFramesPerSecond"] asset_write_opts = multiverse.AssetWriteOptions(time_opts) - for (k, v) in options.iteritems(): + options_items = getattr(options, "iteritems", options.items) + for (k, v) in options_items: if k == "writeTimeRange" or k.startswith("timeRange"): continue setattr(asset_write_opts, k, v) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py index f35096e516..ef54e9ceff 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -107,7 +107,8 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): time_opts.framePerSecond = options["timeRangeFramesPerSecond"] comp_write_opts = multiverse.CompositionWriteOptions() - for (k, v) in options.iteritems(): + options_items = getattr(options, "iteritems", options.items) + for (k, v) in options_items: if k == "writeTimeRange" or k.startswith("timeRange"): continue setattr(comp_write_opts, k, v) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index e0e65d83d1..df76614f5a 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -117,7 +117,8 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): time_opts.framePerSecond = options["timeRangeFramesPerSecond"] over_write_opts = multiverse.OverridesWriteOptions() - for (k, v) in options.iteritems(): + options_items = getattr(options, "iteritems", options.items) + for (k, v) in options_items: if k == "writeTimeRange" or k.startswith("timeRange"): continue setattr(over_write_opts, k, v) From ca5017f730f71de4a4034b06cd3ce5835724e4fa Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Fri, 18 Mar 2022 12:23:42 +0900 Subject: [PATCH 21/91] fix iteration loop --- openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py | 2 +- .../hosts/maya/plugins/publish/extract_multiverse_usd_comp.py | 2 +- .../hosts/maya/plugins/publish/extract_multiverse_usd_over.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 96e0e79c29..7c13252957 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -164,7 +164,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): asset_write_opts = multiverse.AssetWriteOptions(time_opts) options_items = getattr(options, "iteritems", options.items) - for (k, v) in options_items: + for (k, v) in options_items(): if k == "writeTimeRange" or k.startswith("timeRange"): continue setattr(asset_write_opts, k, v) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py index ef54e9ceff..449a99e1be 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -108,7 +108,7 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): comp_write_opts = multiverse.CompositionWriteOptions() options_items = getattr(options, "iteritems", options.items) - for (k, v) in options_items: + for (k, v) in options_items(): if k == "writeTimeRange" or k.startswith("timeRange"): continue setattr(comp_write_opts, k, v) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index df76614f5a..406ff8ba11 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -118,7 +118,7 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): over_write_opts = multiverse.OverridesWriteOptions() options_items = getattr(options, "iteritems", options.items) - for (k, v) in options_items: + for (k, v) in options_items(): if k == "writeTimeRange" or k.startswith("timeRange"): continue setattr(over_write_opts, k, v) From 20e2bae01c06d009048c3386ce5145d6194c09a4 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 18 Mar 2022 17:39:56 +0100 Subject: [PATCH 22/91] flame: wirtetap accepts also path like color policy --- openpype/hosts/flame/api/scripts/wiretap_com.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/flame/api/scripts/wiretap_com.py b/openpype/hosts/flame/api/scripts/wiretap_com.py index ee906c2608..a85a85ae25 100644 --- a/openpype/hosts/flame/api/scripts/wiretap_com.py +++ b/openpype/hosts/flame/api/scripts/wiretap_com.py @@ -422,7 +422,7 @@ class WireTapCom(object): color_policy = color_policy or "Legacy" # check if the colour policy in custom dir - if not os.path.exists(color_policy): + if "/" not in color_policy: color_policy = "/syncolor/policies/Autodesk/{}".format( color_policy) From c6735927dcc62b2060bbac7c3d5bd52aee740783 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 18 Mar 2022 17:41:23 +0100 Subject: [PATCH 23/91] flame: fixing head and tail could be string value --- openpype/hosts/flame/api/lib.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/flame/api/lib.py b/openpype/hosts/flame/api/lib.py index 74d9e7607a..aa2cfcb96d 100644 --- a/openpype/hosts/flame/api/lib.py +++ b/openpype/hosts/flame/api/lib.py @@ -18,6 +18,7 @@ log = Logger.get_logger(__name__) FRAME_PATTERN = re.compile(r"[\._](\d+)[\.]") + class CTX: # singleton used for passing data between api modules app_framework = None @@ -538,9 +539,17 @@ def get_segment_attributes(segment): # head and tail with forward compatibility if segment.head: - clip_data["segment_head"] = int(segment.head) + # `infinite` can be also returned + if isinstance(segment.head, str): + clip_data["segment_head"] = 0 + else: + clip_data["segment_head"] = int(segment.head) if segment.tail: - clip_data["segment_tail"] = int(segment.tail) + # `infinite` can be also returned + if isinstance(segment.tail, str): + clip_data["segment_tail"] = 0 + else: + clip_data["segment_tail"] = int(segment.tail) # add all available shot tokens shot_tokens = _get_shot_tokens_values(segment, [ From 7825da773636eeaa96a2ac377db90836c0f32727 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 18 Mar 2022 17:43:04 +0100 Subject: [PATCH 24/91] flame: selected segments collected only once --- .../publish/collect_timeline_instances.py | 173 +++++++++--------- .../plugins/publish/collect_timeline_otio.py | 41 +++-- 2 files changed, 110 insertions(+), 104 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index 70340ad7a2..390c55837c 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -34,119 +34,124 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): def process(self, context): project = context.data["flameProject"] sequence = context.data["flameSequence"] + selected_segments = context.data["flameSelectedSegments"] + self.log.debug("__ selected_segments: {}".format(selected_segments)) + self.otio_timeline = context.data["otioTimeline"] self.clips_in_reels = opfapi.get_clips_in_reels(project) self.fps = context.data["fps"] # process all sellected - with opfapi.maintained_segment_selection(sequence) as segments: - for segment in segments: - comment_attributes = self._get_comment_attributes(segment) - self.log.debug("_ comment_attributes: {}".format( - pformat(comment_attributes))) + for segment in selected_segments: + comment_attributes = self._get_comment_attributes(segment) + self.log.debug("__ segment.name: {}".format( + segment.name + )) + self.log.debug("_ comment_attributes: {}".format( + pformat(comment_attributes))) - clip_data = opfapi.get_segment_attributes(segment) - clip_name = clip_data["segment_name"] - self.log.debug("clip_name: {}".format(clip_name)) + clip_data = opfapi.get_segment_attributes(segment) + clip_name = clip_data["segment_name"] + self.log.debug("clip_name: {}".format(clip_name)) - # get openpype tag data - marker_data = opfapi.get_segment_data_marker(segment) - self.log.debug("__ marker_data: {}".format( - pformat(marker_data))) + # get openpype tag data + marker_data = opfapi.get_segment_data_marker(segment) + self.log.debug("__ marker_data: {}".format( + pformat(marker_data))) - if not marker_data: - continue + if not marker_data: + continue - if marker_data.get("id") != "pyblish.avalon.instance": - continue + if marker_data.get("id") != "pyblish.avalon.instance": + continue - # get file path - file_path = clip_data["fpath"] + # get file path + file_path = clip_data["fpath"] - # get source clip - source_clip = self._get_reel_clip(file_path) + # get source clip + source_clip = self._get_reel_clip(file_path) - first_frame = opfapi.get_frame_from_filename(file_path) or 0 + first_frame = opfapi.get_frame_from_filename(file_path) or 0 - head, tail = self._get_head_tail(clip_data, first_frame) + head, tail = self._get_head_tail(clip_data, first_frame) - # solve handles length - marker_data["handleStart"] = min( - marker_data["handleStart"], head) - marker_data["handleEnd"] = min( - marker_data["handleEnd"], tail) + # solve handles length + marker_data["handleStart"] = min( + marker_data["handleStart"], head) + marker_data["handleEnd"] = min( + marker_data["handleEnd"], tail) - with_audio = bool(marker_data.pop("audio")) + with_audio = bool(marker_data.pop("audio")) - # add marker data to instance data - inst_data = dict(marker_data.items()) + # add marker data to instance data + inst_data = dict(marker_data.items()) - asset = marker_data["asset"] - subset = marker_data["subset"] + asset = marker_data["asset"] + subset = marker_data["subset"] - # insert family into families - family = marker_data["family"] - families = [str(f) for f in marker_data["families"]] - families.insert(0, str(family)) + # insert family into families + family = marker_data["family"] + families = [str(f) for f in marker_data["families"]] + families.insert(0, str(family)) - # form label - label = asset - if asset != clip_name: - label += " ({})".format(clip_name) - label += " {}".format(subset) - label += " {}".format("[" + ", ".join(families) + "]") + # form label + label = asset + if asset != clip_name: + label += " ({})".format(clip_name) + label += " {}".format(subset) + label += " {}".format("[" + ", ".join(families) + "]") - inst_data.update({ - "name": "{}_{}".format(asset, subset), - "label": label, - "asset": asset, - "item": segment, - "families": families, - "publish": marker_data["publish"], - "fps": self.fps, - "flameSourceClip": source_clip, - "sourceFirstFrame": int(first_frame), - "path": file_path - }) + inst_data.update({ + "name": "{}_{}".format(asset, subset), + "label": label, + "asset": asset, + "item": segment, + "families": families, + "publish": marker_data["publish"], + "fps": self.fps, + "flameSourceClip": source_clip, + "sourceFirstFrame": int(first_frame), + "path": file_path + }) - # get otio clip data - otio_data = self._get_otio_clip_instance_data(clip_data) or {} - self.log.debug("__ otio_data: {}".format(pformat(otio_data))) + # get otio clip data + otio_data = self._get_otio_clip_instance_data(clip_data) or {} + self.log.debug("__ otio_data: {}".format(pformat(otio_data))) - # add to instance data - inst_data.update(otio_data) - self.log.debug("__ inst_data: {}".format(pformat(inst_data))) + # add to instance data + inst_data.update(otio_data) + self.log.debug("__ inst_data: {}".format(pformat(inst_data))) - # add resolution - self._get_resolution_to_data(inst_data, context) + # add resolution + self._get_resolution_to_data(inst_data, context) - # add comment attributes if any - inst_data.update(comment_attributes) + # add comment attributes if any + inst_data.update(comment_attributes) - # create instance - instance = context.create_instance(**inst_data) + # create instance + instance = context.create_instance(**inst_data) - # add colorspace data - instance.data.update({ - "versionData": { - "colorspace": clip_data["colour_space"], - } - }) + # add colorspace data + instance.data.update({ + "versionData": { + "colorspace": clip_data["colour_space"], + } + }) - # create shot instance for shot attributes create/update - self._create_shot_instance(context, clip_name, **inst_data) + # create shot instance for shot attributes create/update + self._create_shot_instance(context, clip_name, **inst_data) - self.log.info("Creating instance: {}".format(instance)) - self.log.info( - "_ instance.data: {}".format(pformat(instance.data))) + self.log.info("Creating instance: {}".format(instance)) + self.log.info( + "_ instance.data: {}".format(pformat(instance.data))) - if not with_audio: - continue + if not with_audio: + continue - # add audioReview attribute to plate instance data - # if reviewTrack is on - if marker_data.get("reviewTrack") is not None: - instance.data["reviewAudio"] = True + # add audioReview attribute to plate instance data + # if reviewTrack is on + if marker_data.get("reviewTrack") is not None: + instance.data["reviewAudio"] = True def _get_comment_attributes(self, segment): comment = segment.comment.get_value() @@ -188,7 +193,7 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): # get pattern defined by type pattern = TXT_PATERN - if a_type in ("number" , "float"): + if a_type in ("number", "float"): pattern = NUM_PATERN res_goup = pattern.findall(value) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_otio.py b/openpype/hosts/flame/plugins/publish/collect_timeline_otio.py index faa5be9d68..c6aeae7730 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_otio.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_otio.py @@ -31,27 +31,28 @@ class CollecTimelineOTIO(pyblish.api.ContextPlugin): ) # adding otio timeline to context - with opfapi.maintained_segment_selection(sequence): + with opfapi.maintained_segment_selection(sequence) as selected_seg: otio_timeline = flame_export.create_otio_timeline(sequence) - instance_data = { - "name": subset_name, - "asset": asset_doc["name"], - "subset": subset_name, - "family": "workfile" - } + instance_data = { + "name": subset_name, + "asset": asset_doc["name"], + "subset": subset_name, + "family": "workfile" + } - # create instance with workfile - instance = context.create_instance(**instance_data) - self.log.info("Creating instance: {}".format(instance)) + # create instance with workfile + instance = context.create_instance(**instance_data) + self.log.info("Creating instance: {}".format(instance)) - # update context with main project attributes - context.data.update({ - "flameProject": project, - "flameSequence": sequence, - "otioTimeline": otio_timeline, - "currentFile": "Flame/{}/{}".format( - project.name, sequence.name - ), - "fps": float(str(sequence.frame_rate)[:-4]) - }) + # update context with main project attributes + context.data.update({ + "flameProject": project, + "flameSequence": sequence, + "otioTimeline": otio_timeline, + "currentFile": "Flame/{}/{}".format( + project.name, sequence.name + ), + "flameSelectedSegments": selected_seg, + "fps": float(str(sequence.frame_rate)[:-4]) + }) From ae9e34bc62d5d9918842df27492d4a418a83cc82 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 11:21:26 +0900 Subject: [PATCH 25/91] use collected animation data at multiverse use creator --- .../maya/plugins/create/create_multiverse_usd.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py index 6851e0f6bc..c06c764f95 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py @@ -44,15 +44,9 @@ class CreateMultiverseUsd(plugin.Creator): self.data["writeUsdAttributes"] = False self.data["timeVaryingTopology"] = False self.data["customMaterialNamespace"] = '' + self.data["numTimeSamples"] = 1 + self.data["timeSamplesSpan"] = 0.0 - # The attributes below are about animated cache. - self.data["writeTimeRange"] = True - self.data["timeRangeNumTimeSamples"] = 0 - self.data["timeRangeSamplesSpan"] = 0.0 - + # Add animation data animation_data = lib.collect_animation_data(True) - - self.data["timeRangeStart"] = animation_data["frameStart"] - self.data["timeRangeEnd"] = animation_data["frameEnd"] - self.data["timeRangeIncrement"] = animation_data["step"] - self.data["timeRangeFramesPerSecond"] = animation_data["fps"] + self.data.update(animation_data) From 370416a949280a4223a07f0e4a70060b43433fa4 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 11:41:13 +0900 Subject: [PATCH 26/91] use openpye built-in variables for multiverse usd extractor --- .../plugins/publish/extract_multiverse_usd.py | 60 +++++++++---------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 7c13252957..db0f57768b 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -58,22 +58,13 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeUsdAttributes": bool, "timeVaryingTopology": bool, "customMaterialNamespace": str, - "writeTimeRange": bool, - "timeRangeStart": int, - "timeRangeEnd": int, - "timeRangeIncrement": int, - "timeRangeNumTimeSamples": int, - "timeRangeSamplesSpan": float, - "timeRangeFramesPerSecond": float + "numTimeSamples": int, + "timeSamplesSpan": float } @property def default_options(self): """The default options for Multiverse USD extraction.""" - start_frame = int(cmds.playbackOptions(query=True, - animationStartTime=True)) - end_frame = int(cmds.playbackOptions(query=True, - animationEndTime=True)) return { "stripNamespaces": False, @@ -108,13 +99,8 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeUsdAttributes": False, "timeVaryingTopology": False, "customMaterialNamespace": '', - "writeTimeRange": True, - "timeRangeStart": start_frame, - "timeRangeEnd": end_frame, - "timeRangeIncrement": 1, - "timeRangeNumTimeSamples": 0, - "timeRangeSamplesSpan": 0.0, - "timeRangeFramesPerSecond": 24.0 + "numTimeSamples": 1, + "timeSamplesSpan": 0.0 } def process(self, instance): @@ -130,6 +116,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): # Parse export options options = self.default_options self.log.info("Export options: {0}".format(options)) + self.log.info("Export instance data: {0}".format(instance.data)) # Perform extraction self.log.info("Performing extraction ...") @@ -144,30 +131,39 @@ class ExtractMultiverseUsd(openpype.api.Extractor): long=True) self.log.info('Collected object {}'.format(members)) - # TODO: Deal with asset, composition, overide with options. import multiverse time_opts = None - if options["writeTimeRange"]: + frame_start = instance.data['frameStart'] + frame_end = instance.data['frameEnd'] + step = instance.data['step'] + fps = instance.data['fps'] + if frame_end != frame_start: time_opts = multiverse.TimeOptions() time_opts.writeTimeRange = True - - time_range_start = options["timeRangeStart"] - time_range_end = options["timeRangeEnd"] - time_opts.frameRange = (time_range_start, time_range_end) - - time_opts.frameIncrement = options["timeRangeIncrement"] - time_opts.numTimeSamples = options["timeRangeNumTimeSamples"] - time_opts.timeSamplesSpan = options["timeRangeSamplesSpan"] - time_opts.framePerSecond = options["timeRangeFramesPerSecond"] + time_opts.frameRange = (frame_start, frame_end) + time_opts.frameIncrement = step + time_opts.numTimeSamples = instance.data["numTimeSamples"] + time_opts.timeSamplesSpan = instance.data["timeSamplesSpan"] + time_opts.framePerSecond = fps asset_write_opts = multiverse.AssetWriteOptions(time_opts) options_items = getattr(options, "iteritems", options.items) - for (k, v) in options_items(): - if k == "writeTimeRange" or k.startswith("timeRange"): + options_discard_keys = [ + 'numTimeSamples', + 'timeSamplesSpan', + 'frameStart', + 'frameEnd', + 'handleStart', + 'handleEnd', + 'step', + 'fps' + ] + for key, value in options_items(): + if key in options_discard_keys: continue - setattr(asset_write_opts, k, v) + setattr(asset_write_opts, key, instance.data[key]) multiverse.WriteAsset(file_path, members, asset_write_opts) From 889851a2d820cc43c23819b2afca4781c3c471c5 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 11:43:58 +0900 Subject: [PATCH 27/91] tidy variable of unused variable at multiverse usd creator --- openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index db0f57768b..d084ac844e 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -160,7 +160,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): 'step', 'fps' ] - for key, value in options_items(): + for key, _value in options_items(): if key in options_discard_keys: continue setattr(asset_write_opts, key, instance.data[key]) From b553fe66a044a4b3f2570503375b1a8a0f13a2c8 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 12:10:35 +0900 Subject: [PATCH 28/91] add method parse_overrides to multiverse usd extractor to update option values --- .../plugins/publish/extract_multiverse_usd.py | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index d084ac844e..9e6d46af7e 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -32,9 +32,9 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "flattenParentXforms": bool, "writeSparseOverrides": bool, "useMetaPrimPath": bool, - "customRootPath": str, - "customAttributes": str, - "nodeTypesToIgnore": str, + "customRootPath": unicode, + "customAttributes": unicode, + "nodeTypesToIgnore": unicode, "writeMeshes": bool, "writeCurves": bool, "writeParticles": bool, @@ -57,7 +57,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeTransformMatrix": bool, "writeUsdAttributes": bool, "timeVaryingTopology": bool, - "customMaterialNamespace": str, + "customMaterialNamespace": unicode, "numTimeSamples": int, "timeSamplesSpan": float } @@ -103,6 +103,29 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "timeSamplesSpan": 0.0 } + def parse_overrides(self, instance, options): + """Inspect data of instance to determine overridden options""" + + for key in instance.data: + if key not in self.options: + continue + + # Ensure the data is of correct type + value = instance.data[key] + if not isinstance(value, self.options[key]): + self.log.warning( + "Overridden attribute {key} was of " + "the wrong type: {invalid_type} " + "- should have been {valid_type}".format( + key=key, + invalid_type=type(value).__name__, + valid_type=self.options[key].__name__)) + continue + + options[key] = value + + return options + def process(self, instance): # Load plugin firstly cmds.loadPlugin("MultiverseForMaya", quiet=True) @@ -115,8 +138,8 @@ class ExtractMultiverseUsd(openpype.api.Extractor): # Parse export options options = self.default_options + options = self.parse_overrides(instance, options) self.log.info("Export options: {0}".format(options)) - self.log.info("Export instance data: {0}".format(instance.data)) # Perform extraction self.log.info("Performing extraction ...") From cc1d6313d534d1a6dc76cc4101fd8021806bf44d Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 12:24:09 +0900 Subject: [PATCH 29/91] convert string to unicode at multiverse usd extractor --- openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 9e6d46af7e..5fece9cfd3 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -112,6 +112,8 @@ class ExtractMultiverseUsd(openpype.api.Extractor): # Ensure the data is of correct type value = instance.data[key] + if isinstance(value, str): + value = unicode(value, "utf-8") if not isinstance(value, self.options[key]): self.log.warning( "Overridden attribute {key} was of " From b5d775700d8cfe20ea8d3db0db2354eaa815380c Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 12:28:51 +0900 Subject: [PATCH 30/91] declare default string option as unicode --- .../maya/plugins/publish/extract_multiverse_usd.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 5fece9cfd3..7b01d3066d 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -73,9 +73,9 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "flattenParentXforms": False, "writeSparseOverrides": False, "useMetaPrimPath": False, - "customRootPath": '', - "customAttributes": '', - "nodeTypesToIgnore": '', + "customRootPath": u'', + "customAttributes": u'', + "nodeTypesToIgnore": u'', "writeMeshes": True, "writeCurves": True, "writeParticles": True, @@ -98,7 +98,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeTransformMatrix": True, "writeUsdAttributes": False, "timeVaryingTopology": False, - "customMaterialNamespace": '', + "customMaterialNamespace": u'', "numTimeSamples": 1, "timeSamplesSpan": 0.0 } @@ -112,8 +112,6 @@ class ExtractMultiverseUsd(openpype.api.Extractor): # Ensure the data is of correct type value = instance.data[key] - if isinstance(value, str): - value = unicode(value, "utf-8") if not isinstance(value, self.options[key]): self.log.warning( "Overridden attribute {key} was of " From fba9399bd3cef9ea5043f312903684bc88b0cab1 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 12:31:09 +0900 Subject: [PATCH 31/91] use values from processed options from multiverse usd extractor --- openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 7b01d3066d..fd46f87684 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -183,10 +183,10 @@ class ExtractMultiverseUsd(openpype.api.Extractor): 'step', 'fps' ] - for key, _value in options_items(): + for key, value in options_items(): if key in options_discard_keys: continue - setattr(asset_write_opts, key, instance.data[key]) + setattr(asset_write_opts, key, value) multiverse.WriteAsset(file_path, members, asset_write_opts) From adde37f982b001bd1aae6722c4e2d4ff3b94d466 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 13:48:47 +0900 Subject: [PATCH 32/91] removed root transform when load the usd file --- .../maya/plugins/load/load_multiverse_usd.py | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index 3370033141..8a618d5b01 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -1,7 +1,15 @@ # -*- coding: utf-8 -*- +import maya.cmds as cmds +import maya.mel as mel + from avalon import api -import maya.cmds as cmds +from openpype.hosts.maya.api.lib import ( + maintained_selection, + namespaced, + unique_namespace +) +from openpype.hosts.maya.api.pipeline import containerise class MultiverseUsdLoader(api.Loader): @@ -17,9 +25,6 @@ class MultiverseUsdLoader(api.Loader): def load(self, context, name=None, namespace=None, options=None): - from openpype.hosts.maya.api.pipeline import containerise - from openpype.hosts.maya.api.lib import unique_namespace - asset = context['asset']['name'] namespace = namespace or unique_namespace( asset + "_", @@ -27,19 +32,19 @@ class MultiverseUsdLoader(api.Loader): suffix="_", ) + # Create the shape cmds.loadPlugin("MultiverseForMaya", quiet=True) - # Root group - rootName = "{}:{}".format(namespace, name) - root = cmds.group(name=rootName, empty=True) + shape = None + transform = None + with maintained_selection(): + cmds.namespace(addNamespace=namespace) + with namespaced(namespace, new=False): + import multiverse + shape = multiverse.CreateUsdCompound(self.fname) + transform = mel.eval('firstParentOf "{}"'.format(shape)) - # Create shape with transform and move it under root - import multiverse - transform = multiverse.CreateUsdCompound(self.fname) - cmds.parent(transform, root) - - # Rename transform - nodes = [root, transform] + nodes = [transform, shape] self[:] = nodes return containerise( From e1bdbf3cdc61e2dbf3b211cc80c725af6c1c2e06 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Tue, 22 Mar 2022 14:18:17 +0900 Subject: [PATCH 33/91] updated update and remove method in usd loader --- .../maya/plugins/load/load_multiverse_usd.py | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index 8a618d5b01..dac2244b5f 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -55,20 +55,22 @@ class MultiverseUsdLoader(api.Loader): loader=self.__class__.__name__) def update(self, container, representation): + # type: (dict, dict) -> None + """Update container with specified representation.""" + node = container['objectName'] + assert cmds.objExists(node), "Missing container" + + members = cmds.sets(node, query=True) or [] + shapes = cmds.ls(members, type="mvUsdCompoundShape") + assert shapes, "Cannot find mvUsdCompoundShape in container" path = api.get_representation_path(representation) - # Update the shape - members = cmds.sets(container['objectName'], query=True) - shapes = cmds.ls(members, type="mvUsdCompoundShape", long=True) - - assert len(shapes) == 1, "This is a bug" - import multiverse for shape in shapes: multiverse.SetUsdCompoundAssetPaths(shape, [path]) - cmds.setAttr(container["objectName"] + ".representation", + cmds.setAttr("{}.representation".format(node), str(representation["_id"]), type="string") @@ -76,4 +78,19 @@ class MultiverseUsdLoader(api.Loader): self.update(container, representation) def remove(self, container): - pass + # type: (dict) -> None + """Remove loaded container.""" + # Delete container and its contents + if cmds.objExists(container['objectName']): + members = cmds.sets(container['objectName'], query=True) or [] + cmds.delete([container['objectName']] + members) + + # Remove the namespace, if empty + namespace = container['namespace'] + if cmds.namespace(exists=namespace): + members = cmds.namespaceInfo(namespace, listNamespace=True) + if not members: + cmds.namespace(removeNamespace=namespace) + else: + self.log.warning("Namespace not deleted because it " + "still has members: %s", namespace) From 0990163a0b487f3e32c5563c7f742e29ca26d0bd Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Wed, 23 Mar 2022 18:30:34 +0900 Subject: [PATCH 34/91] fix removed module from multiverse usd extractor --- .../hosts/maya/plugins/publish/extract_multiverse_usd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index fd46f87684..d45ceb1932 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -1,10 +1,10 @@ import os -import avalon.maya -import openpype.api - from maya import cmds +import openpype.api +from openpype.hosts.maya.api.lib import maintained_selection + class ExtractMultiverseUsd(openpype.api.Extractor): """Extractor for USD by Multiverse.""" @@ -144,7 +144,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): # Perform extraction self.log.info("Performing extraction ...") - with avalon.maya.maintained_selection(): + with maintained_selection(): members = instance.data("setMembers") members = cmds.ls(members, dag=True, From 7a96bfcfbf2199d2c4c0d1c3d5db9cc049018653 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 09:45:36 +0900 Subject: [PATCH 35/91] deal with handle start and end for multiverse usd extractor --- .../hosts/maya/plugins/publish/extract_multiverse_usd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index d45ceb1932..c64e5b03e2 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -159,13 +159,16 @@ class ExtractMultiverseUsd(openpype.api.Extractor): time_opts = None frame_start = instance.data['frameStart'] frame_end = instance.data['frameEnd'] + handle_start = instance.data['handleStart'] + handle_end = instance.data['handleEnd'] step = instance.data['step'] fps = instance.data['fps'] if frame_end != frame_start: time_opts = multiverse.TimeOptions() time_opts.writeTimeRange = True - time_opts.frameRange = (frame_start, frame_end) + time_opts.frameRange = ( + frame_start - handle_start, frame_end + handle_end) time_opts.frameIncrement = step time_opts.numTimeSamples = instance.data["numTimeSamples"] time_opts.timeSamplesSpan = instance.data["timeSamplesSpan"] From 006c43c6f08106dc7702ca49623dd18e3f1b18c4 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 10:37:17 +0900 Subject: [PATCH 36/91] replace unicode with str and normalize unicode instance data value --- .../plugins/publish/extract_multiverse_usd.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index c64e5b03e2..d7d1337930 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -1,4 +1,5 @@ import os +import six from maya import cmds @@ -32,9 +33,9 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "flattenParentXforms": bool, "writeSparseOverrides": bool, "useMetaPrimPath": bool, - "customRootPath": unicode, - "customAttributes": unicode, - "nodeTypesToIgnore": unicode, + "customRootPath": str, + "customAttributes": str, + "nodeTypesToIgnore": str, "writeMeshes": bool, "writeCurves": bool, "writeParticles": bool, @@ -57,7 +58,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeTransformMatrix": bool, "writeUsdAttributes": bool, "timeVaryingTopology": bool, - "customMaterialNamespace": unicode, + "customMaterialNamespace": str, "numTimeSamples": int, "timeSamplesSpan": float } @@ -73,9 +74,9 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "flattenParentXforms": False, "writeSparseOverrides": False, "useMetaPrimPath": False, - "customRootPath": u'', - "customAttributes": u'', - "nodeTypesToIgnore": u'', + "customRootPath": str(), + "customAttributes": str(), + "nodeTypesToIgnore": str(), "writeMeshes": True, "writeCurves": True, "writeParticles": True, @@ -98,7 +99,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeTransformMatrix": True, "writeUsdAttributes": False, "timeVaryingTopology": False, - "customMaterialNamespace": u'', + "customMaterialNamespace": str(), "numTimeSamples": 1, "timeSamplesSpan": 0.0 } @@ -112,6 +113,8 @@ class ExtractMultiverseUsd(openpype.api.Extractor): # Ensure the data is of correct type value = instance.data[key] + if isinstance(value, six.text_type): + value = str(value) if not isinstance(value, self.options[key]): self.log.warning( "Overridden attribute {key} was of " From de8eac521c091914a4a1e7063e792c269b0db162 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 11:00:44 +0900 Subject: [PATCH 37/91] improved multiverse usd composition creator --- .../plugins/create/create_multiverse_usd_comp.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py index 2f57ccec6c..5d216ddb9c 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py @@ -4,7 +4,7 @@ from openpype.hosts.maya.api import plugin, lib class CreateMultiverseUsdComp(plugin.Creator): """Create Multiverse USD Composition""" - name = "usdOverrideMain" + name = "usdCompositionMain" label = "Multiverse USD Composition" family = "usdComposition" icon = "cubes" @@ -17,14 +17,6 @@ class CreateMultiverseUsdComp(plugin.Creator): self.data["flattenContent"] = False self.data["writePendingOverrides"] = False - # The attributes below are about animated cache. - self.data["writeTimeRange"] = True - self.data["timeRangeNumTimeSamples"] = 0 - self.data["timeRangeSamplesSpan"] = 0.0 - + # Add animation data animation_data = lib.collect_animation_data(True) - - self.data["timeRangeStart"] = animation_data["frameStart"] - self.data["timeRangeEnd"] = animation_data["frameEnd"] - self.data["timeRangeIncrement"] = animation_data["step"] - self.data["timeRangeFramesPerSecond"] = animation_data["fps"] + self.data.update(animation_data) From 7320e570cac9e2c5852709e9c37dc9e2dd37f9dd Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 11:37:11 +0900 Subject: [PATCH 38/91] fixed multiverse usd composition extractor --- .../publish/extract_multiverse_usd_comp.py | 98 +++++++++++-------- 1 file changed, 58 insertions(+), 40 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py index 449a99e1be..c80a3cce6c 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -1,10 +1,10 @@ import os -import avalon.maya -import openpype.api - from maya import cmds +import openpype.api +from openpype.hosts.maya.api.lib import maintained_selection + class ExtractMultiverseUsdComposition(openpype.api.Extractor): """Extractor of Multiverse USD Composition.""" @@ -29,38 +29,43 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): "stripNamespaces": bool, "mergeTransformAndShape": bool, "flattenContent": bool, - "writePendingOverrides": bool, - "writeTimeRange": bool, - "timeRangeStart": int, - "timeRangeEnd": int, - "timeRangeIncrement": int, - "timeRangeNumTimeSamples": int, - "timeRangeSamplesSpan": float, - "timeRangeFramesPerSecond": float + "writePendingOverrides": bool } @property def default_options(self): """The default options for Multiverse USD extraction.""" - start_frame = int(cmds.playbackOptions(query=True, - animationStartTime=True)) - end_frame = int(cmds.playbackOptions(query=True, - animationEndTime=True)) return { "stripNamespaces": False, "mergeTransformAndShape": False, "flattenContent": False, - "writePendingOverrides": False, - "writeTimeRange": True, - "timeRangeStart": start_frame, - "timeRangeEnd": end_frame, - "timeRangeIncrement": 1, - "timeRangeNumTimeSamples": 0, - "timeRangeSamplesSpan": 0.0, - "timeRangeFramesPerSecond": 24.0 + "writePendingOverrides": False } + def parse_overrides(self, instance, options): + """Inspect data of instance to determine overridden options""" + + for key in instance.data: + if key not in self.options: + continue + + # Ensure the data is of correct type + value = instance.data[key] + if not isinstance(value, self.options[key]): + self.log.warning( + "Overridden attribute {key} was of " + "the wrong type: {invalid_type} " + "- should have been {valid_type}".format( + key=key, + invalid_type=type(value).__name__, + valid_type=self.options[key].__name__)) + continue + + options[key] = value + + return options + def process(self, instance): # Load plugin firstly cmds.loadPlugin("MultiverseForMaya", quiet=True) @@ -73,46 +78,59 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): # Parse export options options = self.default_options + options = self.parse_overrides(instance, options) self.log.info("Export options: {0}".format(options)) # Perform extraction self.log.info("Performing extraction ...") - with avalon.maya.maintained_selection(): + with maintained_selection(): members = instance.data("setMembers") members = cmds.ls(members, dag=True, shapes=True, - type=("mvUsdCompoundShape"), + type="mvUsdCompoundShape", noIntermediate=True, long=True) self.log.info('Collected object {}'.format(members)) - # TODO: Deal with asset, composition, overide with options. import multiverse time_opts = None - if options["writeTimeRange"]: + frame_start = instance.data['frameStart'] + frame_end = instance.data['frameEnd'] + handle_start = instance.data['handleStart'] + handle_end = instance.data['handleEnd'] + step = instance.data['step'] + fps = instance.data['fps'] + if frame_end != frame_start: time_opts = multiverse.TimeOptions() time_opts.writeTimeRange = True - - time_range_start = options["timeRangeStart"] - time_range_end = options["timeRangeEnd"] - time_opts.frameRange = (time_range_start, time_range_end) - - time_opts.frameIncrement = options["timeRangeIncrement"] - time_opts.numTimeSamples = options["timeRangeNumTimeSamples"] - time_opts.timeSamplesSpan = options["timeRangeSamplesSpan"] - time_opts.framePerSecond = options["timeRangeFramesPerSecond"] + time_opts.frameRange = ( + frame_start - handle_start, frame_end + handle_end) + time_opts.frameIncrement = step + time_opts.numTimeSamples = instance.data["numTimeSamples"] + time_opts.timeSamplesSpan = instance.data["timeSamplesSpan"] + time_opts.framePerSecond = fps comp_write_opts = multiverse.CompositionWriteOptions() options_items = getattr(options, "iteritems", options.items) - for (k, v) in options_items(): - if k == "writeTimeRange" or k.startswith("timeRange"): + options_discard_keys = [ + 'numTimeSamples', + 'timeSamplesSpan', + 'frameStart', + 'frameEnd', + 'handleStart', + 'handleEnd', + 'step', + 'fps' + ] + for key, value in options_items(): + if key in options_discard_keys: continue - setattr(comp_write_opts, k, v) - comp_write_opts.timeOptions = time_opts + setattr(asset_write_opts, key, value) + multiverse.WriteComposition(file_path, members, comp_write_opts) if "representations" not in instance.data: From 783c315c7eaba812d6b9e16fde5b962c4ebae6d2 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 12:05:49 +0900 Subject: [PATCH 39/91] fixed creator of multiverse usd composition with more arguments --- .../hosts/maya/plugins/create/create_multiverse_usd_comp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py index 5d216ddb9c..56b8721ce0 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py @@ -16,6 +16,8 @@ class CreateMultiverseUsdComp(plugin.Creator): self.data["mergeTransformAndShape"] = False self.data["flattenContent"] = False self.data["writePendingOverrides"] = False + self.data["numTimeSamples"] = 1 + self.data["timeSamplesSpan"] = 0.0 # Add animation data animation_data = lib.collect_animation_data(True) From d69d7cddf488dd109f9be3fbb38f13578f165bbb Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 12:07:06 +0900 Subject: [PATCH 40/91] fix multiverse composition extractor for arguments --- .../plugins/publish/extract_multiverse_usd_comp.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py index c80a3cce6c..3876afb89c 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -29,7 +29,9 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): "stripNamespaces": bool, "mergeTransformAndShape": bool, "flattenContent": bool, - "writePendingOverrides": bool + "writePendingOverrides": bool, + "numTimeSamples": int, + "timeSamplesSpan": float } @property @@ -37,10 +39,12 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): """The default options for Multiverse USD extraction.""" return { - "stripNamespaces": False, + "stripNamespaces": True, "mergeTransformAndShape": False, "flattenContent": False, - "writePendingOverrides": False + "writePendingOverrides": False, + "numTimeSamples": 1, + "timeSamplesSpan": 0.0 } def parse_overrides(self, instance, options): @@ -72,7 +76,7 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): # Define output file path staging_dir = self.staging_dir(instance) - file_name = "{}.usda".format(instance.name) + file_name = "{}.usd".format(instance.name) file_path = os.path.join(staging_dir, file_name) file_path = file_path.replace('\\', '/') @@ -129,7 +133,7 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): for key, value in options_items(): if key in options_discard_keys: continue - setattr(asset_write_opts, key, value) + setattr(comp_write_opts, key, value) multiverse.WriteComposition(file_path, members, comp_write_opts) From 3ab9c8c0bf09cf68e74e38684c9ab1dac2367820 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 12:07:37 +0900 Subject: [PATCH 41/91] fixed multiverse usd loader for new api --- .../hosts/maya/plugins/load/load_multiverse_usd.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index dac2244b5f..ce84c0baf8 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -2,8 +2,10 @@ import maya.cmds as cmds import maya.mel as mel -from avalon import api - +from openpype.pipeline import ( + load, + get_representation_path +) from openpype.hosts.maya.api.lib import ( maintained_selection, namespaced, @@ -12,7 +14,7 @@ from openpype.hosts.maya.api.lib import ( from openpype.hosts.maya.api.pipeline import containerise -class MultiverseUsdLoader(api.Loader): +class MultiverseUsdLoader(load.LoaderPlugin): """Load the USD by Multiverse""" families = ["model", "usd", "usdComposition", "usdOverride"] @@ -64,7 +66,7 @@ class MultiverseUsdLoader(api.Loader): shapes = cmds.ls(members, type="mvUsdCompoundShape") assert shapes, "Cannot find mvUsdCompoundShape in container" - path = api.get_representation_path(representation) + path = get_representation_path(representation) import multiverse for shape in shapes: From 498c968805bbaa1097582deee3999499245f03e4 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 13:43:42 +0900 Subject: [PATCH 42/91] use py3 style to iterate option dict --- openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index d7d1337930..29f806375e 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -178,7 +178,6 @@ class ExtractMultiverseUsd(openpype.api.Extractor): time_opts.framePerSecond = fps asset_write_opts = multiverse.AssetWriteOptions(time_opts) - options_items = getattr(options, "iteritems", options.items) options_discard_keys = [ 'numTimeSamples', 'timeSamplesSpan', @@ -189,7 +188,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): 'step', 'fps' ] - for key, value in options_items(): + for key, value in options.items(): if key in options_discard_keys: continue setattr(asset_write_opts, key, value) From 0645dc8190db07e70a6f8c5caa12a47b3975fdb2 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 13:49:58 +0900 Subject: [PATCH 43/91] use py3 style to iterate option dict from multiverse usd composition extractor --- .../hosts/maya/plugins/publish/extract_multiverse_usd_comp.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py index 3876afb89c..1d764d1221 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -119,7 +119,6 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): time_opts.framePerSecond = fps comp_write_opts = multiverse.CompositionWriteOptions() - options_items = getattr(options, "iteritems", options.items) options_discard_keys = [ 'numTimeSamples', 'timeSamplesSpan', @@ -130,7 +129,7 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): 'step', 'fps' ] - for key, value in options_items(): + for key, value in options.items(): if key in options_discard_keys: continue setattr(comp_write_opts, key, value) From fe2a3e8c2f086bd6dab61d9ac358a8a9ae12f66c Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 13:52:06 +0900 Subject: [PATCH 44/91] use usd as name and ext for representation from multiverse usd composition extractor --- .../hosts/maya/plugins/publish/extract_multiverse_usd_comp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py index 1d764d1221..8a26379313 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -140,8 +140,8 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): instance.data["representations"] = [] representation = { - 'name': 'usda', - 'ext': 'usda', + 'name': 'usd', + 'ext': 'usd', 'files': file_name, "stagingDir": staging_dir } From d41d114bd3afcb25c98a1ce15f73322673eae210 Mon Sep 17 00:00:00 2001 From: DMO Date: Thu, 24 Mar 2022 16:49:57 +0900 Subject: [PATCH 45/91] updating create mv overwrite to correct data fields getting used. --- .../plugins/create/create_multiverse_usd_over.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py index bdec96c2ff..9ccf2e45fc 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py @@ -21,15 +21,9 @@ class CreateMultiverseUsdOver(plugin.Creator): self.data["writeVariantsDefinition"] = True self.data["writeActiveState"] = True self.data["writeNamespaces"] = False + self.data["numTimeSamples"] = 1 + self.data["timeSamplesSpan"] = 0.0 - # The attributes below are about animated cache. - self.data["writeTimeRange"] = True - self.data["timeRangeNumTimeSamples"] = 0 - self.data["timeRangeSamplesSpan"] = 0.0 - + # Add animation data animation_data = lib.collect_animation_data(True) - - self.data["timeRangeStart"] = animation_data["frameStart"] - self.data["timeRangeEnd"] = animation_data["frameEnd"] - self.data["timeRangeIncrement"] = animation_data["step"] - self.data["timeRangeFramesPerSecond"] = animation_data["fps"] + self.data.update(animation_data) From 20124bdc836839bea94dc480ef813fa03d828fad Mon Sep 17 00:00:00 2001 From: DMO Date: Thu, 24 Mar 2022 16:50:53 +0900 Subject: [PATCH 46/91] fix import - use direct api vs avalon --- .../hosts/maya/plugins/publish/extract_multiverse_usd_over.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index 406ff8ba11..aa355513f3 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -1,7 +1,7 @@ import os -import avalon.maya import openpype.api +from openpype.hosts.maya.api.lib import maintained_selection from maya import cmds @@ -88,7 +88,7 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): # Perform extraction self.log.info("Performing extraction ...") - with avalon.maya.maintained_selection(): + with maintained_selection(): members = instance.data("setMembers") members = cmds.ls(members, dag=True, From 06dce74a3682bd2f30f4085d628d6e1cd28103dc Mon Sep 17 00:00:00 2001 From: DMO Date: Thu, 24 Mar 2022 16:51:24 +0900 Subject: [PATCH 47/91] use a set instead of a list --- .../hosts/maya/plugins/publish/extract_multiverse_usd.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 29f806375e..2357690160 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -178,7 +178,8 @@ class ExtractMultiverseUsd(openpype.api.Extractor): time_opts.framePerSecond = fps asset_write_opts = multiverse.AssetWriteOptions(time_opts) - options_discard_keys = [ + options_items = getattr(options, "iteritems", options.items) + options_discard_keys = { 'numTimeSamples', 'timeSamplesSpan', 'frameStart', @@ -187,8 +188,8 @@ class ExtractMultiverseUsd(openpype.api.Extractor): 'handleEnd', 'step', 'fps' - ] - for key, value in options.items(): + } + for key, value in options_items(): if key in options_discard_keys: continue setattr(asset_write_opts, key, value) From 1cea33d94ca967a6bc5aaeb7f8b3a10016a71052 Mon Sep 17 00:00:00 2001 From: DMO Date: Thu, 24 Mar 2022 16:52:02 +0900 Subject: [PATCH 48/91] fixing the data getting used for the write options ; standardise on " vs '. --- .../publish/extract_multiverse_usd_over.py | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index aa355513f3..9ee6f99de4 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -35,13 +35,8 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): "writeVariantsDefinition": bool, "writeActiveState": bool, "writeNamespaces": bool, - "writeTimeRange": bool, - "timeRangeStart": int, - "timeRangeEnd": int, - "timeRangeIncrement": int, - "timeRangeNumTimeSamples": int, - "timeRangeSamplesSpan": float, - "timeRangeFramesPerSecond": float + "numTimeSamples": int, + "timeSamplesSpan": float } @property @@ -62,13 +57,8 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): "writeVariantsDefinition": True, "writeActiveState": True, "writeNamespaces": False, - "writeTimeRange": True, - "timeRangeStart": start_frame, - "timeRangeEnd": end_frame, - "timeRangeIncrement": 1, - "timeRangeNumTimeSamples": 0, - "timeRangeSamplesSpan": 0.0, - "timeRangeFramesPerSecond": 24.0 + "numTimeSamples": 1, + "timeSamplesSpan": 0.0 } def process(self, instance): @@ -79,7 +69,7 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): staging_dir = self.staging_dir(instance) file_name = "{}.usda".format(instance.name) file_path = os.path.join(staging_dir, file_name) - file_path = file_path.replace('\\', '/') + file_path = file_path.replace("\\", "/") # Parse export options options = self.default_options @@ -93,36 +83,48 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): members = cmds.ls(members, dag=True, shapes=True, - type=("mvUsdCompoundShape"), + type="mvUsdCompoundShape", noIntermediate=True, long=True) - self.log.info('Collected object {}'.format(members)) + self.log.info("Collected object {}".format(members)) # TODO: Deal with asset, composition, overide with options. import multiverse time_opts = None - if options["writeTimeRange"]: + frame_start = instance.data["frameStart"] + frame_end = instance.data["frameEnd"] + handle_start = instance.data["handleStart"] + handle_end = instance.data["handleEnd"] + step = instance.data["step"] + fps = instance.data["fps"] + if frame_end != frame_start: time_opts = multiverse.TimeOptions() time_opts.writeTimeRange = True + time_opts.frameRange = ( + frame_start - handle_start, frame_end + handle_end) + time_opts.frameIncrement = step + time_opts.numTimeSamples = instance.data["numTimeSamples"] + time_opts.timeSamplesSpan = instance.data["timeSamplesSpan"] + time_opts.framePerSecond = fps - time_range_start = options["timeRangeStart"] - time_range_end = options["timeRangeEnd"] - time_opts.frameRange = (time_range_start, time_range_end) - - time_opts.frameIncrement = options["timeRangeIncrement"] - time_opts.numTimeSamples = options["timeRangeNumTimeSamples"] - time_opts.timeSamplesSpan = options["timeRangeSamplesSpan"] - time_opts.framePerSecond = options["timeRangeFramesPerSecond"] - - over_write_opts = multiverse.OverridesWriteOptions() + over_write_opts = multiverse.OverridesWriteOptions(time_opts) options_items = getattr(options, "iteritems", options.items) - for (k, v) in options_items(): - if k == "writeTimeRange" or k.startswith("timeRange"): + options_discard_keys = { + "numTimeSamples", + "timeSamplesSpan", + "frameStart", + "frameEnd", + "handleStart", + "handleEnd", + "step", + "fps" + } + for key, value in options_items(): + if key in options_discard_keys: continue - setattr(over_write_opts, k, v) - over_write_opts.timeOptions = time_opts + setattr(over_write_opts, key, value) for member in members: multiverse.WriteOverrides(file_path, member, over_write_opts) @@ -131,9 +133,9 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): instance.data["representations"] = [] representation = { - 'name': 'usda', - 'ext': 'usda', - 'files': file_name, + "name": "usd", + "ext": "usd", + "files": file_name, "stagingDir": staging_dir } instance.data["representations"].append(representation) From 73e691f379765841bf2169b477a62e5eceaa2100 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 17:27:22 +0900 Subject: [PATCH 49/91] use cmds.listRelatives instead of mel at multiverse usd loader --- openpype/hosts/maya/plugins/load/load_multiverse_usd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index ce84c0baf8..5361f7a85b 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import maya.cmds as cmds -import maya.mel as mel from openpype.pipeline import ( load, @@ -44,7 +43,8 @@ class MultiverseUsdLoader(load.LoaderPlugin): with namespaced(namespace, new=False): import multiverse shape = multiverse.CreateUsdCompound(self.fname) - transform = mel.eval('firstParentOf "{}"'.format(shape)) + transform = cmds.listRelatives( + shape, parent=True, fullPath=True)[0] nodes = [transform, shape] self[:] = nodes From 7f18f94abce80194783d3d6032fa39ac834ef577 Mon Sep 17 00:00:00 2001 From: DMO Date: Thu, 24 Mar 2022 17:28:09 +0900 Subject: [PATCH 50/91] removing unused variables. --- .../hosts/maya/plugins/publish/extract_multiverse_usd_over.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index 9ee6f99de4..b26d6421fd 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -42,10 +42,6 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): @property def default_options(self): """The default options for Multiverse USD extraction.""" - start_frame = int(cmds.playbackOptions(query=True, - animationStartTime=True)) - end_frame = int(cmds.playbackOptions(query=True, - animationEndTime=True)) return { "writeAll": False, From e64797c4337c97b9119a7eaf704f806c09a46def Mon Sep 17 00:00:00 2001 From: DMO Date: Thu, 24 Mar 2022 17:43:43 +0900 Subject: [PATCH 51/91] switch do more readable options.items() --- .../hosts/maya/plugins/publish/extract_multiverse_usd_over.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index b26d6421fd..83d840d045 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -106,7 +106,6 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): time_opts.framePerSecond = fps over_write_opts = multiverse.OverridesWriteOptions(time_opts) - options_items = getattr(options, "iteritems", options.items) options_discard_keys = { "numTimeSamples", "timeSamplesSpan", @@ -117,7 +116,7 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): "step", "fps" } - for key, value in options_items(): + for key, value in options.items(): if key in options_discard_keys: continue setattr(over_write_opts, key, value) From 600a07237c8412468ce72e7d5951535acedc291b Mon Sep 17 00:00:00 2001 From: DMO Date: Thu, 24 Mar 2022 17:45:10 +0900 Subject: [PATCH 52/91] removed extra space. --- .../hosts/maya/plugins/publish/extract_multiverse_usd_over.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index 83d840d045..ce0e8a392a 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -116,7 +116,7 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): "step", "fps" } - for key, value in options.items(): + for key, value in options.items(): if key in options_discard_keys: continue setattr(over_write_opts, key, value) From ef832181e4e0a3e6f0e7e06f7d06e800ab17a79a Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 17:46:28 +0900 Subject: [PATCH 53/91] use py3 style to iterate options dict --- openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 2357690160..4e4efdc32c 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -178,7 +178,6 @@ class ExtractMultiverseUsd(openpype.api.Extractor): time_opts.framePerSecond = fps asset_write_opts = multiverse.AssetWriteOptions(time_opts) - options_items = getattr(options, "iteritems", options.items) options_discard_keys = { 'numTimeSamples', 'timeSamplesSpan', @@ -189,7 +188,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): 'step', 'fps' } - for key, value in options_items(): + for key, value in options.items(): if key in options_discard_keys: continue setattr(asset_write_opts, key, value) From 6ea037175a03db3efc022a42859120754f8a4b28 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 17:57:18 +0900 Subject: [PATCH 54/91] use set instead of list for discard option keys from multiverse composition extractor --- .../hosts/maya/plugins/publish/extract_multiverse_usd_comp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py index 8a26379313..8fccc412e6 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -119,7 +119,7 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): time_opts.framePerSecond = fps comp_write_opts = multiverse.CompositionWriteOptions() - options_discard_keys = [ + options_discard_keys = { 'numTimeSamples', 'timeSamplesSpan', 'frameStart', @@ -128,7 +128,7 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): 'handleEnd', 'step', 'fps' - ] + } for key, value in options.items(): if key in options_discard_keys: continue From 4767bd7f5e75102cea504cc7b66600430bf1420b Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 15:41:04 +0100 Subject: [PATCH 55/91] fix import in tray publisher --- .../hosts/traypublisher/plugins/create/create_workfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/traypublisher/plugins/create/create_workfile.py b/openpype/hosts/traypublisher/plugins/create/create_workfile.py index 2db4770bbc..5e0af350f0 100644 --- a/openpype/hosts/traypublisher/plugins/create/create_workfile.py +++ b/openpype/hosts/traypublisher/plugins/create/create_workfile.py @@ -1,8 +1,8 @@ from openpype.hosts.traypublisher.api import pipeline +from openpype.lib import FileDef from openpype.pipeline import ( Creator, - CreatedInstance, - lib + CreatedInstance ) @@ -80,7 +80,7 @@ class WorkfileCreator(Creator): def get_instance_attr_defs(self): output = [ - lib.FileDef( + FileDef( "filepath", folders=False, extensions=self.extensions, From abf26fcaa47e067e4437bc2c11ac35bd1508e417 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 15:41:18 +0100 Subject: [PATCH 56/91] changed Name to Variant in creator dialog --- openpype/tools/publisher/widgets/create_dialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/tools/publisher/widgets/create_dialog.py b/openpype/tools/publisher/widgets/create_dialog.py index 27ce97955a..7d98609c2c 100644 --- a/openpype/tools/publisher/widgets/create_dialog.py +++ b/openpype/tools/publisher/widgets/create_dialog.py @@ -271,7 +271,7 @@ class CreateDialog(QtWidgets.QDialog): create_btn.setEnabled(False) form_layout = QtWidgets.QFormLayout() - form_layout.addRow("Name:", variant_layout) + form_layout.addRow("Variant:", variant_layout) form_layout.addRow("Subset:", subset_name_input) mid_widget = QtWidgets.QWidget(self) From db66fe98fd0fc7bfdc9096a0e40fc380f8479aa4 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 15:41:43 +0100 Subject: [PATCH 57/91] fixed typo --- openpype/modules/log_viewer/tray/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/modules/log_viewer/tray/app.py b/openpype/modules/log_viewer/tray/app.py index 71827fcac9..def319e0e3 100644 --- a/openpype/modules/log_viewer/tray/app.py +++ b/openpype/modules/log_viewer/tray/app.py @@ -27,11 +27,11 @@ class LogsWindow(QtWidgets.QWidget): self.setStyleSheet(style.load_stylesheet()) - self._frist_show = True + self._first_show = True def showEvent(self, event): super(LogsWindow, self).showEvent(event) - if self._frist_show: - self._frist_show = False + if self._first_show: + self._first_show = False self.logs_widget.refresh() From 57feaee44b8bff1eb7156b25bad70c978b715fec Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 15:44:50 +0100 Subject: [PATCH 58/91] added informative logs about not found icons --- openpype/tools/utils/lib.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openpype/tools/utils/lib.py b/openpype/tools/utils/lib.py index 93b156bef8..f4ba2106f2 100644 --- a/openpype/tools/utils/lib.py +++ b/openpype/tools/utils/lib.py @@ -17,6 +17,8 @@ from openpype.lib import filter_profiles from openpype.style import get_objected_colors from openpype.resources import get_image_path +log = Logger.get_logger(__name__) + def center_window(window): """Move window to center of it's screen.""" @@ -111,13 +113,23 @@ def get_qta_icon_by_name_and_color(icon_name, icon_color): variants.append("{0}.{1}".format(key, icon_name)) icon = None + used_variant = None for variant in variants: try: icon = qtawesome.icon(variant, color=icon_color) + used_variant = variant break except Exception: pass + if used_variant is None: + log.info("Didn't find icon \"{}\"".format(icon_name)) + + elif used_variant != icon_name: + log.info("Icon \"{}\" was not found \"{}\" is used instead".format( + icon_name, used_variant + )) + SharedObjects.icons[full_icon_name] = icon return icon From d772236278b643e748e446db35b4200eb4b9eb48 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 16:07:11 +0100 Subject: [PATCH 59/91] changed info log level to debug --- openpype/tools/utils/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/tools/utils/lib.py b/openpype/tools/utils/lib.py index f4ba2106f2..d069088932 100644 --- a/openpype/tools/utils/lib.py +++ b/openpype/tools/utils/lib.py @@ -126,7 +126,7 @@ def get_qta_icon_by_name_and_color(icon_name, icon_color): log.info("Didn't find icon \"{}\"".format(icon_name)) elif used_variant != icon_name: - log.info("Icon \"{}\" was not found \"{}\" is used instead".format( + log.debug("Icon \"{}\" was not found \"{}\" is used instead".format( icon_name, used_variant )) From 1c775b382fdb9d864e97bcfb557d2d2ad2383799 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 16:24:40 +0100 Subject: [PATCH 60/91] use explicit icon names for asset --- openpype/tools/utils/lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/tools/utils/lib.py b/openpype/tools/utils/lib.py index d069088932..422d0f5389 100644 --- a/openpype/tools/utils/lib.py +++ b/openpype/tools/utils/lib.py @@ -152,8 +152,8 @@ def get_asset_icon_name(asset_doc, has_children=True): return icon_name if has_children: - return "folder" - return "folder-o" + return "fa.folder" + return "fa.folder-o" def get_asset_icon_color(asset_doc): From 9ae5474a929bba3553af854fef332ef623600133 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 16:47:37 +0100 Subject: [PATCH 61/91] fix drop files in files widget --- openpype/widgets/attribute_defs/files_widget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/widgets/attribute_defs/files_widget.py b/openpype/widgets/attribute_defs/files_widget.py index 87b98e2378..34f7d159ad 100644 --- a/openpype/widgets/attribute_defs/files_widget.py +++ b/openpype/widgets/attribute_defs/files_widget.py @@ -641,5 +641,6 @@ class SingleFileWidget(QtWidgets.QWidget): filepaths.append(filepath) # TODO filter check if len(filepaths) == 1: - self.set_value(filepaths[0], False) + self._filepath_input.setText(filepaths[0]) + event.accept() From 3534e9c448f30bc8c04f8bfce0837fb5f5ea80f6 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 24 Mar 2022 17:17:38 +0100 Subject: [PATCH 62/91] Fix plugin label --- .../hosts/traypublisher/plugins/publish/validate_workfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/traypublisher/plugins/publish/validate_workfile.py b/openpype/hosts/traypublisher/plugins/publish/validate_workfile.py index 88339d2aac..e8eeb46065 100644 --- a/openpype/hosts/traypublisher/plugins/publish/validate_workfile.py +++ b/openpype/hosts/traypublisher/plugins/publish/validate_workfile.py @@ -6,7 +6,7 @@ from openpype.pipeline import PublishValidationError class ValidateWorkfilePath(pyblish.api.InstancePlugin): """Validate existence of workfile instance existence.""" - label = "Collect Workfile" + label = "Validate Workfile" order = pyblish.api.ValidatorOrder - 0.49 families = ["workfile"] hosts = ["traypublisher"] From bb8bd9042778ad4293682993832242cb8b57e200 Mon Sep 17 00:00:00 2001 From: DMO Date: Fri, 25 Mar 2022 11:08:53 +0900 Subject: [PATCH 63/91] add the animation data first to maintain order. --- .../hosts/maya/plugins/create/create_multiverse_usd.py | 7 +++---- .../maya/plugins/create/create_multiverse_usd_comp.py | 7 +++---- .../maya/plugins/create/create_multiverse_usd_over.py | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py index c06c764f95..b2266e5a57 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd.py @@ -12,6 +12,9 @@ class CreateMultiverseUsd(plugin.Creator): def __init__(self, *args, **kwargs): super(CreateMultiverseUsd, self).__init__(*args, **kwargs) + # Add animation data first, since it maintains order. + self.data.update(lib.collect_animation_data(True)) + self.data["stripNamespaces"] = False self.data["mergeTransformAndShape"] = False self.data["writeAncestors"] = True @@ -46,7 +49,3 @@ class CreateMultiverseUsd(plugin.Creator): self.data["customMaterialNamespace"] = '' self.data["numTimeSamples"] = 1 self.data["timeSamplesSpan"] = 0.0 - - # Add animation data - animation_data = lib.collect_animation_data(True) - self.data.update(animation_data) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py index 56b8721ce0..77b808c459 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_comp.py @@ -12,13 +12,12 @@ class CreateMultiverseUsdComp(plugin.Creator): def __init__(self, *args, **kwargs): super(CreateMultiverseUsdComp, self).__init__(*args, **kwargs) + # Add animation data first, since it maintains order. + self.data.update(lib.collect_animation_data(True)) + self.data["stripNamespaces"] = False self.data["mergeTransformAndShape"] = False self.data["flattenContent"] = False self.data["writePendingOverrides"] = False self.data["numTimeSamples"] = 1 self.data["timeSamplesSpan"] = 0.0 - - # Add animation data - animation_data = lib.collect_animation_data(True) - self.data.update(animation_data) diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py index 9ccf2e45fc..bb82ab2039 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_usd_over.py @@ -12,6 +12,9 @@ class CreateMultiverseUsdOver(plugin.Creator): def __init__(self, *args, **kwargs): super(CreateMultiverseUsdOver, self).__init__(*args, **kwargs) + # Add animation data first, since it maintains order. + self.data.update(lib.collect_animation_data(True)) + self.data["writeAll"] = False self.data["writeTransforms"] = True self.data["writeVisibility"] = True @@ -23,7 +26,3 @@ class CreateMultiverseUsdOver(plugin.Creator): self.data["writeNamespaces"] = False self.data["numTimeSamples"] = 1 self.data["timeSamplesSpan"] = 0.0 - - # Add animation data - animation_data = lib.collect_animation_data(True) - self.data.update(animation_data) From 5adf3966106f528bdfc38ccc2f7d1a1171efcb5b Mon Sep 17 00:00:00 2001 From: DMO Date: Fri, 25 Mar 2022 18:07:07 +0900 Subject: [PATCH 64/91] Adding "pointcache" & "animation" to the list of families, since it's supported. --- openpype/hosts/maya/plugins/load/load_multiverse_usd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index 5361f7a85b..eafad535eb 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -16,7 +16,8 @@ from openpype.hosts.maya.api.pipeline import containerise class MultiverseUsdLoader(load.LoaderPlugin): """Load the USD by Multiverse""" - families = ["model", "usd", "usdComposition", "usdOverride"] + families = ["model", "usd", "usdComposition", "usdOverride", + "pointcache", "animation"] representations = ["usd", "usda", "usdc", "usdz", "abc"] label = "Read USD by Multiverse" From deedc893bf82248149e652422270c27c16518ac8 Mon Sep 17 00:00:00 2001 From: DMO Date: Fri, 25 Mar 2022 18:07:28 +0900 Subject: [PATCH 65/91] Lock the shape after creating to avoid deletion. --- openpype/hosts/maya/plugins/load/load_multiverse_usd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py index eafad535eb..c03f2c5d92 100644 --- a/openpype/hosts/maya/plugins/load/load_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/load/load_multiverse_usd.py @@ -47,6 +47,9 @@ class MultiverseUsdLoader(load.LoaderPlugin): transform = cmds.listRelatives( shape, parent=True, fullPath=True)[0] + # Lock the shape node so the user cannot delete it. + cmds.lockNode(shape, lock=True) + nodes = [transform, shape] self[:] = nodes From dc86a0d2bc452546e9f99662090c78321222c0ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Mar 2022 01:37:37 +0000 Subject: [PATCH 66/91] Bump node-forge from 1.2.1 to 1.3.0 in /website Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.2.1 to 1.3.0. - [Release notes](https://github.com/digitalbazaar/forge/releases) - [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md) - [Commits](https://github.com/digitalbazaar/forge/compare/v1.2.1...v1.3.0) --- updated-dependencies: - dependency-name: node-forge dependency-type: indirect ... Signed-off-by: dependabot[bot] --- website/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index 7f677aaed7..0dd96f63ba 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -5207,9 +5207,9 @@ node-fetch@2.6.7: whatwg-url "^5.0.0" node-forge@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.2.1.tgz#82794919071ef2eb5c509293325cec8afd0fd53c" - integrity sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w== + version "1.3.0" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.0.tgz#37a874ea723855f37db091e6c186e5b67a01d4b2" + integrity sha512-08ARB91bUi6zNKzVmaj3QO7cr397uiDT2nJ63cHjyNtCTWIgvS47j3eT0WfzUwS9+6Z5YshRaoasFkXCKrIYbA== node-releases@^2.0.1: version "2.0.2" From 4a68b1b00aa6c3c3476e97cd99badec073967799 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Mar 2022 03:37:21 +0000 Subject: [PATCH 67/91] Bump minimist from 1.2.5 to 1.2.6 in /website Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] --- website/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index 7f677aaed7..ed416a5cc4 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -5125,9 +5125,9 @@ minimatch@^3.0.4: brace-expansion "^1.1.7" minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== mkdirp@^0.5.5: version "0.5.5" From 9b097d40e2d3a9830d9fa49bd587d5b363ae8be2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Mon, 28 Mar 2022 12:10:36 +0200 Subject: [PATCH 68/91] create a sequence output when converting sequence --- openpype/lib/transcoding.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openpype/lib/transcoding.py b/openpype/lib/transcoding.py index 6bab6a8160..8e79aba0ae 100644 --- a/openpype/lib/transcoding.py +++ b/openpype/lib/transcoding.py @@ -478,8 +478,14 @@ def convert_for_ffmpeg( oiio_cmd.extend(["--eraseattrib", attr_name]) # Add last argument - path to output - base_file_name = os.path.basename(first_input_path) - output_path = os.path.join(output_dir, base_file_name) + if is_sequence: + ext = os.path.splitext(first_input_path)[1] + base_filename = "tmp.%{:0>2}d{}".format( + len(str(input_frame_end)), ext + ) + else: + base_filename = os.path.basename(first_input_path) + output_path = os.path.join(output_dir, base_filename) oiio_cmd.extend([ "-o", output_path ]) From 719b184d8085e6cea54cdae06c12fcf19ac5d5e4 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 29 Mar 2022 10:12:37 +0200 Subject: [PATCH 69/91] Added default for review_upload_limit for Slack --- openpype/settings/defaults/project_settings/slack.json | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/settings/defaults/project_settings/slack.json b/openpype/settings/defaults/project_settings/slack.json index d77b8c2208..c156fed08e 100644 --- a/openpype/settings/defaults/project_settings/slack.json +++ b/openpype/settings/defaults/project_settings/slack.json @@ -11,6 +11,7 @@ "task_types": [], "tasks": [], "subsets": [], + "review_upload_limit": 50.0, "channel_messages": [] } ] From 000461243200f36d654a639c12d35314007878da Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 11:25:57 +0200 Subject: [PATCH 70/91] added settings of template name into hero integrator --- .../defaults/project_settings/global.json | 30 +++--- .../schemas/schema_global_publish.json | 100 +++++++++++++----- 2 files changed, 90 insertions(+), 40 deletions(-) diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index 30a71b044a..24334b0045 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -33,20 +33,6 @@ "enabled": false, "profiles": [] }, - "IntegrateHeroVersion": { - "enabled": true, - "optional": true, - "families": [ - "model", - "rig", - "look", - "pointcache", - "animation", - "setdress", - "layout", - "mayaScene" - ] - }, "ExtractJpegEXR": { "enabled": true, "ffmpeg_args": { @@ -204,6 +190,22 @@ } ] }, + "IntegrateHeroVersion": { + "enabled": true, + "optional": true, + "active": true, + "families": [ + "model", + "rig", + "look", + "pointcache", + "animation", + "setdress", + "layout", + "mayaScene" + ], + "template_name_profiles": [] + }, "CleanUp": { "paterns": [], "remove_temp_renders": false diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json index 12043d4205..061874e31c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json @@ -122,32 +122,6 @@ } ] }, - { - "type": "dict", - "collapsible": true, - "checkbox_key": "enabled", - "key": "IntegrateHeroVersion", - "label": "IntegrateHeroVersion", - "is_group": true, - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "optional", - "label": "Optional" - }, - { - "key": "families", - "label": "Families", - "type": "list", - "object_type": "text" - } - ] - }, { "type": "dict", "collapsible": true, @@ -652,6 +626,80 @@ } ] }, + { + "type": "dict", + "collapsible": true, + "checkbox_key": "enabled", + "key": "IntegrateHeroVersion", + "label": "IntegrateHeroVersion", + "is_group": true, + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "optional", + "label": "Optional" + }, + { + "type": "boolean", + "key": "active", + "label": "Active" + }, + { + "key": "families", + "label": "Families", + "type": "list", + "object_type": "text" + }, + { + "type": "list", + "key": "template_name_profiles", + "label": "Template name profiles", + "use_label_wrap": true, + "object_type": { + "type": "dict", + "children": [ + { + "key": "families", + "label": "Families", + "type": "list", + "object_type": "text" + }, + { + "type": "hosts-enum", + "key": "hosts", + "label": "Hosts", + "multiselection": true + }, + { + "key": "task_types", + "label": "Task types", + "type": "task-types-enum" + }, + { + "key": "task_names", + "label": "Task names", + "type": "list", + "object_type": "text" + }, + { + "type": "separator" + }, + { + "type": "text", + "key": "template_name", + "label": "Template name", + "tooltip": "Name of template from Anatomy templates" + } + ] + } + } + ] + }, { "type": "dict", "collapsible": true, From 160247ab61d6c3e1a1e6eeab042a58d9d1b0933b Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 11:26:29 +0200 Subject: [PATCH 71/91] remove unused template color --- .../schemas/template_color.json | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 openpype/settings/entities/schemas/projects_schema/schemas/template_color.json diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_color.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_color.json deleted file mode 100644 index af8fd9dae4..0000000000 --- a/openpype/settings/entities/schemas/projects_schema/schemas/template_color.json +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "type": "list-strict", - "key": "{name}", - "label": "{label}", - "object_types": [ - { - "label": "Red", - "type": "number", - "minimum": 0, - "maximum": 1, - "decimal": 3 - }, - { - "label": "Green", - "type": "number", - "minimum": 0, - "maximum": 1, - "decimal": 3 - }, - { - "label": "Blue", - "type": "number", - "minimum": 0, - "maximum": 1, - "decimal": 3 - } - ] - } -] From 0114bbd965ec0975d179faf8d8f854b5a82004c5 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 12:17:50 +0200 Subject: [PATCH 72/91] use new settings to define which template is used for her opublishing --- .../plugins/publish/integrate_hero_version.py | 105 ++++++++++++------ 1 file changed, 70 insertions(+), 35 deletions(-) diff --git a/openpype/plugins/publish/integrate_hero_version.py b/openpype/plugins/publish/integrate_hero_version.py index 466606d08b..9a50257a8b 100644 --- a/openpype/plugins/publish/integrate_hero_version.py +++ b/openpype/plugins/publish/integrate_hero_version.py @@ -7,8 +7,12 @@ import shutil from bson.objectid import ObjectId from pymongo import InsertOne, ReplaceOne import pyblish.api + from avalon import api, io, schema -from openpype.lib import create_hard_link +from openpype.lib import ( + create_hard_link, + filter_profiles +) class IntegrateHeroVersion(pyblish.api.InstancePlugin): @@ -17,7 +21,9 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): order = pyblish.api.IntegratorOrder + 0.1 optional = True + active = True + # Families are modified using settings families = [ "model", "rig", @@ -33,11 +39,13 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): "project", "asset", "task", "subset", "representation", "family", "hierarchy", "task", "username" ] - # TODO add family filtering # QUESTION/TODO this process should happen on server if crashed due to # permissions error on files (files were used or user didn't have perms) # *but all other plugins must be sucessfully completed + template_name_profiles = [] + _default_template_name = "hero" + def process(self, instance): self.log.debug( "--- Integration of Hero version for subset `{}` begins.".format( @@ -51,26 +59,34 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): ) return - project_name = api.Session["AVALON_PROJECT"] + template_key = self._get_template_key(instance) - # TODO raise error if Hero not set? anatomy = instance.context.data["anatomy"] - if "hero" not in anatomy.templates: - self.log.warning("!!! Anatomy does not have set `hero` key!") - return - - if "path" not in anatomy.templates["hero"]: + project_name = api.Session["AVALON_PROJECT"] + if template_key not in anatomy.templates: self.log.warning(( - "!!! There is not set `path` template in `hero` anatomy" - " for project \"{}\"." - ).format(project_name)) + "!!! Anatomy of project \"{}\" does not have set" + " \"{}\" template key!" + ).format(project_name, template_key)) return - hero_template = anatomy.templates["hero"]["path"] + if "path" not in anatomy.templates[template_key]: + self.log.warning(( + "!!! There is not set \"path\" template in \"{}\" anatomy" + " for project \"{}\"." + ).format(template_key, project_name)) + return + + hero_template = anatomy.templates[template_key]["path"] self.log.debug("`hero` template check was successful. `{}`".format( hero_template )) + self.process_instance(instance, template_key, hero_template) + + def process_instance(self, instance, template_key, hero_template): + anatomy = instance.context.data["anatomy"] + published_repres = instance.data["published_representations"] hero_publish_dir = self.get_publish_dir(instance) src_version_entity = instance.data.get("versionEntity") @@ -271,12 +287,12 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): continue # Prepare anatomy data - anatomy_data = repre_info["anatomy_data"] + anatomy_data = copy.deepcopy(repre_info["anatomy_data"]) anatomy_data.pop("version", None) # Get filled path to repre context anatomy_filled = anatomy.format(anatomy_data) - template_filled = anatomy_filled["hero"]["path"] + template_filled = anatomy_filled[template_key]["path"] repre_data = { "path": str(template_filled), @@ -308,11 +324,11 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): collections, remainders = clique.assemble(published_files) if remainders or not collections or len(collections) > 1: raise Exception(( - "Integrity error. Files of published representation " - "is combination of frame collections and single files." - "Collections: `{}` Single files: `{}`" - ).format(str(collections), - str(remainders))) + "Integrity error. Files of published" + " representation is combination of frame" + " collections and single files. Collections:" + " `{}` Single files: `{}`" + ).format(str(collections), str(remainders))) src_col = collections[0] @@ -320,7 +336,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): frame_splitter = "_-_FRAME_SPLIT_-_" anatomy_data["frame"] = frame_splitter _anatomy_filled = anatomy.format(anatomy_data) - _template_filled = _anatomy_filled["hero"]["path"] + _template_filled = _anatomy_filled[template_key]["path"] head, tail = _template_filled.split(frame_splitter) padding = int( anatomy.templates["render"].get( @@ -466,13 +482,13 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): files.append(_path) return files - def get_publish_dir(self, instance): + def get_publish_dir(self, instance, template_key): anatomy = instance.context.data["anatomy"] template_data = copy.deepcopy(instance.data["anatomyData"]) - if "folder" in anatomy.templates["hero"]: + if "folder" in anatomy.templates[template_key]: anatomy_filled = anatomy.format(template_data) - publish_folder = anatomy_filled["hero"]["folder"] + publish_folder = anatomy_filled[template_key]["folder"] else: # This is for cases of Deprecated anatomy without `folder` # TODO remove when all clients have solved this issue @@ -489,7 +505,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): " key underneath `publish` (in global of for project `{}`)." ).format(project_name)) - file_path = anatomy_filled["hero"]["path"] + file_path = anatomy_filled[template_key]["path"] # Directory publish_folder = os.path.dirname(file_path) @@ -499,6 +515,31 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): return publish_folder + def _get_template_key(self, instance): + anatomy_data = instance.data["anatomyData"] + task_data = anatomy_data.get("task") or {} + task_name = task_data.get("name") + task_type = task_data.get("type") + host_name = instance.context.data["hostName"] + # TODO raise error if Hero not set? + family = self.main_family_from_instance(instance) + key_values = { + "families": family, + "task_names": task_name, + "task_types": task_type, + "hosts": host_name + } + profile = filter_profiles( + self.template_name_profiles, + key_values, + logger=self.log + ) + if profile: + template_name = profile["template_name"] + else: + template_name = self._default_template_name + return template_name + def copy_file(self, src_path, dst_path): # TODO check drives if are the same to check if cas hardlink dirname = os.path.dirname(dst_path) @@ -564,22 +605,16 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): src_file (string) - original file path dst_file (string) - hero file path """ - _, rootless = anatomy.find_root_template_from_path( - dst_file - ) - _, rtls_src = anatomy.find_root_template_from_path( - src_file - ) + _, rootless = anatomy.find_root_template_from_path(dst_file) + _, rtls_src = anatomy.find_root_template_from_path(src_file) return path.replace(rtls_src, rootless) def _update_hash(self, hash, src_file_name, dst_file): """ Updates hash value with proper hero name """ - src_file_name = self._get_name_without_ext( - src_file_name) - hero_file_name = self._get_name_without_ext( - dst_file) + src_file_name = self._get_name_without_ext(src_file_name) + hero_file_name = self._get_name_without_ext(dst_file) return hash.replace(src_file_name, hero_file_name) def _get_name_without_ext(self, value): From 952717440d550ed602b424b3a4f43a5aaa01f350 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 13:46:38 +0200 Subject: [PATCH 73/91] bug fixes and implementing missing method --- openpype/plugins/publish/integrate_hero_version.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/openpype/plugins/publish/integrate_hero_version.py b/openpype/plugins/publish/integrate_hero_version.py index 9a50257a8b..67c91634d2 100644 --- a/openpype/plugins/publish/integrate_hero_version.py +++ b/openpype/plugins/publish/integrate_hero_version.py @@ -82,12 +82,12 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): hero_template )) - self.process_instance(instance, template_key, hero_template) + self.integrate_instance(instance, template_key, hero_template) - def process_instance(self, instance, template_key, hero_template): + def integrate_instance(self, instance, template_key, hero_template): anatomy = instance.context.data["anatomy"] published_repres = instance.data["published_representations"] - hero_publish_dir = self.get_publish_dir(instance) + hero_publish_dir = self.get_publish_dir(instance, template_key) src_version_entity = instance.data.get("versionEntity") filtered_repre_ids = [] @@ -540,6 +540,13 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): template_name = self._default_template_name return template_name + def main_family_from_instance(self, instance): + """Returns main family of entered instance.""" + family = instance.data.get("family") + if not family: + family = instance.data["families"][0] + return family + def copy_file(self, src_path, dst_path): # TODO check drives if are the same to check if cas hardlink dirname = os.path.dirname(dst_path) From 059020cabd21cf656bceadf76d63ab719ff59a58 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 13:53:22 +0200 Subject: [PATCH 74/91] change frame padding access --- openpype/plugins/publish/integrate_hero_version.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openpype/plugins/publish/integrate_hero_version.py b/openpype/plugins/publish/integrate_hero_version.py index 67c91634d2..d50f2a4712 100644 --- a/openpype/plugins/publish/integrate_hero_version.py +++ b/openpype/plugins/publish/integrate_hero_version.py @@ -339,10 +339,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): _template_filled = _anatomy_filled[template_key]["path"] head, tail = _template_filled.split(frame_splitter) padding = int( - anatomy.templates["render"].get( - "frame_padding", - anatomy.templates["render"].get("padding") - ) + anatomy.templates[template_key]["frame_padding"] ) dst_col = clique.Collection( From e76c317d7700d0950e323a69ae33650889815543 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 13:56:28 +0200 Subject: [PATCH 75/91] remove her publish dir on error before renaming it back --- openpype/plugins/publish/integrate_hero_version.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/plugins/publish/integrate_hero_version.py b/openpype/plugins/publish/integrate_hero_version.py index d50f2a4712..d6df6535d8 100644 --- a/openpype/plugins/publish/integrate_hero_version.py +++ b/openpype/plugins/publish/integrate_hero_version.py @@ -457,6 +457,8 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): backup_hero_publish_dir is not None and os.path.exists(backup_hero_publish_dir) ): + if os.path.exists(hero_publish_dir): + shutil.rmtree(hero_publish_dir) os.rename(backup_hero_publish_dir, hero_publish_dir) self.log.error(( "!!! Creating of hero version failed." From 505d73145c34a3379dae4e699f1d3b825ce0567c Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 18:11:14 +0200 Subject: [PATCH 76/91] enhanced tool settings to have also filters --- .../defaults/system_settings/tools.json | 12 +++++++-- .../schemas/system_schema/schema_tools.json | 25 ++++++++++++++++++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/openpype/settings/defaults/system_settings/tools.json b/openpype/settings/defaults/system_settings/tools.json index 181236abe8..9e08465195 100644 --- a/openpype/settings/defaults/system_settings/tools.json +++ b/openpype/settings/defaults/system_settings/tools.json @@ -25,10 +25,18 @@ }, "variants": { "3-2": { - "MTOA_VERSION": "3.2" + "host_names": [], + "app_variants": [], + "environment": { + "MTOA_VERSION": "3.2" + } }, "3-1": { - "MTOA_VERSION": "3.1" + "host_names": [], + "app_variants": [], + "environment": { + "MTOA_VERSION": "3.1" + } }, "__dynamic_keys_labels__": { "3-2": "3.2", diff --git a/openpype/settings/entities/schemas/system_schema/schema_tools.json b/openpype/settings/entities/schemas/system_schema/schema_tools.json index 2346bef36d..7962fdd465 100644 --- a/openpype/settings/entities/schemas/system_schema/schema_tools.json +++ b/openpype/settings/entities/schemas/system_schema/schema_tools.json @@ -25,7 +25,30 @@ "key": "variants", "collapsible_key": true, "object_type": { - "type": "raw-json" + "type": "dict", + "children": [ + { + "key": "host_names", + "label": "Hosts", + "type": "hosts-enum", + "multiselection": true + }, + { + "key": "app_variants", + "label": "Applications", + "type": "apps-enum", + "multiselection": true, + "tooltip": "Applications are not \"live\" and may require to Save and refresh settings UI to update values." + }, + { + "type": "separator" + }, + { + "key": "environment", + "label": "Environments", + "type": "raw-json" + } + ] } } ] From 3fd989671acb44e9df400be7217243bd12d23ae2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 18:11:59 +0200 Subject: [PATCH 77/91] added backwards compatibility of tools right into settings lib function --- openpype/settings/lib.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/openpype/settings/lib.py b/openpype/settings/lib.py index 1d303564d5..54502292dc 100644 --- a/openpype/settings/lib.py +++ b/openpype/settings/lib.py @@ -265,11 +265,43 @@ def save_project_anatomy(project_name, anatomy_data): raise SaveWarningExc(warnings) +def _system_settings_backwards_compatible_conversion(studio_overrides): + # Backwards compatibility of tools 3.9.1 - 3.9.2 to keep + # "tools" environments + if ( + "tools" in studio_overrides + and "tool_groups" in studio_overrides["tools"] + ): + tool_groups = studio_overrides["tools"]["tool_groups"] + for tool_group, group_value in tool_groups.items(): + if tool_group in METADATA_KEYS: + continue + + variants = group_value.get("variants") + if not variants: + continue + + for key in set(variants.keys()): + if key in METADATA_KEYS: + continue + + variant_value = variants[key] + if "environment" not in variant_value: + variants[key] = { + "environment": variant_value + } + + @require_handler def get_studio_system_settings_overrides(return_version=False): - return _SETTINGS_HANDLER.get_studio_system_settings_overrides( + output = _SETTINGS_HANDLER.get_studio_system_settings_overrides( return_version ) + value = output + if return_version: + value, version = output + _system_settings_backwards_compatible_conversion(value) + return output @require_handler From b3463afa38d2ed80c3ccffe8f3f757ace44955ef Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 18:14:09 +0200 Subject: [PATCH 78/91] load settings data in EnvironmentTool with backwards comatible way --- openpype/lib/applications.py | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/openpype/lib/applications.py b/openpype/lib/applications.py index ad59ae0dbc..e415120ac4 100644 --- a/openpype/lib/applications.py +++ b/openpype/lib/applications.py @@ -211,6 +211,7 @@ class ApplicationGroup: data (dict): Group defying data loaded from settings. manager (ApplicationManager): Manager that created the group. """ + def __init__(self, name, data, manager): self.name = name self.manager = manager @@ -374,6 +375,7 @@ class ApplicationManager: will always use these values. Gives ability to create manager using different settings. """ + def __init__(self, system_settings=None): self.log = PypeLogger.get_logger(self.__class__.__name__) @@ -530,13 +532,13 @@ class EnvironmentToolGroup: variants = data.get("variants") or {} label_by_key = variants.pop(M_DYNAMIC_KEY_LABEL, {}) variants_by_name = {} - for variant_name, variant_env in variants.items(): + for variant_name, variant_data in variants.items(): if variant_name in METADATA_KEYS: continue variant_label = label_by_key.get(variant_name) or variant_name tool = EnvironmentTool( - variant_name, variant_label, variant_env, self + variant_name, variant_label, variant_data, self ) variants_by_name[variant_name] = tool self.variants = variants_by_name @@ -560,15 +562,35 @@ class EnvironmentTool: Args: name (str): Name of the tool. - environment (dict): Variant environments. + variant_data (dict): Variant data with environments and + host and app variant filters. group (str): Name of group which wraps tool. """ - def __init__(self, name, label, environment, group): + def __init__(self, name, label, variant_data, group): + # Backwards compatibility 3.9.1 - 3.9.2 + # - 'variant_data' contained only environments but contain also host + # and application variant filters + host_names = [] + app_variants = [] + if "host_names" in variant_data: + host_names = variant_data["host_names"] + + if "app_variants" in variant_data: + app_variants = variant_data["app_variants"] + + if "environment" in variant_data: + environment = variant_data["environemnt"] + else: + environment = variant_data + + self.host_names = host_names + self.app_variants = app_variants self.name = name self.variant_label = label self.label = " ".join((group.label, label)) self.group = group + self._environment = environment self.full_name = "/".join((group.name, name)) From 39f84f8dfdb4f2ec7f369acf3b2e80971befea70 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 18:14:24 +0200 Subject: [PATCH 79/91] added option to validate if tool is valid for application --- openpype/lib/applications.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openpype/lib/applications.py b/openpype/lib/applications.py index e415120ac4..176a9a2391 100644 --- a/openpype/lib/applications.py +++ b/openpype/lib/applications.py @@ -601,6 +601,19 @@ class EnvironmentTool: def environment(self): return copy.deepcopy(self._environment) + def is_valid_for_app(self, app): + """Is tool valid for application. + + Args: + app (Application): Application for which are prepared environments. + """ + if self.app_variants and app.full_name not in self.app_variants: + return False + + if self.host_names and app.host_name not in self.host_names: + return False + return True + class ApplicationExecutable: """Representation of executable loaded from settings.""" @@ -1406,7 +1419,7 @@ def prepare_app_environments(data, env_group=None, implementation_envs=True): # Make sure each tool group can be added only once for key in asset_doc["data"].get("tools_env") or []: tool = app.manager.tools.get(key) - if not tool: + if not tool or not tool.is_valid_for_app(app): continue groups_by_name[tool.group.name] = tool.group tool_by_group_name[tool.group.name][tool.name] = tool From 3bda53a54138b9e211f1d88d0e7e01a48fef9ac7 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 29 Mar 2022 18:21:10 +0200 Subject: [PATCH 80/91] fix typo --- openpype/lib/applications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/lib/applications.py b/openpype/lib/applications.py index 176a9a2391..b496bd74e2 100644 --- a/openpype/lib/applications.py +++ b/openpype/lib/applications.py @@ -580,7 +580,7 @@ class EnvironmentTool: app_variants = variant_data["app_variants"] if "environment" in variant_data: - environment = variant_data["environemnt"] + environment = variant_data["environment"] else: environment = variant_data From d26143198c59619a879ace67930f05cd0b792f61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 22:21:09 +0000 Subject: [PATCH 81/91] Bump paramiko from 2.9.2 to 2.10.1 Bumps [paramiko](https://github.com/paramiko/paramiko) from 2.9.2 to 2.10.1. - [Release notes](https://github.com/paramiko/paramiko/releases) - [Changelog](https://github.com/paramiko/paramiko/blob/main/NEWS) - [Commits](https://github.com/paramiko/paramiko/compare/2.9.2...2.10.1) --- updated-dependencies: - dependency-name: paramiko dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 84 ++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/poetry.lock b/poetry.lock index ed2b0dd3c2..7998ede693 100644 --- a/poetry.lock +++ b/poetry.lock @@ -680,15 +680,8 @@ category = "main" optional = false python-versions = "*" -[package.dependencies] -attrs = ">=17.4.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} -pyrsistent = ">=0.14.0" -six = ">=1.11.0" - [package.extras] -format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"] -format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"] +format = ["rfc3987", "strict-rfc3339", "webcolors"] [[package]] name = "keyring" @@ -784,7 +777,7 @@ pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" [[package]] name = "paramiko" -version = "2.9.2" +version = "2.10.1" description = "SSH2 protocol library" category = "main" optional = false @@ -794,6 +787,7 @@ python-versions = "*" bcrypt = ">=3.1.3" cryptography = ">=2.5" pynacl = ">=1.0.1" +six = "*" [package.extras] all = ["pyasn1 (>=0.1.7)", "pynacl (>=1.0.1)", "bcrypt (>=3.1.3)", "invoke (>=1.3)", "gssapi (>=1.4.1)", "pywin32 (>=2.1.8)"] @@ -1087,14 +1081,6 @@ category = "main" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -[[package]] -name = "pyrsistent" -version = "0.18.1" -description = "Persistent/Functional/Immutable data structures" -category = "main" -optional = false -python-versions = ">=3.7" - [[package]] name = "pysftp" version = "0.2.9" @@ -1633,7 +1619,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = "3.7.*" -content-hash = "2f78d48a6aad2d8a88b7dd7f31a76d907bec9fb65f0086fba6b6d2e1605f0f88" +content-hash = "b02313c8255a1897b0f0617ad4884a5943696c363512921aab1cb2dd8f4fdbe0" [metadata.files] acre = [] @@ -2171,12 +2157,28 @@ log4mongo = [ {file = "log4mongo-1.7.0.tar.gz", hash = "sha256:dc374617206162a0b14167fbb5feac01dbef587539a235dadba6200362984a68"}, ] markupsafe = [ + {file = "MarkupSafe-2.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-win32.whl", hash = "sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-win32.whl", hash = "sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567"}, @@ -2185,14 +2187,27 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-win32.whl", hash = "sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9"}, {file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee"}, {file = "MarkupSafe-2.0.1-cp38-cp38-win32.whl", hash = "sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64"}, {file = "MarkupSafe-2.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833"}, {file = "MarkupSafe-2.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26"}, @@ -2202,6 +2217,12 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135"}, {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902"}, {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1"}, {file = "MarkupSafe-2.0.1-cp39-cp39-win32.whl", hash = "sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74"}, {file = "MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8"}, {file = "MarkupSafe-2.0.1.tar.gz", hash = "sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a"}, @@ -2277,8 +2298,8 @@ packaging = [ {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, ] paramiko = [ - {file = "paramiko-2.9.2-py2.py3-none-any.whl", hash = "sha256:04097dbd96871691cdb34c13db1883066b8a13a0df2afd4cb0a92221f51c2603"}, - {file = "paramiko-2.9.2.tar.gz", hash = "sha256:944a9e5dbdd413ab6c7951ea46b0ab40713235a9c4c5ca81cfe45c6f14fa677b"}, + {file = "paramiko-2.10.1-py2.py3-none-any.whl", hash = "sha256:f6cbd3e1204abfdbcd40b3ecbc9d32f04027cd3080fe666245e21e7540ccfc1b"}, + {file = "paramiko-2.10.1.tar.gz", hash = "sha256:443f4da23ec24e9a9c0ea54017829c282abdda1d57110bf229360775ccd27a31"}, ] parso = [ {file = "parso-0.8.3-py2.py3-none-any.whl", hash = "sha256:c001d4636cd3aecdaf33cbb40aebb59b094be2a74c556778ef5576c175e19e75"}, @@ -2598,29 +2619,6 @@ pyparsing = [ {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, ] -pyrsistent = [ - {file = "pyrsistent-0.18.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:df46c854f490f81210870e509818b729db4488e1f30f2a1ce1698b2295a878d1"}, - {file = "pyrsistent-0.18.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d45866ececf4a5fff8742c25722da6d4c9e180daa7b405dc0a2a2790d668c26"}, - {file = "pyrsistent-0.18.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4ed6784ceac462a7d6fcb7e9b663e93b9a6fb373b7f43594f9ff68875788e01e"}, - {file = "pyrsistent-0.18.1-cp310-cp310-win32.whl", hash = "sha256:e4f3149fd5eb9b285d6bfb54d2e5173f6a116fe19172686797c056672689daf6"}, - {file = "pyrsistent-0.18.1-cp310-cp310-win_amd64.whl", hash = "sha256:636ce2dc235046ccd3d8c56a7ad54e99d5c1cd0ef07d9ae847306c91d11b5fec"}, - {file = "pyrsistent-0.18.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e92a52c166426efbe0d1ec1332ee9119b6d32fc1f0bbfd55d5c1088070e7fc1b"}, - {file = "pyrsistent-0.18.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7a096646eab884bf8bed965bad63ea327e0d0c38989fc83c5ea7b8a87037bfc"}, - {file = "pyrsistent-0.18.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cdfd2c361b8a8e5d9499b9082b501c452ade8bbf42aef97ea04854f4a3f43b22"}, - {file = "pyrsistent-0.18.1-cp37-cp37m-win32.whl", hash = "sha256:7ec335fc998faa4febe75cc5268a9eac0478b3f681602c1f27befaf2a1abe1d8"}, - {file = "pyrsistent-0.18.1-cp37-cp37m-win_amd64.whl", hash = "sha256:6455fc599df93d1f60e1c5c4fe471499f08d190d57eca040c0ea182301321286"}, - {file = "pyrsistent-0.18.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:fd8da6d0124efa2f67d86fa70c851022f87c98e205f0594e1fae044e7119a5a6"}, - {file = "pyrsistent-0.18.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bfe2388663fd18bd8ce7db2c91c7400bf3e1a9e8bd7d63bf7e77d39051b85ec"}, - {file = "pyrsistent-0.18.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e3e1fcc45199df76053026a51cc59ab2ea3fc7c094c6627e93b7b44cdae2c8c"}, - {file = "pyrsistent-0.18.1-cp38-cp38-win32.whl", hash = "sha256:b568f35ad53a7b07ed9b1b2bae09eb15cdd671a5ba5d2c66caee40dbf91c68ca"}, - {file = "pyrsistent-0.18.1-cp38-cp38-win_amd64.whl", hash = "sha256:d1b96547410f76078eaf66d282ddca2e4baae8964364abb4f4dcdde855cd123a"}, - {file = "pyrsistent-0.18.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:f87cc2863ef33c709e237d4b5f4502a62a00fab450c9e020892e8e2ede5847f5"}, - {file = "pyrsistent-0.18.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bc66318fb7ee012071b2792024564973ecc80e9522842eb4e17743604b5e045"}, - {file = "pyrsistent-0.18.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:914474c9f1d93080338ace89cb2acee74f4f666fb0424896fcfb8d86058bf17c"}, - {file = "pyrsistent-0.18.1-cp39-cp39-win32.whl", hash = "sha256:1b34eedd6812bf4d33814fca1b66005805d3640ce53140ab8bbb1e2651b0d9bc"}, - {file = "pyrsistent-0.18.1-cp39-cp39-win_amd64.whl", hash = "sha256:e24a828f57e0c337c8d8bb9f6b12f09dfdf0273da25fda9e314f0b684b415a07"}, - {file = "pyrsistent-0.18.1.tar.gz", hash = "sha256:d4d61f8b993a7255ba714df3aca52700f8125289f84f704cf80916517c46eb96"}, -] pysftp = [ {file = "pysftp-0.2.9.tar.gz", hash = "sha256:fbf55a802e74d663673400acd92d5373c1c7ee94d765b428d9f977567ac4854a"}, ] From d6a7beb16b056f24114aec5b27ecc6b5e60497cd Mon Sep 17 00:00:00 2001 From: OpenPype Date: Wed, 30 Mar 2022 03:40:40 +0000 Subject: [PATCH 82/91] [Automated] Bump version --- CHANGELOG.md | 19 ++++++++++++------- openpype/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abe9eaa3ce..f767bc71d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [3.9.2-nightly.2](https://github.com/pypeclub/OpenPype/tree/HEAD) +## [3.9.2-nightly.3](https://github.com/pypeclub/OpenPype/tree/HEAD) [Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.9.1...HEAD) @@ -8,11 +8,16 @@ - Docs: Added MongoDB requirements [\#2951](https://github.com/pypeclub/OpenPype/pull/2951) +**🆕 New features** + +- Multiverse: First PR [\#2908](https://github.com/pypeclub/OpenPype/pull/2908) + **🚀 Enhancements** - Slack: Added configurable maximum file size of review upload to Slack [\#2945](https://github.com/pypeclub/OpenPype/pull/2945) - NewPublisher: Prepared implementation of optional pyblish plugin [\#2943](https://github.com/pypeclub/OpenPype/pull/2943) - Workfiles: Open published workfiles [\#2925](https://github.com/pypeclub/OpenPype/pull/2925) +- General: Default modules loaded dynamically [\#2923](https://github.com/pypeclub/OpenPype/pull/2923) - CI: change the version bump logic [\#2919](https://github.com/pypeclub/OpenPype/pull/2919) - Deadline: Add headless argument [\#2916](https://github.com/pypeclub/OpenPype/pull/2916) - Nuke: Add no-audio Tag [\#2911](https://github.com/pypeclub/OpenPype/pull/2911) @@ -22,16 +27,21 @@ **🐛 Bug fixes** +- Slack: Added default for review\_upload\_limit for Slack [\#2965](https://github.com/pypeclub/OpenPype/pull/2965) +- Settings: Conditional dictionary avoid invalid logs [\#2956](https://github.com/pypeclub/OpenPype/pull/2956) - LogViewer: Don't refresh on initialization [\#2949](https://github.com/pypeclub/OpenPype/pull/2949) +- nuke: python3 compatibility issue with `iteritems` [\#2948](https://github.com/pypeclub/OpenPype/pull/2948) - General: anatomy data with correct task short key [\#2947](https://github.com/pypeclub/OpenPype/pull/2947) - SceneInventory: Fix imports in UI [\#2944](https://github.com/pypeclub/OpenPype/pull/2944) - Slack: add generic exception [\#2941](https://github.com/pypeclub/OpenPype/pull/2941) - General: Python specific vendor paths on env injection [\#2939](https://github.com/pypeclub/OpenPype/pull/2939) - General: More fail safe delete old versions [\#2936](https://github.com/pypeclub/OpenPype/pull/2936) - Settings UI: Collapsed of collapsible wrapper works as expected [\#2934](https://github.com/pypeclub/OpenPype/pull/2934) +- Maya: Do not pass `set` to maya commands \(fixes support for older maya versions\) [\#2932](https://github.com/pypeclub/OpenPype/pull/2932) - General: Don't print log record on OSError [\#2926](https://github.com/pypeclub/OpenPype/pull/2926) - Hiero: Fix import of 'register\_event\_callback' [\#2924](https://github.com/pypeclub/OpenPype/pull/2924) - Ftrack: Missing Ftrack id after editorial publish [\#2905](https://github.com/pypeclub/OpenPype/pull/2905) +- AfterEffects: Fix rendering for single frame in DL [\#2875](https://github.com/pypeclub/OpenPype/pull/2875) **🔀 Refactored code** @@ -43,7 +53,7 @@ **Merged pull requests:** -- Maya: Do not pass `set` to maya commands \(fixes support for older maya versions\) [\#2932](https://github.com/pypeclub/OpenPype/pull/2932) +- Maya - added transparency into review creator [\#2952](https://github.com/pypeclub/OpenPype/pull/2952) ## [3.9.1](https://github.com/pypeclub/OpenPype/tree/3.9.1) (2022-03-18) @@ -96,14 +106,10 @@ - Maya: add loaded containers to published instance [\#2837](https://github.com/pypeclub/OpenPype/pull/2837) - Ftrack: Can sync fps as string [\#2836](https://github.com/pypeclub/OpenPype/pull/2836) - General: Custom function for find executable [\#2822](https://github.com/pypeclub/OpenPype/pull/2822) -- General: Color dialog UI fixes [\#2817](https://github.com/pypeclub/OpenPype/pull/2817) -- global: letter box calculated on output as last process [\#2812](https://github.com/pypeclub/OpenPype/pull/2812) -- Nuke: adding Reformat to baking mov plugin [\#2811](https://github.com/pypeclub/OpenPype/pull/2811) **🐛 Bug fixes** - General: Missing time function [\#2877](https://github.com/pypeclub/OpenPype/pull/2877) -- AfterEffects: Fix rendering for single frame in DL [\#2875](https://github.com/pypeclub/OpenPype/pull/2875) - Deadline: Fix plugin name for tile assemble [\#2868](https://github.com/pypeclub/OpenPype/pull/2868) - Nuke: gizmo precollect fix [\#2866](https://github.com/pypeclub/OpenPype/pull/2866) - General: Fix hardlink for windows [\#2864](https://github.com/pypeclub/OpenPype/pull/2864) @@ -126,7 +132,6 @@ - Settings UI: Fix "Apply from" action [\#2820](https://github.com/pypeclub/OpenPype/pull/2820) - Ftrack: Job killer with missing user [\#2819](https://github.com/pypeclub/OpenPype/pull/2819) - Nuke: Use AVALON\_APP to get value for "app" key [\#2818](https://github.com/pypeclub/OpenPype/pull/2818) -- StandalonePublisher: use dynamic groups in subset names [\#2816](https://github.com/pypeclub/OpenPype/pull/2816) **🔀 Refactored code** diff --git a/openpype/version.py b/openpype/version.py index 84ea02fd08..6d55672aca 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.9.2-nightly.2" +__version__ = "3.9.2-nightly.3" diff --git a/pyproject.toml b/pyproject.toml index 46515b4785..479cd731fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "OpenPype" -version = "3.9.2-nightly.2" # OpenPype +version = "3.9.2-nightly.3" # OpenPype description = "Open VFX and Animation pipeline with support." authors = ["OpenPype Team "] license = "MIT License" From 3f8f9b9008238f7220b2b101bcceedefb70cc9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Wed, 30 Mar 2022 10:47:55 +0200 Subject: [PATCH 83/91] Update openpype/hosts/flame/plugins/publish/collect_timeline_instances.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../hosts/flame/plugins/publish/collect_timeline_instances.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index 390c55837c..bc5c60a97d 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -98,8 +98,7 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): label = asset if asset != clip_name: label += " ({})".format(clip_name) - label += " {}".format(subset) - label += " {}".format("[" + ", ".join(families) + "]") + label += " {} [{}]".format(subset, ", ".join(families)) inst_data.update({ "name": "{}_{}".format(asset, subset), From fbe34f74a3c18901c31b5735ddbdec38093f156d Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 30 Mar 2022 10:49:53 +0200 Subject: [PATCH 84/91] flame: flip order of processing --- .../publish/collect_timeline_instances.py | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index bc5c60a97d..2482abd9c7 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -43,17 +43,6 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): # process all sellected for segment in selected_segments: - comment_attributes = self._get_comment_attributes(segment) - self.log.debug("__ segment.name: {}".format( - segment.name - )) - self.log.debug("_ comment_attributes: {}".format( - pformat(comment_attributes))) - - clip_data = opfapi.get_segment_attributes(segment) - clip_name = clip_data["segment_name"] - self.log.debug("clip_name: {}".format(clip_name)) - # get openpype tag data marker_data = opfapi.get_segment_data_marker(segment) self.log.debug("__ marker_data: {}".format( @@ -65,6 +54,19 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): if marker_data.get("id") != "pyblish.avalon.instance": continue + self.log.debug("__ segment.name: {}".format( + segment.name + )) + + comment_attributes = self._get_comment_attributes(segment) + + self.log.debug("_ comment_attributes: {}".format( + pformat(comment_attributes))) + + clip_data = opfapi.get_segment_attributes(segment) + clip_name = clip_data["segment_name"] + self.log.debug("clip_name: {}".format(clip_name)) + # get file path file_path = clip_data["fpath"] From ee96827ff225fb1dff1419074acc89103b0cdd08 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 30 Mar 2022 10:59:01 +0200 Subject: [PATCH 85/91] flame: improving handling color policy input --- openpype/hosts/flame/api/scripts/wiretap_com.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/flame/api/scripts/wiretap_com.py b/openpype/hosts/flame/api/scripts/wiretap_com.py index a85a85ae25..54993d34eb 100644 --- a/openpype/hosts/flame/api/scripts/wiretap_com.py +++ b/openpype/hosts/flame/api/scripts/wiretap_com.py @@ -422,7 +422,13 @@ class WireTapCom(object): color_policy = color_policy or "Legacy" # check if the colour policy in custom dir - if "/" not in color_policy: + if "/" in color_policy: + # if unlikelly full path was used make it redundant + color_policy = color_policy.replace("/syncolor/policies/", "") + # expecting input is `Shared/NameOfPolicy` + color_policy = "/syncolor/policies/{}".format( + color_policy) + else: color_policy = "/syncolor/policies/Autodesk/{}".format( color_policy) From 36a43d402012e0115a856f1d6058397ab29e4fd2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 30 Mar 2022 11:11:37 +0200 Subject: [PATCH 86/91] Simplified getting host and app filter acess. Co-authored-by: Roy Nieterau --- openpype/lib/applications.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/openpype/lib/applications.py b/openpype/lib/applications.py index b496bd74e2..5821c863d7 100644 --- a/openpype/lib/applications.py +++ b/openpype/lib/applications.py @@ -571,13 +571,8 @@ class EnvironmentTool: # Backwards compatibility 3.9.1 - 3.9.2 # - 'variant_data' contained only environments but contain also host # and application variant filters - host_names = [] - app_variants = [] - if "host_names" in variant_data: - host_names = variant_data["host_names"] - - if "app_variants" in variant_data: - app_variants = variant_data["app_variants"] + host_names = variant_data.get("host_names", []) + app_variants = variant_data.get("app_variants", []) if "environment" in variant_data: environment = variant_data["environment"] From ccf563d60ab7a11dc3dcd7ab81c45134d0a5c387 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 30 Mar 2022 11:54:38 +0200 Subject: [PATCH 87/91] `METADATA_KEYS` constant as `frozenset` for optimal immutable lookup --- openpype/settings/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/settings/constants.py b/openpype/settings/constants.py index 8b8acf5714..19ff953eb4 100644 --- a/openpype/settings/constants.py +++ b/openpype/settings/constants.py @@ -8,11 +8,11 @@ M_ENVIRONMENT_KEY = "__environment_keys__" # Metadata key for storing dynamic created labels M_DYNAMIC_KEY_LABEL = "__dynamic_keys_labels__" -METADATA_KEYS = ( +METADATA_KEYS = frozenset([ M_OVERRIDDEN_KEY, M_ENVIRONMENT_KEY, M_DYNAMIC_KEY_LABEL -) +]) # Keys where studio's system overrides are stored GLOBAL_SETTINGS_KEY = "global_settings" From 215da09d3dcf92138eeddfc97bf48a9fd5728729 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 30 Mar 2022 15:24:23 +0200 Subject: [PATCH 88/91] Change default value of force copy to True --- openpype/hosts/maya/plugins/create/create_look.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/create/create_look.py b/openpype/hosts/maya/plugins/create/create_look.py index 56e2640919..d9521d1860 100644 --- a/openpype/hosts/maya/plugins/create/create_look.py +++ b/openpype/hosts/maya/plugins/create/create_look.py @@ -22,4 +22,4 @@ class CreateLook(plugin.Creator): self.data["maketx"] = self.make_tx # Enable users to force a copy. - self.data["forceCopy"] = False + self.data["forceCopy"] = True From 8eab6ae180fe308e03bc4d3df7cd53bd030b59ce Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 30 Mar 2022 16:25:37 +0200 Subject: [PATCH 89/91] disable hardlink on windows for look publishing --- openpype/hosts/maya/plugins/create/create_look.py | 4 +++- openpype/hosts/maya/plugins/publish/extract_look.py | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_look.py b/openpype/hosts/maya/plugins/create/create_look.py index d9521d1860..44e439fe1f 100644 --- a/openpype/hosts/maya/plugins/create/create_look.py +++ b/openpype/hosts/maya/plugins/create/create_look.py @@ -22,4 +22,6 @@ class CreateLook(plugin.Creator): self.data["maketx"] = self.make_tx # Enable users to force a copy. - self.data["forceCopy"] = True + # - on Windows is "forceCopy" always changed to `True` because of + # windows implementation of hardlinks + self.data["forceCopy"] = False diff --git a/openpype/hosts/maya/plugins/publish/extract_look.py b/openpype/hosts/maya/plugins/publish/extract_look.py index a8893072d0..137683ca6d 100644 --- a/openpype/hosts/maya/plugins/publish/extract_look.py +++ b/openpype/hosts/maya/plugins/publish/extract_look.py @@ -4,6 +4,7 @@ import os import sys import json import tempfile +import platform import contextlib import subprocess from collections import OrderedDict @@ -334,7 +335,11 @@ class ExtractLook(openpype.api.Extractor): transfers = [] hardlinks = [] hashes = {} - force_copy = instance.data.get("forceCopy", False) + # Temporary fix to NOT create hardlinks on windows machines + if platform.system().lower() == "windows": + force_copy = True + else: + force_copy = instance.data.get("forceCopy", False) for filepath in files_metadata: From 58085d3b4ed15ac8506b2a86ae402e68be176f51 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 30 Mar 2022 16:31:41 +0200 Subject: [PATCH 90/91] removed unused function --- openpype/modules/ftrack/lib/avalon_sync.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/openpype/modules/ftrack/lib/avalon_sync.py b/openpype/modules/ftrack/lib/avalon_sync.py index 5301ec568e..c5b58ca94d 100644 --- a/openpype/modules/ftrack/lib/avalon_sync.py +++ b/openpype/modules/ftrack/lib/avalon_sync.py @@ -286,21 +286,6 @@ def from_dict_to_set(data, is_project): return result -def get_avalon_project_template(project_name): - """Get avalon template - Args: - project_name: (string) - Returns: - dictionary with templates - """ - templates = Anatomy(project_name).templates - return { - "workfile": templates["avalon"]["workfile"], - "work": templates["avalon"]["work"], - "publish": templates["avalon"]["publish"] - } - - def get_project_apps(in_app_list): """ Application definitions for app name. From 8940830787fc68d043febecd26040d944e5d91d9 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 30 Mar 2022 16:38:45 +0200 Subject: [PATCH 91/91] added info log about changing hardlink --- openpype/hosts/maya/plugins/publish/extract_look.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openpype/hosts/maya/plugins/publish/extract_look.py b/openpype/hosts/maya/plugins/publish/extract_look.py index 137683ca6d..6fcc308f78 100644 --- a/openpype/hosts/maya/plugins/publish/extract_look.py +++ b/openpype/hosts/maya/plugins/publish/extract_look.py @@ -337,6 +337,9 @@ class ExtractLook(openpype.api.Extractor): hashes = {} # Temporary fix to NOT create hardlinks on windows machines if platform.system().lower() == "windows": + self.log.info( + "Forcing copy instead of hardlink due to issues on Windows..." + ) force_copy = True else: force_copy = instance.data.get("forceCopy", False)