From c9d4716dfad1e922ad29c8a0275da067ea0e0b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Sat, 30 Nov 2024 01:26:15 +0100 Subject: [PATCH 1/2] :art: add `UDIM` to `FileLocations` relationships --- client/ayon_core/pipeline/traits/content.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/pipeline/traits/content.py b/client/ayon_core/pipeline/traits/content.py index ba14960db2..6f7b4f9101 100644 --- a/client/ayon_core/pipeline/traits/content.py +++ b/client/ayon_core/pipeline/traits/content.py @@ -16,6 +16,7 @@ from .trait import ( TraitBase, TraitValidationError, ) +from .two_dimensional import UDIM from .utils import get_sequence_from_files @@ -130,14 +131,15 @@ class FileLocations(TraitBase): if representation.contains_trait(FrameRanged): self._validate_frame_range(representation) if not representation.contains_trait(Sequence) \ - and not representation.contains_trait(Bundle): + and not representation.contains_trait(Bundle) \ + and not representation.contains_trait(UDIM): # we have multiple files, but it is not a sequence or bundle - # what it it then? If the files are not related to each other - # then this representation is invalid. + # or UDIM tile set what it it then? If the files are not related + # to each other then this representation is invalid. msg = ( "Multiple file locations defined, but no Sequence or Bundle " - "trait defined. If the files are not related to each other, " - "the representation is invalid." + "or UDIM trait defined. If the files are not related to " + "each other, the representation is invalid." ) raise TraitValidationError(self.name, msg) From 5c8d11198a6f719446f59c4da4c5f70805ed7dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Sat, 30 Nov 2024 01:26:30 +0100 Subject: [PATCH 2/2] :dog: fix indent --- .../ayon_core/pipeline/traits/test_time_traits.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/client/ayon_core/pipeline/traits/test_time_traits.py b/tests/client/ayon_core/pipeline/traits/test_time_traits.py index b903c9eae5..900c4e5842 100644 --- a/tests/client/ayon_core/pipeline/traits/test_time_traits.py +++ b/tests/client/ayon_core/pipeline/traits/test_time_traits.py @@ -82,13 +82,13 @@ def test_sequence_validations() -> None: # do the same but set handles as exclusive representation = Representation(name="test_3", traits=[ FileLocations(file_paths=[ - FileLocation( - file_path=Path(f"/path/to/file.{frame}.exr"), - file_size=1024, - file_hash=None, - ) - for frame in range(996, 1105 + 1) # because range is zero based - ]), + FileLocation( + file_path=Path(f"/path/to/file.{frame}.exr"), + file_size=1024, + file_hash=None, + ) + for frame in range(996, 1105 + 1) # because range is zero based + ]), Handles( frame_start_handle=5, frame_end_handle=5,