From a141e9bfe7db0522324baffa50d165ed7e3d88f9 Mon Sep 17 00:00:00 2001 From: Swann Date: Sun, 23 Feb 2020 14:08:45 +0100 Subject: [PATCH 01/12] feat: stash on deps graph update --- multi_user/libs/replication | 2 +- multi_user/operators.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 19d018e..343c9d5 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 19d018e31b050a5a223f05910a7948645d9f0fdb +Subproject commit 343c9d527c225e2573ed6add92f6f7d0e8ac9082 diff --git a/multi_user/operators.py b/multi_user/operators.py index 72485ab..0000364 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -493,19 +493,21 @@ def depsgraph_evaluation(scene): # - if its ours or ( under common and diff), launch the # update process # - if its to someone else, ignore the update (go deeper ?) - if node.owner == session_infos.username: + if node.owner in [session_infos.username]: # Avoid slow geometry update if 'EDIT' in context.mode: break - logger.error("UPDATE: MODIFIFY {}".format(type(update.id))) - # client.commit(node.uuid) - # client.push(node.uuid) + client.stash(node.uuid) + # TODO: Do this from replication api...Maybe as a task ! + if node.owner == 'COMMON': + if node.diff(): + client.stash(node.uuid) else: # Distant update continue # else: # # New items ! - # logger.error("UPDATE: ADD")C.obj + # logger.error("UPDATE: ADD") def register(): @@ -520,7 +522,7 @@ def register(): bpy.app.handlers.frame_change_pre.append(update_client_frame) - # bpy.app.handlers.depsgraph_update_post.append(depsgraph_evaluation) + bpy.app.handlers.depsgraph_update_post.append(depsgraph_evaluation) def unregister(): @@ -541,7 +543,7 @@ def unregister(): bpy.app.handlers.frame_change_pre.remove(update_client_frame) - # bpy.app.handlers.depsgraph_update_post.remove(depsgraph_evaluation) + bpy.app.handlers.depsgraph_update_post.remove(depsgraph_evaluation) if __name__ == "__main__": From fc9ab1a7e6bb5e45a8db740b6cdc9cdbfdaf305a Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Tue, 25 Feb 2020 17:38:43 +0100 Subject: [PATCH 02/12] feat: update submodule --- multi_user/libs/replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 343c9d5..19b4eaf 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 343c9d527c225e2573ed6add92f6f7d0e8ac9082 +Subproject commit 19b4eafda23cdd073a18ab1998d556617c7b8a29 From 549b0b3784cd1ef1447c2240f7e545bbaee3b791 Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Tue, 25 Feb 2020 17:40:00 +0100 Subject: [PATCH 03/12] fix: submodule version --- multi_user/libs/replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 19b4eaf..343c9d5 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 19b4eafda23cdd073a18ab1998d556617c7b8a29 +Subproject commit 343c9d527c225e2573ed6add92f6f7d0e8ac9082 From 292f76aea59145e4d6e6d275c0ad4d671acb1040 Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Fri, 28 Feb 2020 15:39:29 +0100 Subject: [PATCH 04/12] feat: move diff to observer feat: logs --- multi_user/bl_types/bl_datablock.py | 2 +- multi_user/libs/replication | 2 +- multi_user/operators.py | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/multi_user/bl_types/bl_datablock.py b/multi_user/bl_types/bl_datablock.py index f54cbb4..f1780c2 100644 --- a/multi_user/bl_types/bl_datablock.py +++ b/multi_user/bl_types/bl_datablock.py @@ -81,7 +81,7 @@ class BlDatablock(ReplicatedDatablock): if self.pointer and hasattr(self.pointer, 'uuid'): self.pointer.uuid = self.uuid - self.diff_method = DIFF_BINARY + # self.diff_method = DIFF_BINARY def library_apply(self): """Apply stored data diff --git a/multi_user/libs/replication b/multi_user/libs/replication index ed2f080..1aab152 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit ed2f080bce952db6756016798d606b915bdf67a8 +Subproject commit 1aab152fa36e11a6f99ff03e5d2bb6b1f9d344d5 diff --git a/multi_user/operators.py b/multi_user/operators.py index 0b8bcc0..d7f66e4 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -497,15 +497,11 @@ def depsgraph_evaluation(scene): # - if its ours or ( under common and diff), launch the # update process # - if its to someone else, ignore the update (go deeper ?) - if node.owner in [session_infos.username]: + if node.owner in [session_infos.username, 'COMMON']: # Avoid slow geometry update if 'EDIT' in context.mode: break client.stash(node.uuid) - # TODO: Do this from replication api...Maybe as a task ! - if node.owner == 'COMMON': - if node.diff(): - client.stash(node.uuid) else: # Distant update continue From b2475081b6e7f45e3ee583d0f1e3ff04c08d7f5c Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Wed, 4 Mar 2020 18:28:42 +0100 Subject: [PATCH 05/12] feat: id accessor --- multi_user/libs/replication | 2 +- multi_user/operators.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 1aab152..cb31158 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 1aab152fa36e11a6f99ff03e5d2bb6b1f9d344d5 +Subproject commit cb31158d22cb696778e1e4a13b22d6e1e15d1a9a diff --git a/multi_user/operators.py b/multi_user/operators.py index a3a77e1..d528b06 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -496,7 +496,7 @@ def depsgraph_evaluation(scene): # - if its ours or ( under common and diff), launch the # update process # - if its to someone else, ignore the update (go deeper ?) - if node.owner in [session_infos.username, 'COMMON']: + if node.owner in [client.id, 'COMMON']: # Avoid slow geometry update if 'EDIT' in context.mode: break From 9b8d69042d96bc2f76801edd76e336df9f36fcf2 Mon Sep 17 00:00:00 2001 From: Swann Date: Wed, 4 Mar 2020 22:28:34 +0100 Subject: [PATCH 06/12] feat: update submodule --- multi_user/libs/replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index cb31158..4164f90 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit cb31158d22cb696778e1e4a13b22d6e1e15d1a9a +Subproject commit 4164f90e7c86e2fbf31f64a759869178dda0eca0 From 50d14e663e6439b0a9ccb72412e929695b3cf8dd Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Thu, 5 Mar 2020 10:56:17 +0100 Subject: [PATCH 07/12] feat: update sumbodules --- multi_user/libs/replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 4164f90..cb31158 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 4164f90e7c86e2fbf31f64a759869178dda0eca0 +Subproject commit cb31158d22cb696778e1e4a13b22d6e1e15d1a9a From adeb694b2d59107f11bb15ec3d23ea648302fe48 Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Thu, 5 Mar 2020 15:38:20 +0100 Subject: [PATCH 08/12] feat: one apply timer for all --- multi_user/delayable.py | 7 +++---- multi_user/libs/replication | 2 +- multi_user/operators.py | 9 ++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/multi_user/delayable.py b/multi_user/delayable.py index 199cbee..6b52ee3 100644 --- a/multi_user/delayable.py +++ b/multi_user/delayable.py @@ -59,21 +59,20 @@ class Timer(Delayable): class ApplyTimer(Timer): - def __init__(self, timout=1, target_type=None): - self._type = target_type + def __init__(self, timout=1): super().__init__(timout) def execute(self): client = operators.client if client and client.state['STATE'] == STATE_ACTIVE: - nodes = client.list(filter=self._type) + nodes = client.list() for node in nodes: node_ref = client.get(uuid=node) if node_ref.state == FETCHED: try: - client.apply(node) + client.apply(node, force=True) except Exception as e: logger.error( "fail to apply {}: {}".format(node_ref.uuid, e)) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index cb31158..5b2425c 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit cb31158d22cb696778e1e4a13b22d6e1e15d1a9a +Subproject commit 5b2425c44dd6deb5fbba6659a657c41c6d07c7ef diff --git a/multi_user/operators.py b/multi_user/operators.py index d528b06..5427636 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -87,16 +87,13 @@ class SessionStartOperator(bpy.types.Operator): timer=type_local_config.bl_delay_refresh, automatic=type_local_config.auto_push) - if type_local_config.bl_delay_apply > 0: - delayables.append(delayable.ApplyTimer( - timout=type_local_config.bl_delay_apply, - target_type=type_module_class)) - client = Session( factory=bpy_factory, python_path=bpy.app.binary_path_python, default_strategy=settings.right_strategy) + delayables.append(delayable.ApplyTimer()) + # Host a session if self.host: # Scene setup @@ -500,6 +497,8 @@ def depsgraph_evaluation(scene): # Avoid slow geometry update if 'EDIT' in context.mode: break + + logger.error(node.data['name']) client.stash(node.uuid) else: # Distant update From 25c19471bb3bb9630cb47cc36ceb197840c5d6c5 Mon Sep 17 00:00:00 2001 From: Swann Date: Fri, 15 May 2020 18:23:51 +0200 Subject: [PATCH 09/12] feat: update submodule --- multi_user/libs/replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index e991835..1fb796a 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit e991835a15c154e005f6543e45d8071ac08ab65d +Subproject commit 1fb796a267eaac493e83bc9228d540a78715ecc8 From 5d52fb2460a661868bb2b4cefda42a0f695653b9 Mon Sep 17 00:00:00 2001 From: Swann Date: Fri, 7 Aug 2020 15:08:08 +0200 Subject: [PATCH 10/12] fix: avoid build ci from running on other branch than develop and master --- .gitlab/ci/build.gitlab-ci.yml | 5 ++++- multi_user/__init__.py | 2 +- multi_user/operators.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml index 7347013..b7a0716 100644 --- a/.gitlab/ci/build.gitlab-ci.yml +++ b/.gitlab/ci/build.gitlab-ci.yml @@ -8,5 +8,8 @@ build: name: multi_user paths: - multi_user - + only: + refs: + - master + - develop diff --git a/multi_user/__init__.py b/multi_user/__init__.py index 70586ed..13e990a 100644 --- a/multi_user/__init__.py +++ b/multi_user/__init__.py @@ -45,7 +45,7 @@ from . import environment, utils # TODO: remove dependency as soon as replication will be installed as a module DEPENDENCIES = { - ("replication", '0.0.20'), + ("replication", '0.1.0'), ("deepdiff", '5.0.1'), } diff --git a/multi_user/operators.py b/multi_user/operators.py index 762d08b..256f8d1 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -35,7 +35,7 @@ from bpy.app.handlers import persistent from . import bl_types, delayable, environment, presence, ui, utils from replication.constants import (FETCHED, STATE_ACTIVE, STATE_INITIAL, - STATE_SYNCING) + STATE_SYNCING, RP_COMMON, UP) from replication.data import ReplicatedDataFactory from replication.exception import NonAuthorizedOperationError from replication.interface import Session @@ -623,7 +623,7 @@ def depsgraph_evaluation(scene): # - if its ours or ( under common and diff), launch the # update process # - if its to someone else, ignore the update (go deeper ?) - if node.owner in [client.id, 'COMMON'] and node.state == UP: + if node.owner in [client.id, RP_COMMON] and node.state == UP: # Avoid slow geometry update if 'EDIT' in context.mode: break From 49a419cbe2ed1c600c1b3f4c85640ca397258353 Mon Sep 17 00:00:00 2001 From: Swann Date: Fri, 7 Aug 2020 15:38:11 +0200 Subject: [PATCH 11/12] fix: none result while trying to access a node --- multi_user/operators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi_user/operators.py b/multi_user/operators.py index 256f8d1..f6d562c 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -623,7 +623,7 @@ def depsgraph_evaluation(scene): # - if its ours or ( under common and diff), launch the # update process # - if its to someone else, ignore the update (go deeper ?) - if node.owner in [client.id, RP_COMMON] and node.state == UP: + if node and node.owner in [client.id, RP_COMMON] and node.state == UP: # Avoid slow geometry update if 'EDIT' in context.mode: break From 4b07ae0cc314871dc4e33c5f8ea8c8b7dda3aa9d Mon Sep 17 00:00:00 2001 From: Swann Date: Fri, 7 Aug 2020 15:47:05 +0200 Subject: [PATCH 12/12] fix: fix test condition --- .gitlab/ci/test.gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/test.gitlab-ci.yml b/.gitlab/ci/test.gitlab-ci.yml index 9c0dc6b..5291cc8 100644 --- a/.gitlab/ci/test.gitlab-ci.yml +++ b/.gitlab/ci/test.gitlab-ci.yml @@ -10,5 +10,7 @@ test: - apt install -f -y blender - python -m pip install blender-addon-tester - python scripts/test_addon.py - - + only: + refs: + - master + - develop