From 9cf725d4d9c5fad2cdcb12e3215316ada022eef9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 13 Jul 2021 12:51:59 +0200 Subject: [PATCH] added static method calculate changes --- openpype/pipeline/creator_plugins.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openpype/pipeline/creator_plugins.py b/openpype/pipeline/creator_plugins.py index 34cf1e845f..ce1a0a3946 100644 --- a/openpype/pipeline/creator_plugins.py +++ b/openpype/pipeline/creator_plugins.py @@ -96,14 +96,18 @@ class FamilyAttributeValues: def attr_defs(self): return self._attr_defs - def changes(self): + @staticmethod + def calculate_changes(new_data, old_data): changes = {} - for key, new_value in self._data.items(): - old_value = self._last_data.get(key) + for key, new_value in new_data.items(): + old_value = old_data.get(key) if old_value != new_value: changes[key] = (old_value, new_value) return changes + def changes(self): + return self.calculate_changes(self._data, self._last_data) + def _propagate_changes(self, changes=None): if self._chunk_value > 0: return