feat: move clean_scene to uils
This commit is contained in:
Submodule libs/replication updated: 3765639ce9...4310938b53
16
operators.py
16
operators.py
@ -41,15 +41,7 @@ execution_queue = queue.Queue()
|
||||
# return .1
|
||||
|
||||
|
||||
# def clean_scene(elements=environment.rtypes):
|
||||
# for datablock in elements:
|
||||
# datablock_ref = getattr(bpy.data, utils.BPY_TYPES[datablock])
|
||||
# for item in datablock_ref:
|
||||
# try:
|
||||
# datablock_ref.remove(item)
|
||||
# # Catch last scene remove
|
||||
# except RuntimeError:
|
||||
# pass
|
||||
|
||||
|
||||
|
||||
# def upload_client_instance_position():
|
||||
@ -94,7 +86,7 @@ def init_supported_datablocks(supported_types_id):
|
||||
for type_id in supported_types_id:
|
||||
for item in getattr(bpy.data,type_id):
|
||||
print(item)
|
||||
client.register(item)
|
||||
client.add(item)
|
||||
|
||||
|
||||
# def default_tick():
|
||||
@ -139,8 +131,8 @@ class SessionStartOperator(bpy.types.Operator):
|
||||
settings.save(context)
|
||||
|
||||
# Scene setup
|
||||
# if settings.start_empty:
|
||||
# clean_scene()
|
||||
if settings.start_empty:
|
||||
utils.clean_scene()
|
||||
|
||||
bpy_factory = ReplicatedDataFactory()
|
||||
supported_bl_types = []
|
||||
|
24
ui.py
24
ui.py
@ -41,8 +41,6 @@ class SESSION_PT_settings(bpy.types.Panel):
|
||||
row = box.row()
|
||||
|
||||
|
||||
|
||||
|
||||
# NETWORK SETTINGS
|
||||
row = layout.row()
|
||||
box = row.box()
|
||||
@ -84,16 +82,16 @@ class SESSION_PT_settings(bpy.types.Panel):
|
||||
row.operator("session.start", text="CONNECT").host = False
|
||||
|
||||
# REPLICATION SETTINGS
|
||||
row = layout.row()
|
||||
box = row.box()
|
||||
row = box.row()
|
||||
row.label(text="REPLICATION", icon='TRIA_RIGHT')
|
||||
row = box.row()
|
||||
# row = layout.row()
|
||||
# box = row.box()
|
||||
# row = box.row()
|
||||
# row.label(text="REPLICATION", icon='TRIA_RIGHT')
|
||||
# row = box.row()
|
||||
|
||||
for item in window_manager.session.supported_datablock:
|
||||
row.label(text=item.type_name,icon=ICONS[item.type_name])
|
||||
row.prop(item, "is_replicated", text="")
|
||||
row = box.row()
|
||||
# for item in window_manager.session.supported_datablock:
|
||||
# row.label(text=item.type_name,icon=ICONS[item.type_name])
|
||||
# row.prop(item, "is_replicated", text="")
|
||||
# row = box.row()
|
||||
|
||||
|
||||
|
||||
@ -168,7 +166,7 @@ class SESSION_PT_user(bpy.types.Panel):
|
||||
def get_client_key(item):
|
||||
return item[0]
|
||||
|
||||
class SESSION_PT_properties(bpy.types.Panel):
|
||||
class SESSION_PT_outliner(bpy.types.Panel):
|
||||
bl_idname = "MULTIUSER_PROPERTIES_PT_panel"
|
||||
bl_label = "Replicated properties"
|
||||
bl_space_type = 'VIEW_3D'
|
||||
@ -239,7 +237,7 @@ class SESSION_PT_properties(bpy.types.Panel):
|
||||
classes = (
|
||||
SESSION_PT_settings,
|
||||
SESSION_PT_user,
|
||||
SESSION_PT_properties,
|
||||
SESSION_PT_outliner,
|
||||
|
||||
)
|
||||
|
||||
|
10
utils.py
10
utils.py
@ -70,7 +70,15 @@ def get_selected_objects(scene):
|
||||
|
||||
return selected_objects
|
||||
|
||||
|
||||
def clean_scene(elements=environment.rtypes):
|
||||
for datablock in BPY_TYPES:
|
||||
datablock_ref = getattr(bpy.data, BPY_TYPES[datablock])
|
||||
for item in datablock_ref:
|
||||
try:
|
||||
datablock_ref.remove(item)
|
||||
# Catch last scene remove
|
||||
except RuntimeError:
|
||||
pass
|
||||
# LOAD HELPERS
|
||||
def load(key, value):
|
||||
target = resolve_bpy_path(key)
|
||||
|
Reference in New Issue
Block a user