feat: initial live syncflag support

This commit is contained in:
Swann
2020-09-25 11:23:36 +02:00
parent 4f731c6640
commit cfc6ce91bc
7 changed files with 103 additions and 106 deletions

View File

@ -99,11 +99,29 @@ class ReplicatedDatablock(bpy.types.PropertyGroup):
icon: bpy.props.StringProperty()
def update_scene_settings(self, value):
from .operators import client
self['sync_render_settings'] = value
if client and bpy.context.scene.uuid and value:
bpy.ops.session.apply('INVOKE_DEFAULT', target=bpy.context.scene.uuid)
class ReplicationFlags(bpy.types.PropertyGroup):
def get_scene_settings(self):
return self.get('sync_render_settings', False)
sync_render_settings: bpy.props.BoolProperty(
name="Synchronize render settings",
description="Synchronize render settings (eevee and cycles only)",
default=True)
default=True,
set=update_scene_settings,
get=get_scene_settings)
sync_during_editmode: bpy.props.BoolProperty(
name="Edit mode updates",
description="Enable objects update in edit mode (! Impact performances !)",
default=False
)
class SessionPrefs(bpy.types.AddonPreferences):
@ -136,8 +154,8 @@ class SessionPrefs(bpy.types.AddonPreferences):
ipc_port: bpy.props.IntProperty(
name="ipc_port",
description='internal ttl port(only usefull for multiple local instances)',
default=5561,
update=update_port
default=random.randrange(5570,70000),
update=update_port,
)
init_method: bpy.props.EnumProperty(
name='init_method',
@ -171,11 +189,6 @@ class SessionPrefs(bpy.types.AddonPreferences):
description='Dependency graph uppdate rate (milliseconds)',
default=100
)
enable_editmode_updates: bpy.props.BoolProperty(
name="Edit mode updates",
description="Enable objects update in edit mode (! Impact performances !)",
default=False
)
clear_memory_filecache: bpy.props.BoolProperty(
name="Clear memory filecache",
description="Remove filecache from memory",