From c0ecdb1d85fedaea897cb5fc988e8a9ea35280d5 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 28 Jun 2024 18:34:39 +0800 Subject: [PATCH] use basename of filepath - big roy's comment --- .../plugins/publish/collect_yeti_rig.py | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) 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 d05bc70dbd..c5b5dac4ec 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 @@ -276,19 +276,15 @@ class CollectYetiRig(plugin.MayaInstancePlugin): """ import clique - escaped = ( - re.escape(os.path.basename(filepath)) - if os.path.isabs(filepath) else re.escape(filepath) - ) - re_pattern = escaped.replace(pattern, "-?[0-9]+") - + filename = os.path.basename(filepath) + re_pattern = re.escape(filename) + 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)] - - pattern = [clique.PATTERNS["frames"]] - collection, remainder = clique.assemble( - files, patterns=pattern, minimum_items=1) + files = [f for f in os.listdir(source_dir) if re.match(re_pattern, f)] + collection, _remainder = clique.assemble( + files, + patterns=[clique.PATTERNS["frames"]], + minimum_items=1) return collection