feat: initial support for new scenes

This commit is contained in:
Swann 2021-01-21 14:48:07 +01:00
parent 5949e3c5cc
commit 8f95158f08
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB
2 changed files with 10 additions and 7 deletions

View File

@ -281,13 +281,9 @@ class BlScene(BlDatablock):
bl_icon = 'SCENE_DATA'
bl_reload_parent = False
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.diff_method = DIFF_JSON
def _construct(self, data):
instance = bpy.data.scenes.new(data["name"])
instance.uuid = self.uuid
return instance
def _load_implementation(self, data, target):

View File

@ -1025,8 +1025,15 @@ def depsgraph_evaluation(scene):
logging.error(e)
else:
continue
# A new scene is created
elif isinstance(update.id, bpy.types.Scene):
ref = session.get(reference=update.id)
if ref:
ref.resolve()
else:
scn_uuid = session.add(update.id)
session.commit(scn_uuid)
session.push(scn_uuid, check_data=False)
def register():
from bpy.utils import register_class