feat: optionnal setting on host

This commit is contained in:
Swann
2020-04-02 18:42:41 +02:00
parent 0783c625d0
commit 9c897745fd
3 changed files with 33 additions and 14 deletions

View File

@ -22,6 +22,8 @@ import mathutils
from .dump_anything import Loader, Dumper
from .bl_datablock import BlDatablock
from ..utils import get_preferences
class BlScene(BlDatablock):
bl_id = "scenes"
bl_class = bpy.types.Scene
@ -101,6 +103,9 @@ class BlScene(BlDatablock):
scene_dumper.depth = 1
scene_dumper.include_filter = None
pref = get_preferences()
if pref.sync_flags.sync_render_settings:
data['eevee'] = scene_dumper.dump(pointer.eevee)
data['cycles'] = scene_dumper.dump(pointer.cycles)
data['view_settings'] = scene_dumper.dump(pointer.view_settings)

View File

@ -48,6 +48,13 @@ class ReplicatedDatablock(bpy.types.PropertyGroup):
icon: bpy.props.StringProperty()
class ReplicationFlags(bpy.types.PropertyGroup):
sync_render_settings: bpy.props.BoolProperty(
name="Synchronize render settings",
description="Synchronize render settings (eevee and cycles only)",
default=True)
class SessionPrefs(bpy.types.AddonPreferences):
bl_idname = __package__
@ -68,6 +75,9 @@ class SessionPrefs(bpy.types.AddonPreferences):
description='Distant host port',
default=5555
)
sync_flags: bpy.props.PointerProperty(
type=ReplicationFlags
)
supported_datablocks: bpy.props.CollectionProperty(
type=ReplicatedDatablock,
)
@ -340,6 +350,7 @@ class SessionProps(bpy.types.PropertyGroup):
classes = (
SessionUser,
SessionProps,
ReplicationFlags,
ReplicatedDatablock,
SessionPrefs,
)

View File

@ -241,6 +241,9 @@ class SESSION_PT_settings_replication(bpy.types.Panel):
# Right managment
if runtime_settings.session_mode == 'HOST':
row = layout.row()
row.prop(settings.sync_flags,"sync_render_settings")
row = layout.row(align=True)
row.label(text="Right strategy:")
row.prop(settings,"right_strategy",text="")