From b502019d2b7c9bbaab06fde78c41d951c7c39a71 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 4 Dec 2023 15:23:56 +0800 Subject: [PATCH 01/10] bug fix on collector for not being able to collect textures from texture nodes in yeti graph --- openpype/hosts/maya/plugins/publish/collect_yeti_rig.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py index df761cde13..b05bbc7961 100644 --- a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py @@ -128,7 +128,12 @@ class CollectYetiRig(pyblish.api.InstancePlugin): image_search_paths = self._replace_tokens(image_search_paths) # List all related textures - texture_filenames = cmds.pgYetiCommand(node, listTextures=True) + texture_nodes = cmds.pgYetiGraph(node, listNodes=True, type="texture") + texture_filenames = [cmds.pgYetiGraph(node, + node=texture_node, + param="file_name", + getParamValue=True) + for texture_node in texture_nodes] self.log.debug("Found %i texture(s)" % len(texture_filenames)) # Get all reference nodes From caf8a2a2dfdcb259ee80e20c223078e12b1d2342 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 4 Dec 2023 17:41:28 +0800 Subject: [PATCH 02/10] hound --- openpype/hosts/maya/plugins/publish/collect_yeti_rig.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py index b05bbc7961..7a2121742c 100644 --- a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py @@ -128,12 +128,13 @@ class CollectYetiRig(pyblish.api.InstancePlugin): image_search_paths = self._replace_tokens(image_search_paths) # List all related textures - texture_nodes = cmds.pgYetiGraph(node, listNodes=True, type="texture") + texture_nodes = cmds.pgYetiGraph( + node, listNodes=True, type="texture") texture_filenames = [cmds.pgYetiGraph(node, node=texture_node, param="file_name", getParamValue=True) - for texture_node in texture_nodes] + for texture_node in texture_nodes] self.log.debug("Found %i texture(s)" % len(texture_filenames)) # Get all reference nodes From 8c615a0db8e1ba251ad09d4d9dbabbdeceeb29cc Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 4 Dec 2023 17:42:33 +0800 Subject: [PATCH 03/10] hound --- openpype/hosts/maya/plugins/publish/collect_yeti_rig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py index 7a2121742c..b2c124d2fd 100644 --- a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py @@ -134,7 +134,8 @@ class CollectYetiRig(pyblish.api.InstancePlugin): node=texture_node, param="file_name", getParamValue=True) - for texture_node in texture_nodes] + for texture_node + in texture_nodes] self.log.debug("Found %i texture(s)" % len(texture_filenames)) # Get all reference nodes From 3fe3b217415ad7cb89641ea74eba00fa78885c07 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 4 Dec 2023 17:44:22 +0800 Subject: [PATCH 04/10] hound --- .../hosts/maya/plugins/publish/collect_yeti_rig.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py index b2c124d2fd..5f40d009c2 100644 --- a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py @@ -130,12 +130,12 @@ class CollectYetiRig(pyblish.api.InstancePlugin): # List all related textures texture_nodes = cmds.pgYetiGraph( node, listNodes=True, type="texture") - texture_filenames = [cmds.pgYetiGraph(node, - node=texture_node, - param="file_name", - getParamValue=True) - for texture_node - in texture_nodes] + texture_filenames = [ + cmds.pgYetiGraph( + node, node=texture_node, + param="file_name", getParamValue=True) + for texture_node in texture_nodes + ] self.log.debug("Found %i texture(s)" % len(texture_filenames)) # Get all reference nodes From 889f86457d9a8c9b94042863fa8ed484d21f920f Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 4 Dec 2023 17:46:06 +0800 Subject: [PATCH 05/10] hound --- openpype/hosts/maya/plugins/publish/collect_yeti_rig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py index 5f40d009c2..835934e1bf 100644 --- a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py @@ -132,8 +132,8 @@ class CollectYetiRig(pyblish.api.InstancePlugin): node, listNodes=True, type="texture") texture_filenames = [ cmds.pgYetiGraph( - node, node=texture_node, - param="file_name", getParamValue=True) + node, node=texture_node, + param="file_name", getParamValue=True) for texture_node in texture_nodes ] self.log.debug("Found %i texture(s)" % len(texture_filenames)) From af87fdf657adb7ca5dd6f34bdd41335dc2b9efa7 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 20 Dec 2023 21:31:19 +0800 Subject: [PATCH 06/10] the resourceDir for texture also supports without image search path --- .../maya/plugins/publish/collect_yeti_rig.py | 29 ++++++++----------- .../maya/plugins/publish/extract_yeti_rig.py | 16 ++++++---- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py index 835934e1bf..d67c51b895 100644 --- a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py @@ -124,19 +124,19 @@ class CollectYetiRig(pyblish.api.InstancePlugin): image_search_paths = [p for p in image_search_paths.split(os.path.pathsep) if p] - # find all ${TOKEN} tokens and replace them with $TOKEN env. variable - image_search_paths = self._replace_tokens(image_search_paths) + # find all ${TOKEN} tokens and replace them with $TOKEN env. variable + image_search_paths = self._replace_tokens(image_search_paths) - # List all related textures - texture_nodes = cmds.pgYetiGraph( - node, listNodes=True, type="texture") - texture_filenames = [ - cmds.pgYetiGraph( - node, node=texture_node, - param="file_name", getParamValue=True) - for texture_node in texture_nodes - ] - self.log.debug("Found %i texture(s)" % len(texture_filenames)) + # List all related textures + texture_nodes = cmds.pgYetiGraph( + node, listNodes=True, type="texture") + texture_filenames = [ + cmds.pgYetiGraph( + node, node=texture_node, + param="file_name", getParamValue=True) + for texture_node in texture_nodes + ] + self.log.debug("Found %i texture(s)" % len(texture_filenames)) # Get all reference nodes reference_nodes = cmds.pgYetiGraph(node, @@ -144,11 +144,6 @@ class CollectYetiRig(pyblish.api.InstancePlugin): type="reference") self.log.debug("Found %i reference node(s)" % len(reference_nodes)) - if texture_filenames and not image_search_paths: - raise ValueError("pgYetiMaya node '%s' is missing the path to the " - "files in the 'imageSearchPath " - "atttribute'" % node) - # Collect all texture files # find all ${TOKEN} tokens and replace them with $TOKEN env. variable texture_filenames = self._replace_tokens(texture_filenames) diff --git a/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py b/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py index da67cb911f..a76d15d43e 100644 --- a/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py @@ -142,12 +142,18 @@ class ExtractYetiRig(publish.Extractor): instance.data['transfers'] = [] for resource in instance.data.get('resources', []): - for file in resource['files']: - src = file - dst = os.path.join(image_search_path, os.path.basename(file)) - instance.data['transfers'].append([src, dst]) + if resource["files"]: + for file in resource['files']: + src = file + dst = os.path.join(image_search_path, os.path.basename(file)) + instance.data['transfers'].append([src, dst]) + else: + for file in resource['source']: + src = file if os.path.isabs(file) else os.path.abspath(file) + dst = os.path.join(image_search_path, os.path.basename(file)) + instance.data['transfers'].append([src, dst]) - self.log.debug("adding transfer {} -> {}". format(src, dst)) + self.log.debug("adding transfer {} -> {}". format(src, dst)) # Ensure the imageSearchPath is being remapped to the publish folder attr_value = {"%s.imageSearchPath" % n: str(image_search_path) for From da93e19ca9f2832eb30774b7db6b82aff7f0dfc7 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Wed, 20 Dec 2023 21:32:56 +0800 Subject: [PATCH 07/10] hound --- .../hosts/maya/plugins/publish/extract_yeti_rig.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py b/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py index a76d15d43e..c0c286dcc0 100644 --- a/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py @@ -145,12 +145,16 @@ class ExtractYetiRig(publish.Extractor): if resource["files"]: for file in resource['files']: src = file - dst = os.path.join(image_search_path, os.path.basename(file)) + dst = os.path.join( + image_search_path, os.path.basename(file)) instance.data['transfers'].append([src, dst]) else: for file in resource['source']: - src = file if os.path.isabs(file) else os.path.abspath(file) - dst = os.path.join(image_search_path, os.path.basename(file)) + src = ( + file if os.path.isabs(file) else os.path.abspath(file) + ) + dst = os.path.join( + image_search_path, os.path.basename(file)) instance.data['transfers'].append([src, dst]) self.log.debug("adding transfer {} -> {}". format(src, dst)) From fcd605ae7dc99ab5f8965ada71bd317bce0c1a35 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 21 Dec 2023 15:43:08 +0800 Subject: [PATCH 08/10] make sure error will be raised if there is neither texture nor image search path --- .../maya/plugins/publish/collect_yeti_rig.py | 8 ++++---- .../maya/plugins/publish/extract_yeti_rig.py | 18 ++++-------------- openpype/pipeline/publish/lib.py | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py index d67c51b895..f82f7b69cd 100644 --- a/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py @@ -6,6 +6,7 @@ from maya import cmds import pyblish.api from openpype.hosts.maya.api import lib +from openpype.pipeline.publish import KnownPublishError SETTINGS = {"renderDensity", @@ -116,7 +117,6 @@ class CollectYetiRig(pyblish.api.InstancePlugin): resources = [] image_search_paths = cmds.getAttr("{}.imageSearchPath".format(node)) - texture_filenames = [] if image_search_paths: # TODO: Somehow this uses OS environment path separator, `:` vs `;` @@ -124,8 +124,8 @@ class CollectYetiRig(pyblish.api.InstancePlugin): image_search_paths = [p for p in image_search_paths.split(os.path.pathsep) if p] - # find all ${TOKEN} tokens and replace them with $TOKEN env. variable - image_search_paths = self._replace_tokens(image_search_paths) + # find all ${TOKEN} tokens and replace them with $TOKEN env. variable + image_search_paths = self._replace_tokens(image_search_paths) # List all related textures texture_nodes = cmds.pgYetiGraph( @@ -163,7 +163,7 @@ class CollectYetiRig(pyblish.api.InstancePlugin): break if not files: - self.log.warning( + raise KnownPublishError( "No texture found for: %s " "(searched: %s)" % (texture, image_search_paths)) diff --git a/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py b/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py index c0c286dcc0..413961073f 100644 --- a/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py @@ -142,20 +142,10 @@ class ExtractYetiRig(publish.Extractor): instance.data['transfers'] = [] for resource in instance.data.get('resources', []): - if resource["files"]: - for file in resource['files']: - src = file - dst = os.path.join( - image_search_path, os.path.basename(file)) - instance.data['transfers'].append([src, dst]) - else: - for file in resource['source']: - src = ( - file if os.path.isabs(file) else os.path.abspath(file) - ) - dst = os.path.join( - image_search_path, os.path.basename(file)) - instance.data['transfers'].append([src, dst]) + for file in resource['files']: + src = file + dst = os.path.join(image_search_path, os.path.basename(file)) + instance.data['transfers'].append([src, dst]) self.log.debug("adding transfer {} -> {}". format(src, dst)) diff --git a/openpype/pipeline/publish/lib.py b/openpype/pipeline/publish/lib.py index 4ea2f932f1..87ca3323cb 100644 --- a/openpype/pipeline/publish/lib.py +++ b/openpype/pipeline/publish/lib.py @@ -74,7 +74,7 @@ def get_template_name_profiles( project_settings ["global"] ["publish"] - ["IntegrateAssetNew"] + ["IntegrateHeroVersion"] ["template_name_profiles"] ) if legacy_profiles: From 92107167af33f5617df0add058bfb8399e7f4723 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 21 Dec 2023 15:43:51 +0800 Subject: [PATCH 09/10] restore unnecessary tweaks --- openpype/pipeline/publish/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/pipeline/publish/lib.py b/openpype/pipeline/publish/lib.py index 87ca3323cb..4ea2f932f1 100644 --- a/openpype/pipeline/publish/lib.py +++ b/openpype/pipeline/publish/lib.py @@ -74,7 +74,7 @@ def get_template_name_profiles( project_settings ["global"] ["publish"] - ["IntegrateHeroVersion"] + ["IntegrateAssetNew"] ["template_name_profiles"] ) if legacy_profiles: From 186ecff5470c3a26d614d9c587965cf2c70bcef1 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 21 Dec 2023 15:45:15 +0800 Subject: [PATCH 10/10] restore unnecessary tweaks --- openpype/hosts/maya/plugins/publish/extract_yeti_rig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py b/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py index 413961073f..da67cb911f 100644 --- a/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py +++ b/openpype/hosts/maya/plugins/publish/extract_yeti_rig.py @@ -147,7 +147,7 @@ class ExtractYetiRig(publish.Extractor): dst = os.path.join(image_search_path, os.path.basename(file)) instance.data['transfers'].append([src, dst]) - self.log.debug("adding transfer {} -> {}". format(src, dst)) + self.log.debug("adding transfer {} -> {}". format(src, dst)) # Ensure the imageSearchPath is being remapped to the publish folder attr_value = {"%s.imageSearchPath" % n: str(image_search_path) for