diff --git a/libs/replication b/libs/replication index 3765639..4310938 160000 --- a/libs/replication +++ b/libs/replication @@ -1 +1 @@ -Subproject commit 3765639ce901c9a9168bfe852f6c216221ac654a +Subproject commit 4310938b5300caef79362d15d7614b36fc89886f diff --git a/operators.py b/operators.py index c688330..a13caba 100644 --- a/operators.py +++ b/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 = [] diff --git a/ui.py b/ui.py index ffb795b..a5aa5d2 100644 --- a/ui.py +++ b/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, ) diff --git a/utils.py b/utils.py index fdf7a3e..de886a3 100644 --- a/utils.py +++ b/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)