feat: delta commit

This commit is contained in:
Swann
2021-05-09 17:42:56 +02:00
parent 32033c743c
commit a67be76422
4 changed files with 7 additions and 8 deletions

View File

@ -21,7 +21,7 @@ from pathlib import Path
import bpy import bpy
import mathutils import mathutils
from deepdiff import DeepDiff from deepdiff import DeepDiff, Delta
from replication.constants import DIFF_JSON, MODIFIED from replication.constants import DIFF_JSON, MODIFIED
from ..utils import flush_history from ..utils import flush_history
@ -555,4 +555,4 @@ class BlScene(BlDatablock):
if not self.preferences.sync_flags.sync_active_camera: if not self.preferences.sync_flags.sync_active_camera:
exclude_path.append("root['camera']") exclude_path.append("root['camera']")
return DeepDiff(self.data, self._dump(instance=self.instance), exclude_paths=exclude_path) return Delta(DeepDiff(self.data, self._dump(instance=self.instance), exclude_paths=exclude_path))

View File

@ -930,8 +930,7 @@ def update_external_dependencies():
nodes_ids = session.list(filter=bl_types.bl_file.BlFile) nodes_ids = session.list(filter=bl_types.bl_file.BlFile)
for node_id in nodes_ids: for node_id in nodes_ids:
node = session.repository.get_node(node_id) node = session.repository.get_node(node_id)
if node and node.owner in [session.id, RP_COMMON] \ if node and node.owner in [session.id, RP_COMMON]:
and node.has_changed():
session.commit(node_id) session.commit(node_id)
session.push(node_id, check_data=False) session.push(node_id, check_data=False)
@ -1004,7 +1003,6 @@ def depsgraph_evaluation(scene):
if node and (node.owner == session.id or node.bl_check_common): if node and (node.owner == session.id or node.bl_check_common):
if node.state == UP: if node.state == UP:
try: try:
if node.has_changed():
session.commit(node.uuid) session.commit(node.uuid)
session.push(node.uuid, check_data=False) session.push(node.uuid, check_data=False)
except ReferenceError: except ReferenceError:

View File

@ -72,6 +72,7 @@ class Timer(object):
except Exception as e: except Exception as e:
logging.error(e) logging.error(e)
self.unregister() self.unregister()
traceback.print_exc()
session.disconnect(reason=f"Error during timer {self.id} execution") session.disconnect(reason=f"Error during timer {self.id} execution")
else: else:
if self.is_running: if self.is_running: