Compare commits

...

4 Commits

Author SHA1 Message Date
Swann 45437660ba clean: remove unused lock 2020-10-22 17:37:53 +02:00
Swann ee93a5b209 Merge branch 'develop' into 132-fix-undo-edit-last-operation-redo-handling 2020-10-22 16:21:31 +02:00
Swann 4bd0055056 Merge branch 'develop' into 132-fix-undo-edit-last-operation-redo-handling 2020-10-16 14:57:36 +02:00
Swann f151c61d7b feat: mimic blender undo handling 2020-10-15 17:21:14 +02:00
3 changed files with 17 additions and 11 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ from . import environment
DEPENDENCIES = {
("replication", '0.1.6'),
("replication", '0.2.0'),
}
+12 -8
View File
@@ -127,9 +127,9 @@ class BlDatablock(ReplicatedDatablock):
if instance and hasattr(instance, 'uuid'):
instance.uuid = self.uuid
self.diff_method = DIFF_BINARY
# self.diff_method = DIFF_BINARY
def resolve(self):
def resolve(self, construct = True):
datablock_ref = None
datablock_root = getattr(bpy.data, self.bl_id)
datablock_ref = utils.find_from_attr('uuid', self.uuid, datablock_root)
@@ -138,15 +138,19 @@ class BlDatablock(ReplicatedDatablock):
try:
datablock_ref = datablock_root[self.data['name']]
except Exception:
name = self.data.get('name')
logging.debug(f"Constructing {name}")
datablock_ref = self._construct(data=self.data)
if construct:
name = self.data.get('name')
logging.debug(f"Constructing {name}")
datablock_ref = self._construct(data=self.data)
if datablock_ref:
if datablock_ref is not None:
setattr(datablock_ref, 'uuid', self.uuid)
self.instance = datablock_ref
return True
else:
return False
self.instance = datablock_ref
def remove_instance(self):
"""
Remove instance from blender data
+4 -2
View File
@@ -697,10 +697,12 @@ def sanitize_deps_graph(dummy):
A future solution should be to avoid storing dataclock reference...
"""
if session and session.state['STATE'] == STATE_ACTIVE:
for node_key in session.list():
session.get(node_key).resolve()
node = session.get(node_key)
if node and not node.resolve(construct=False):
session.remove(node_key)
@persistent
def load_pre_handler(dummy):