diff --git a/__init__.py b/__init__.py index 1169a46..2171d12 100644 --- a/__init__.py +++ b/__init__.py @@ -118,7 +118,7 @@ class SessionProps(bpy.types.PropertyGroup): init_scene: bpy.props.BoolProperty(name="init_scene", default=True) start_empty: bpy.props.BoolProperty( name="start_empty", - default=False, + default=True, update=save_session_config) active_object: bpy.props.PointerProperty( name="active_object", type=bpy.types.Object) diff --git a/bl_types/bl_gpencil.py b/bl_types/bl_gpencil.py index 86bdc18..618899c 100644 --- a/bl_types/bl_gpencil.py +++ b/bl_types/bl_gpencil.py @@ -5,6 +5,7 @@ from jsondiff import diff from .. import utils from .bl_datablock import BlDatablock + def load_gpencil_layer(target=None, data=None, create=False): utils.dump_anything.load(target, data) @@ -31,15 +32,16 @@ def load_gpencil_layer(target=None, data=None, create=False): utils.dump_anything.load(tpoint, p) + class BlGpencil(BlDatablock): def __init__(self, *args, **kwargs): self.icon = 'GREASEPENCIL' - super().__init__( *args, **kwargs) - - def construct(self,data): + super().__init__(*args, **kwargs) + + def construct(self, data): return bpy.data.grease_pencils.new(data["name"]) - + def load(self, data, target): for layer in target.layers: target.layers.remove(layer) @@ -70,19 +72,20 @@ class BlGpencil(BlDatablock): utils.dump_datablock_attibutes( pointer, ['layers'], 9, data) return data - + def resolve(self): - assert(self.buffer) + assert(self.buffer) self.pointer = bpy.data.grease_pencils.get(self.buffer['name']) def resolve_dependencies(self): deps = [] - + for material in self.pointer.materials: deps.append(material) - + return deps + bl_id = "grease_pencils" bl_class = bpy.types.GreasePencil bl_rep_class = BlGpencil diff --git a/libs/replication b/libs/replication index 0c54c24..52ec856 160000 --- a/libs/replication +++ b/libs/replication @@ -1 +1 @@ -Subproject commit 0c54c24c9fdbb4e5297064a5b0311fe19eb4c2d5 +Subproject commit 52ec8569b491fcd0d5699d51f337f70dbb2bc0ef diff --git a/operators.py b/operators.py index 6792b69..63f1210 100644 --- a/operators.py +++ b/operators.py @@ -66,10 +66,6 @@ class SessionStartOperator(bpy.types.Operator): # save config settings.save(context) - # Scene setup - if settings.start_empty: - utils.clean_scene() - bpy_factory = ReplicatedDataFactory() supported_bl_types = [] @@ -92,13 +88,21 @@ class SessionStartOperator(bpy.types.Operator): client = Session(factory=bpy_factory) if self.host: + # Scene setup + if settings.start_empty: + utils.clean_scene() + client.host( id=settings.username, address=settings.ip, port=settings.port ) settings.is_admin = True + + else: + utils.clean_scene() + client.connect( id=settings.username, address=settings.ip, diff --git a/ui.py b/ui.py index d0ff2fb..5e76919 100644 --- a/ui.py +++ b/ui.py @@ -83,9 +83,6 @@ class SESSION_PT_settings_network(bpy.types.Panel): row.label(text="draw overlay:") row.prop(settings, "enable_presence", text="") row = layout.row() - row.label(text="clear blend:") - row.prop(settings, "start_empty", text="") - row = layout.row() row = layout.row() row.prop(settings, "session_mode", expand=True) @@ -94,6 +91,9 @@ class SESSION_PT_settings_network(bpy.types.Panel): if settings.session_mode == 'HOST': box = row.box() row = box.row() + row.label(text="clear blend:") + row.prop(settings, "start_empty", text="") + row = box.row() row.label(text="init scene:") row.prop(settings, "init_scene", text="") row = box.row()