From f428d122d717fcd50be1ad317002f8fc8e9264b9 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 1 Oct 2024 00:07:57 +0200 Subject: [PATCH 1/2] Support underscore delimiter for yeti UDIM textures --- client/ayon_maya/api/lib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/ayon_maya/api/lib.py b/client/ayon_maya/api/lib.py index 9a46847e..cfee01f9 100644 --- a/client/ayon_maya/api/lib.py +++ b/client/ayon_maya/api/lib.py @@ -4364,9 +4364,13 @@ def get_sequence(filepath, pattern="%04d"): # multiple image search paths. return + # clique.PATTERNS["frames"] supports only `.1001.exr` not `_1001.exr` so + # we use a customized pattern. + pattern = "[_.](?P(?P0*)\\d+)\\.\\D+\\d?$" + patterns = [pattern] collections, _remainder = clique.assemble( files, - patterns=[clique.PATTERNS["frames"]], + patterns=patterns, minimum_items=1) if len(collections) > 1: From b882f60b5fadb9514817b195529f00a7cb5f8d35 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 2 Oct 2024 12:43:06 +0200 Subject: [PATCH 2/2] Do not require two dots in the filename --- client/ayon_maya/api/lib.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/client/ayon_maya/api/lib.py b/client/ayon_maya/api/lib.py index cfee01f9..885ed38d 100644 --- a/client/ayon_maya/api/lib.py +++ b/client/ayon_maya/api/lib.py @@ -4311,21 +4311,19 @@ def search_textures(filepath): filename = os.path.basename(filepath) # Collect full sequence if it matches a sequence pattern - if len(filename.split(".")) > 2: - - # For UDIM based textures (tiles) - if "" in filename: - sequences = get_sequence(filepath, - pattern="") - if sequences: - return sequences - - # Frame/time - Based textures (animated masks f.e) - elif "%04d" in filename: - sequences = get_sequence(filepath, - pattern="%04d") - if sequences: - return sequences + # For UDIM based textures (tiles) + if "" in filename: + sequences = get_sequence(filepath, + pattern="") + if sequences: + return sequences + + # Frame/time - Based textures (animated masks f.e) + elif "%04d" in filename: + sequences = get_sequence(filepath, + pattern="%04d") + if sequences: + return sequences # Assuming it is a fixed name (single file) if os.path.exists(filepath):