From 4bc0feb3a5bb4349be33be70eb5cd0a75864543e Mon Sep 17 00:00:00 2001 From: Swann Date: Fri, 23 Jul 2021 19:35:56 +0200 Subject: [PATCH] fix: ReferenceError in update_external dependency by removing orphan nodes. --- multi_user/handlers.py | 7 +++++-- multi_user/libs/replication | 2 +- multi_user/operators.py | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/multi_user/handlers.py b/multi_user/handlers.py index 90f1bed..d6f936e 100644 --- a/multi_user/handlers.py +++ b/multi_user/handlers.py @@ -79,8 +79,6 @@ def on_scene_update(scene): logging.debug(f"Ignoring distant update of {dependency_updates[0].id.name}") return - update_external_dependencies() - # NOTE: maybe we don't need to check each update but only the first for update in reversed(dependency_updates): update_uuid = getattr(update.id, 'uuid', None) @@ -109,6 +107,11 @@ def on_scene_update(scene): porcelain.commit(session.repository, scn_uuid) porcelain.push(session.repository, 'origin', scn_uuid) + scene_graph_changed = [u for u in reversed(dependency_updates) if getattr(u.id, 'uuid', None) and isinstance(u.id,(bpy.types.Scene,bpy.types.Collection))] + if scene_graph_changed: + porcelain.purge_orphan_nodes(session.repository) + + update_external_dependencies() @persistent def resolve_deps_graph(dummy): diff --git a/multi_user/libs/replication b/multi_user/libs/replication index a44313e..15dc5c6 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit a44313e6473bfb514bb2fb79fce5e1abf172dc87 +Subproject commit 15dc5c62c07a3e0025a82d87022f5073c019e7e9 diff --git a/multi_user/operators.py b/multi_user/operators.py index 47b9778..43148ed 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -689,7 +689,6 @@ class SessionPurgeOperator(bpy.types.Operator): def execute(self, context): try: - sanitize_deps_graph(remove_nodes=True) porcelain.purge_orphan_nodes(session.repository) except Exception as e: self.report({'ERROR'}, repr(e))