From 9f8222afa7a4675678d3a8fda2e73543fcb6e0da Mon Sep 17 00:00:00 2001 From: Swann Date: Thu, 15 Oct 2020 12:11:28 +0200 Subject: [PATCH] fix: handle apply dependencies --- multi_user/__init__.py | 2 +- multi_user/operators.py | 5 ++++- multi_user/preferences.py | 8 ++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/multi_user/__init__.py b/multi_user/__init__.py index 915314d..41e248b 100644 --- a/multi_user/__init__.py +++ b/multi_user/__init__.py @@ -44,7 +44,7 @@ from . import environment DEPENDENCIES = { - ("replication", '0.1.2'), + ("replication", '0.1.3'), } diff --git a/multi_user/operators.py b/multi_user/operators.py index fee3b4c..d5fc58e 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -556,6 +556,7 @@ class SessionApply(bpy.types.Operator): bl_options = {"REGISTER"} target: bpy.props.StringProperty() + reset_dependencies: bpy.props.BoolProperty(default=False) @classmethod def poll(cls, context): @@ -563,7 +564,9 @@ class SessionApply(bpy.types.Operator): def execute(self, context): logging.debug(f"Running apply on {self.target}") - session.apply(self.target, force=True) + session.apply(self.target, + force=True, + force_dependencies=self.reset_dependencies) return {"FINISHED"} diff --git a/multi_user/preferences.py b/multi_user/preferences.py index 0be7b06..d728c9c 100644 --- a/multi_user/preferences.py +++ b/multi_user/preferences.py @@ -103,14 +103,18 @@ class ReplicatedDatablock(bpy.types.PropertyGroup): def set_sync_render_settings(self, value): self['sync_render_settings'] = value if session and bpy.context.scene.uuid and value: - bpy.ops.session.apply('INVOKE_DEFAULT', target=bpy.context.scene.uuid) + bpy.ops.session.apply('INVOKE_DEFAULT', + target=bpy.context.scene.uuid, + reset_dependencies=False) def set_sync_active_camera(self, value): self['sync_active_camera'] = value if session and bpy.context.scene.uuid and value: - bpy.ops.session.apply('INVOKE_DEFAULT', target=bpy.context.scene.uuid) + bpy.ops.session.apply('INVOKE_DEFAULT', + target=bpy.context.scene.uuid, + reset_dependencies=False) class ReplicationFlags(bpy.types.PropertyGroup):