Post #4475: I recently had to deal with this, is not very simple but it can be done.

📋 Metadata

🏷️ Tags

pie-menu custom-icons intermediate solved

  • Custom Icons
  • Python Scripting
  • Pie Menu Editor

💬 Content

I recently had to deal with this, is not very simple but it can be done.

Use this in the custom tab:

from bl_ui.space_toolsystem_common import ToolSelectPanelHelper; ico=ToolSelectPanelHelper._icon_value_from_icon_handle('brush.sculpt.multiplane_scrape'); L.operator("pme.exec", text=text, icon_value=ico).cmd = "bpy.ops.wm.tool_set_by_id(name='builtin_brush.Multi-plane Scrape')"

depending on the icon you want you have to go to:

C:\Program Files\Blender Foundation\Blender 3.2\3.2\datafiles\icons

There you find the correct icon and replace the name at the end of ico= with the icon you want:

ico=ToolSelectPanelHelper._icon_value_from_icon_handle(‘brush.sculpt.multiplane_scrape’)

image

in this case if we want the nudge icon we would replace brush.sculpt.multiplane_scrape with brush.sculpt.nudge

After replacing the icon now you have to change the operator calling the brush at the end of the custom code

cmd = “bpy.ops.wm.tool_set_by_id(name=‘builtin_brush.Multi-plane Scrape’)”

If we follow the same example we would have to replace it with the nudge operator call changing 'builtin_brush.Multi-plane Scrape' for 'builtin_brush.Nudge'

image

If you replace those two things now you should have the nudge button that calls the nudge brush


❤️ 4 likes


🔗 View on Blender Artists