refactor: move lock/unock to porcelain

This commit is contained in:
Swann 2021-06-02 10:22:37 +02:00
parent df7ca66ad8
commit 431fe0d840
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB
3 changed files with 11 additions and 6 deletions

@ -1 +1 @@
Subproject commit 45f829b6aea0393c3f29be7a78a178f78bce58ef
Subproject commit 15d80abe6ddd28fefb896127a01c12777a22a4e1

View File

@ -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"}

View File

@ -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