mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
added version to AvalonInstance data
This commit is contained in:
parent
ac9575d722
commit
fa11fd6899
1 changed files with 9 additions and 2 deletions
|
|
@ -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."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue