fix: handle apply dependencies

This commit is contained in:
Swann
2020-10-15 12:11:28 +02:00
parent 1828bfac22
commit 9f8222afa7
3 changed files with 11 additions and 4 deletions

View File

@ -44,7 +44,7 @@ from . import environment
DEPENDENCIES = { DEPENDENCIES = {
("replication", '0.1.2'), ("replication", '0.1.3'),
} }

View File

@ -556,6 +556,7 @@ class SessionApply(bpy.types.Operator):
bl_options = {"REGISTER"} bl_options = {"REGISTER"}
target: bpy.props.StringProperty() target: bpy.props.StringProperty()
reset_dependencies: bpy.props.BoolProperty(default=False)
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
@ -563,7 +564,9 @@ class SessionApply(bpy.types.Operator):
def execute(self, context): def execute(self, context):
logging.debug(f"Running apply on {self.target}") 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"} return {"FINISHED"}

View File

@ -103,14 +103,18 @@ class ReplicatedDatablock(bpy.types.PropertyGroup):
def set_sync_render_settings(self, value): def set_sync_render_settings(self, value):
self['sync_render_settings'] = value self['sync_render_settings'] = value
if session and bpy.context.scene.uuid and 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): def set_sync_active_camera(self, value):
self['sync_active_camera'] = value self['sync_active_camera'] = value
if session and bpy.context.scene.uuid and 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): class ReplicationFlags(bpy.types.PropertyGroup):