From c91b82eb2ece1556796275c323b864330ef84a4e Mon Sep 17 00:00:00 2001 From: Kayla Man <64118225+moonyuet@users.noreply.github.com> Date: Tue, 2 Jul 2024 22:23:32 +0800 Subject: [PATCH] Update server_addon/maya/client/ayon_maya/plugins/publish/collect_yeti_rig.py Co-authored-by: Roy Nieterau --- .../ayon_maya/plugins/publish/collect_yeti_rig.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server_addon/maya/client/ayon_maya/plugins/publish/collect_yeti_rig.py b/server_addon/maya/client/ayon_maya/plugins/publish/collect_yeti_rig.py index 189fc08ef7..5bc5634023 100644 --- a/server_addon/maya/client/ayon_maya/plugins/publish/collect_yeti_rig.py +++ b/server_addon/maya/client/ayon_maya/plugins/publish/collect_yeti_rig.py @@ -280,6 +280,12 @@ class CollectYetiRig(plugin.MayaInstancePlugin): re_pattern = re_pattern.replace(re.escape(pattern), "-?[0-9]+") source_dir = os.path.dirname(filepath) files = [f for f in os.listdir(source_dir) if re.match(re_pattern, f)] + if not files: + # Files do not exist, this may not be a problem if e.g. the + # textures were relative paths and we're searching across + # multiple image search paths. + return + collections, _remainder = clique.assemble( files, patterns=[clique.PATTERNS["frames"]], @@ -290,7 +296,10 @@ class CollectYetiRig(plugin.MayaInstancePlugin): f"Multiple collections found for {collections}. " "This is a bug.") - return list(collections[0]) + return [ + os.path.join(source_dir, filename) + for filename in collections[0] + ] def _replace_tokens(self, strings): env_re = re.compile(r"\$\{(\w+)\}")