feat: bring back icons

This commit is contained in:
Swann
2021-05-19 09:37:50 +02:00
parent ffb70ab74c
commit f3be8f9623
3 changed files with 7 additions and 8 deletions

View File

@ -192,8 +192,8 @@ class SessionStartOperator(bpy.types.Operator):
# Check if supported_datablocks are up to date before starting the # Check if supported_datablocks are up to date before starting the
# the session # the session
for impl in bpy_protocol.implementations.values(): for impl in bpy_protocol.implementations.values():
if impl.__name__ not in settings.supported_datablocks: if impl.bl_class.__name__ not in settings.supported_datablocks:
logging.info(f"{impl.__name__} not found, \ logging.info(f"{impl.bl_class.__name__} not found, \
regenerate type settings...") regenerate type settings...")
settings.generate_supported_types() settings.generate_supported_types()

View File

@ -413,8 +413,8 @@ class SessionPrefs(bpy.types.AddonPreferences):
for impl in bpy_protocol.implementations.values(): for impl in bpy_protocol.implementations.values():
new_db = self.supported_datablocks.add() new_db = self.supported_datablocks.add()
new_db.name = impl.__name__ new_db.name = impl.bl_class.__name__
new_db.type_name = impl.__name__ new_db.type_name = impl.bl_class.__name__
new_db.use_as_filter = True new_db.use_as_filter = True
new_db.icon = impl.bl_icon new_db.icon = impl.bl_icon
new_db.bl_name = impl.bl_id new_db.bl_name = impl.bl_id

View File

@ -439,7 +439,7 @@ def draw_property(context, parent, property_uuid, level=0):
settings = get_preferences() settings = get_preferences()
runtime_settings = context.window_manager.session runtime_settings = context.window_manager.session
item = session.repository.get_node(property_uuid) item = session.repository.get_node(property_uuid)
type_id = item.data.get('type_id')
area_msg = parent.row(align=True) area_msg = parent.row(align=True)
if item.state == ERROR: if item.state == ERROR:
@ -450,11 +450,10 @@ def draw_property(context, parent, property_uuid, level=0):
line = area_msg.box() line = area_msg.box()
name = item.data['name'] if item.data else item.uuid 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 = line.row(align=True)
detail_item_box.label(text="") detail_item_box.label(text="", icon=icon)
# icon=settings.supported_datablocks].icon)
detail_item_box.label(text=f"{name}") detail_item_box.label(text=f"{name}")
# Operations # Operations