feat: clean scene ui consistency
This commit is contained in:
parent
7e14227337
commit
baa59e8b4b
@ -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)
|
||||
|
@ -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,13 +32,14 @@ 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)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def construct(self,data):
|
||||
def construct(self, data):
|
||||
return bpy.data.grease_pencils.new(data["name"])
|
||||
|
||||
def load(self, data, target):
|
||||
@ -83,6 +85,7 @@ class BlGpencil(BlDatablock):
|
||||
|
||||
return deps
|
||||
|
||||
|
||||
bl_id = "grease_pencils"
|
||||
bl_class = bpy.types.GreasePencil
|
||||
bl_rep_class = BlGpencil
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 0c54c24c9fdbb4e5297064a5b0311fe19eb4c2d5
|
||||
Subproject commit 52ec8569b491fcd0d5699d51f337f70dbb2bc0ef
|
12
operators.py
12
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,
|
||||
|
6
ui.py
6
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user