diff options
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_common.py | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index c4ef5023563..a3846b0c1fb 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -266,21 +266,6 @@ class ToolSelectPanelHelper: return None, -1 @staticmethod - def _tool_vars_from_def(item): - # For now be strict about whats in this dict - # prevent accidental adding unknown keys. - text = item.text - icon_name = item.icon - mp_idname = item.widget - datablock_idname = item.data_block - keymap = item.keymap - if keymap is None: - km_idname = None - else: - km_idname = keymap[0].name - return (km_idname, mp_idname, datablock_idname), icon_name - - @staticmethod def _tool_active_from_context(context, space_type, mode=None, create=False): if space_type == 'VIEW_3D': if mode is None: @@ -489,10 +474,8 @@ class ToolSelectPanelHelper: index = -1 use_menu = False - tool_def, icon_name = ToolSelectPanelHelper._tool_vars_from_def(item) is_active = (item.text == tool_active_text) - - icon_value = ToolSelectPanelHelper._icon_value_from_icon_handle(icon_name) + icon_value = ToolSelectPanelHelper._icon_value_from_icon_handle(item.icon) sub = ui_gen.send(False) @@ -562,8 +545,7 @@ class WM_MT_toolsystem_submenu(Menu): if item is None: layout.separator() continue - tool_def, icon_name = ToolSelectPanelHelper._tool_vars_from_def(item) - icon_value = ToolSelectPanelHelper._icon_value_from_icon_handle(icon_name) + icon_value = ToolSelectPanelHelper._icon_value_from_icon_handle(item.icon) layout.operator( "wm.tool_set_by_name", text=item.text, @@ -575,12 +557,11 @@ def activate_by_name(context, space_type, text): item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text) if item is not None: tool = ToolSelectPanelHelper._tool_active_from_context(context, space_type, create=True) - tool_def, icon_name = ToolSelectPanelHelper._tool_vars_from_def(item) tool.setup( name=text, - keymap=tool_def[0] or "", - manipulator_group=tool_def[1] or "", - data_block=tool_def[2] or "", + keymap=item.keymap[0].name if item.keymap is not None else "", + manipulator_group=item.widget or "", + data_block=item.data_block or "", index=index, ) return True |