From 1232fd9e2cc9af3f429d2a0b168cab34c9173d9d Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:19:34 +0200 Subject: [PATCH] auto-fix udim path calculation --- client/ayon_core/pipeline/load/utils.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/client/ayon_core/pipeline/load/utils.py b/client/ayon_core/pipeline/load/utils.py index 7f2bec6d34..a2e463ada0 100644 --- a/client/ayon_core/pipeline/load/utils.py +++ b/client/ayon_core/pipeline/load/utils.py @@ -639,6 +639,14 @@ def get_representation_path_with_anatomy(repre_entity, anatomy): try: context = repre_entity["context"] context["root"] = anatomy.roots + + # Auto-fix 'udim' being list of integers + # - This is a legacy issue for old representation entities, + # added 24/07/10 + udim = context.get("udim") + if isinstance(udim, list): + context["udim"] = udim[0] + path = StringTemplate.format_strict_template(template, context) except TemplateUnsolved as exc: @@ -681,6 +689,14 @@ def get_representation_path(representation, root=None): try: context = representation["context"] + + # Auto-fix 'udim' being list of integers + # - This is a legacy issue for old representation entities, + # added 24/07/10 + udim = context.get("udim") + if isinstance(udim, list): + context["udim"] = udim[0] + context["root"] = root path = StringTemplate.format_strict_template( template, context