From 37e43c6edfe911aabb7578828210f293ba2a374e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Jul 2021 12:06:28 +0200 Subject: [PATCH] added conversion method for publish plugin --- openpype/pipeline/publish_plugins.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openpype/pipeline/publish_plugins.py b/openpype/pipeline/publish_plugins.py index d43c49427e..c896d5ef32 100644 --- a/openpype/pipeline/publish_plugins.py +++ b/openpype/pipeline/publish_plugins.py @@ -15,6 +15,22 @@ class OpenPypePyblishPluginMixin: """ return [] + @classmethod + def convert_attribute_values(cls, attribute_values): + if cls.__name__ not in attribute_values: + return attribute_values + + plugin_values = attribute_values[cls.__name__] + + attr_defs = cls.get_attribute_defs() + for attr_def in attr_defs: + key = attr_def.key + if key in plugin_values: + plugin_values[key] = attr_def.convert_value( + plugin_values[key] + ) + return attribute_values + def set_state(self, percent=None, message=None): """Inner callback of plugin that would help to show in UI state.