diff --git a/__init__.py b/__init__.py index f2c748a..4469a19 100644 --- a/__init__.py +++ b/__init__.py @@ -226,8 +226,6 @@ def unregister(): operators.unregister() del bpy.types.WindowManager.session - del bpy.types.ID.id - del bpy.types.ID.is_dirty for cls in reversed(classes): bpy.utils.unregister_class(cls) diff --git a/bl_types/__init__.py b/bl_types/__init__.py index 34681c2..fc9d53d 100644 --- a/bl_types/__init__.py +++ b/bl_types/__init__.py @@ -1,5 +1,6 @@ __all__ = [ 'bl_object', + 'bl_mesh', ] # Order here defines execution order from . import * diff --git a/bl_types/bl_mesh.py b/bl_types/bl_mesh.py index 99ba283..d262077 100644 --- a/bl_types/bl_mesh.py +++ b/bl_types/bl_mesh.py @@ -6,6 +6,11 @@ from .. import utils from ..libs.replication.data import ReplicatedDatablock class BlMesh(ReplicatedDatablock): + def __init__(self, *args, **kwargs): + self.icon = 'MESH_DATA' + + super().__init__( *args, **kwargs) + def load(self, data, target): if not target or not target.is_editmode: # LOAD GEOMETRY diff --git a/bl_types/bl_object.py b/bl_types/bl_object.py index e365073..92e2845 100644 --- a/bl_types/bl_object.py +++ b/bl_types/bl_object.py @@ -5,6 +5,11 @@ from .. import utils from ..libs.replication.data import ReplicatedDatablock class BlObject(ReplicatedDatablock): + def __init__(self, *args, **kwargs): + self.icon = 'OBJECT_DATA' + + super().__init__( *args, **kwargs) + def load(self, data, target): if target is None: pointer = None @@ -43,7 +48,7 @@ class BlObject(ReplicatedDatablock): if not target_modifier: target_modifier = target.modifiers.new(data['modifiers'][modifier]['name'],data['modifiers'][modifier]['type']) - # utils.dump_anything.load(target_modifier, data['modifiers'][modifier]) + utils.dump_anything.load(target_modifier, data['modifiers'][modifier]) def dump(self, pointer=None): diff --git a/libs/replication b/libs/replication index 4310938..69df1e1 160000 --- a/libs/replication +++ b/libs/replication @@ -1 +1 @@ -Subproject commit 4310938b5300caef79362d15d7614b36fc89886f +Subproject commit 69df1e1f4962151079fff5017038d7f9acd1afef diff --git a/operators.py b/operators.py index a13caba..b853b79 100644 --- a/operators.py +++ b/operators.py @@ -24,21 +24,6 @@ logger = logging.getLogger(__name__) client = None context = None -execution_queue = queue.Queue() - -# This function can savely be called in another thread. -# The function will be executed when the timer runs the next time. - - -# def run_in_main_thread(function, args): -# execution_queue.put(function) - - -# def execute_queued_functions(): -# while not execution_queue.empty(): -# function, args = execution_queue.get() -# function(args[0], args[1]) -# return .1 diff --git a/ui.py b/ui.py index 93b921d..6981f30 100644 --- a/ui.py +++ b/ui.py @@ -162,7 +162,7 @@ class SESSION_PT_user(bpy.types.Panel): def get_client_key(item): - return item[0] + return item.owner class SESSION_PT_outliner(bpy.types.Panel): bl_idname = "MULTIUSER_PROPERTIES_PT_panel" @@ -202,30 +202,22 @@ class SESSION_PT_outliner(bpy.types.Panel): if client_keys and len(client_keys) > 0: for item in sorted(client_keys, key=get_client_key): - owner = 'toto' - try: - owner = item[1] - except: - owner = item[1].decode() - pass - - store_type,store_name = item[0].split('/') item_box = area_msg.box() detail_item_box = item_box.row(align = True) - detail_item_box.label(text="",icon=ICONS[store_type]) - detail_item_box.label(text="{} ".format(store_name)) - detail_item_box.label(text="{} ".format(owner)) + detail_item_box.label(text="",icon=item.icon) + detail_item_box.label(text="{} ".format(item.uuid)) + detail_item_box.label(text="{} ".format(item.owner)) - right_icon = "DECORATE_UNLOCKED" - if owner == net_settings.username: - right_icon="DECORATE_UNLOCKED" - else: + # right_icon = "DECORATE_UNLOCKED" + # if owner == net_settings.username: + # right_icon="DECORATE_UNLOCKED" + # else: - right_icon="DECORATE_LOCKED" + # right_icon="DECORATE_LOCKED" - ro = detail_item_box.operator("session.right", text="",emboss=net_settings.is_admin, icon=right_icon) - ro.key = item[0] + # ro = detail_item_box.operator("session.right", text="",emboss=net_settings.is_admin, icon=right_icon) + # ro.key = item[0] # detail_item_box.operator( # "session.remove_prop", text="", icon="X").property_path = key else: