fix: handle apply dependencies
This commit is contained in:
@ -44,7 +44,7 @@ from . import environment
|
||||
|
||||
|
||||
DEPENDENCIES = {
|
||||
("replication", '0.1.2'),
|
||||
("replication", '0.1.3'),
|
||||
}
|
||||
|
||||
|
||||
|
@ -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"}
|
||||
|
||||
|
@ -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):
|
||||
|
Reference in New Issue
Block a user