From f3be8f9623a464c8f386c0d586b229a816b18dba Mon Sep 17 00:00:00 2001 From: Swann Date: Wed, 19 May 2021 09:37:50 +0200 Subject: [PATCH] feat: bring back icons --- multi_user/operators.py | 4 ++-- multi_user/preferences.py | 4 ++-- multi_user/ui.py | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/multi_user/operators.py b/multi_user/operators.py index ff6449c..480d4a8 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -192,8 +192,8 @@ class SessionStartOperator(bpy.types.Operator): # Check if supported_datablocks are up to date before starting the # the session for impl in bpy_protocol.implementations.values(): - if impl.__name__ not in settings.supported_datablocks: - logging.info(f"{impl.__name__} not found, \ + if impl.bl_class.__name__ not in settings.supported_datablocks: + logging.info(f"{impl.bl_class.__name__} not found, \ regenerate type settings...") settings.generate_supported_types() diff --git a/multi_user/preferences.py b/multi_user/preferences.py index ef4b294..c0d87a4 100644 --- a/multi_user/preferences.py +++ b/multi_user/preferences.py @@ -413,8 +413,8 @@ class SessionPrefs(bpy.types.AddonPreferences): for impl in bpy_protocol.implementations.values(): new_db = self.supported_datablocks.add() - new_db.name = impl.__name__ - new_db.type_name = impl.__name__ + new_db.name = impl.bl_class.__name__ + new_db.type_name = impl.bl_class.__name__ new_db.use_as_filter = True new_db.icon = impl.bl_icon new_db.bl_name = impl.bl_id diff --git a/multi_user/ui.py b/multi_user/ui.py index 1cfa6d9..4853333 100644 --- a/multi_user/ui.py +++ b/multi_user/ui.py @@ -439,7 +439,7 @@ def draw_property(context, parent, property_uuid, level=0): settings = get_preferences() runtime_settings = context.window_manager.session item = session.repository.get_node(property_uuid) - + type_id = item.data.get('type_id') area_msg = parent.row(align=True) if item.state == ERROR: @@ -450,11 +450,10 @@ def draw_property(context, parent, property_uuid, level=0): line = area_msg.box() name = item.data['name'] if item.data else item.uuid - + icon = settings.supported_datablocks[type_id].icon if type_id else 'ERROR' detail_item_box = line.row(align=True) - detail_item_box.label(text="") - # icon=settings.supported_datablocks].icon) + detail_item_box.label(text="", icon=icon) detail_item_box.label(text=f"{name}") # Operations