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 6ec691d156..c6e3384bc0 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,13 +280,15 @@ 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)] - collection, _remainder = clique.assemble( + collections, _remainder = clique.assemble( files, patterns=[clique.PATTERNS["frames"]], minimum_items=1) - files = [texture for texture_collection in collection - for texture in texture_collection] - return files + + if len(collections) > 1: + raise ValueError(f"Multiple collections found for {files}. This is a bug.") + + return list(collections[0]) def _replace_tokens(self, strings): env_re = re.compile(r"\$\{(\w+)\}")