From c3aff4deb2751796178ee94940abf437658bec13 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:21:16 +0200 Subject: [PATCH] implemented similar logic to create attributes --- client/ayon_core/tools/publisher/models/create.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/tools/publisher/models/create.py b/client/ayon_core/tools/publisher/models/create.py index 493fcc3b01..f2a7901e42 100644 --- a/client/ayon_core/tools/publisher/models/create.py +++ b/client/ayon_core/tools/publisher/models/create.py @@ -717,8 +717,16 @@ class CreateModel: for instance_id in instance_ids: instance = self._get_instance_by_id(instance_id) creator_attributes = instance["creator_attributes"] - if key in creator_attributes: - creator_attributes[key] = value + attr_def = creator_attributes.get_attr_def(key) + if ( + attr_def is None + or not attr_def.is_value_def + or not attr_def.visible + or not attr_def.enabled + or not attr_def.is_value_valid(value) + ): + continue + creator_attributes[key] = value def get_creator_attribute_definitions( self, instance_ids: List[str]