From 431fe0d840ce13f5c9ed94c5fe244db28418bae4 Mon Sep 17 00:00:00 2001 From: Swann Date: Wed, 2 Jun 2021 10:22:37 +0200 Subject: [PATCH] refactor: move lock/unock to porcelain --- multi_user/libs/replication | 2 +- multi_user/operators.py | 13 +++++++++---- multi_user/timers.py | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 45f829b..15d80ab 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 45f829b6aea0393c3f29be7a78a178f78bce58ef +Subproject commit 15d80abe6ddd28fefb896127a01c12777a22a4e1 diff --git a/multi_user/operators.py b/multi_user/operators.py index f628587..72ce941 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -436,10 +436,15 @@ class SessionPropertyRightOperator(bpy.types.Operator): runtime_settings = context.window_manager.session if session: - session.change_owner(self.key, - runtime_settings.clients, - ignore_warnings=True, - affect_dependencies=self.recursive) + if runtime_settings.clients == RP_COMMON: + session.unlock(self.key, + ignore_warnings=True, + affect_dependencies=self.recursive) + else: + session.lock(self.key, + runtime_settings.clients, + ignore_warnings=True, + affect_dependencies=self.recursive) return {"FINISHED"} diff --git a/multi_user/timers.py b/multi_user/timers.py index 74d3adc..b0bca3b 100644 --- a/multi_user/timers.py +++ b/multi_user/timers.py @@ -256,7 +256,7 @@ class DynamicRightSelectTimer(Timer): for obj in bpy.data.objects: object_uuid = getattr(obj, 'uuid', None) if object_uuid: - is_selectable = not session.is_readonly(object_uuid) + is_selectable = not session.repository.is_node_readonly(object_uuid) if obj.hide_select != is_selectable: obj.hide_select = is_selectable