From fa11fd6899600e59d99c40230d99e8e03d7d4b60 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Jun 2021 17:55:55 +0200 Subject: [PATCH] added version to AvalonInstance data --- openpype/pipeline/creator_plugins.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openpype/pipeline/creator_plugins.py b/openpype/pipeline/creator_plugins.py index 91c9bf3cd6..40b4657d96 100644 --- a/openpype/pipeline/creator_plugins.py +++ b/openpype/pipeline/creator_plugins.py @@ -16,9 +16,10 @@ class AvalonInstance: data(dict): Data used for filling subset name or override data from already existing instance. """ - def __init__(self, family, subset_name, data=None): - + def __init__(self, family, subset_name, data=None, new=True): + # Family of instance self.family = family + # Subset name self.subset_name = subset_name self.data = collections.OrderedDict() @@ -26,6 +27,9 @@ class AvalonInstance: self.data["family"] = family self.data["subset"] = subset_name self.data["active"] = True + # Schema or version? + if new: + self.data["version"] = 1 # Stored family specific attribute values # {key: value} self.data["family_attributes"] = {} @@ -38,6 +42,9 @@ class AvalonInstance: if not self.data.get("uuid"): self.data["uuid"] = str(uuid4()) + if not new and "version" not in self.data: + self.data["version"] = None + @staticmethod def from_existing(instance_data): """Convert instance data from workfile to AvalonInstance."""