From eaf580bf3b6d533c1f330dcc8cf56d95c20ef6ae Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 19 Mar 2024 14:24:24 +0100 Subject: [PATCH] 'root_value_for_template' can handle 'StringTemplate' object --- client/ayon_core/pipeline/anatomy/anatomy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/anatomy/anatomy.py b/client/ayon_core/pipeline/anatomy/anatomy.py index 4c16f20a44..658f5fe3fc 100644 --- a/client/ayon_core/pipeline/anatomy/anatomy.py +++ b/client/ayon_core/pipeline/anatomy/anatomy.py @@ -7,7 +7,7 @@ import time import ayon_api -from ayon_core.lib import Logger, get_local_site_id +from ayon_core.lib import Logger, get_local_site_id, StringTemplate from ayon_core.addon import AddonsManager from .exceptions import RootCombinationError, ProjectNotSet @@ -204,6 +204,8 @@ class BaseAnatomy(object): def root_value_for_template(self, template): """Returns value of root key from template.""" + if isinstance(template, StringTemplate): + template = template.template root_templates = [] for group in re.findall(self.root_key_regex, template): root_templates.append("{" + group + "}")