From e2ad2ce9c52e7cf72ca1f7724654c959ab79fd3f Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:31:04 +0200 Subject: [PATCH] autoconvert values --- client/ayon_core/pipeline/create/structures.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/pipeline/create/structures.py b/client/ayon_core/pipeline/create/structures.py index 79a1e61a55..9a89cb2e4d 100644 --- a/client/ayon_core/pipeline/create/structures.py +++ b/client/ayon_core/pipeline/create/structures.py @@ -113,7 +113,10 @@ class AttributeValues: self._data = {} for attr_def in attr_defs: value = values.get(attr_def.key) - if value is not None: + if value is None: + continue + converted_value = attr_def.convert_value(value) + if converted_value == value: self._data[attr_def.key] = value def __setitem__(self, key, value): @@ -339,13 +342,6 @@ class PublishAttributes: if value is None: value = {} - for attr_def in attr_defs: - if isinstance(attr_def, (UIDef, UnknownDef)): - continue - key = attr_def.key - if key in value: - value[key] = attr_def.convert_value(value[key]) - self._data[plugin_name] = PublishAttributeValues( self, plugin_name, attr_defs, value, value )