From b6d3bf379e34c23c43598d1ec82fc5b57e234958 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 6 Sep 2024 00:31:42 +0200 Subject: [PATCH] Add label only if not same as shot name. In recent versions of AYON the "label" is always set by default and matches the "name" whereas previously, "label" defaulted to an empty value. Hence, due to that update, this logic now needed to change to correctly detect whether a customized label was set. --- client/ayon_maya/plugins/create/create_multishot_layout.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ayon_maya/plugins/create/create_multishot_layout.py b/client/ayon_maya/plugins/create/create_multishot_layout.py index 52298231..bc74a3b6 100644 --- a/client/ayon_maya/plugins/create/create_multishot_layout.py +++ b/client/ayon_maya/plugins/create/create_multishot_layout.py @@ -161,8 +161,10 @@ def create(self, product_name, instance_data, pre_create_data): layout_task_name = pre_create_data["taskName"] layout_task_entity = task_entities[layout_task_name] - shot_name = f"{shot['name']}%s" % ( - f" ({shot['label']})" if shot["label"] else "") + shot_name = shot['name'] + if shot["label"] and shot["label"] != shot_name: + shot_name += f" ({shot['label']})" + cmds.shot(sequenceStartTime=shot["attrib"]["clipIn"], sequenceEndTime=shot["attrib"]["clipOut"], shotName=shot_name)