Post #4475: I recently had to deal with this, is not very simple but it can be done.
📋 Metadata
- Author: Motiomancer
- Date: 2022-07-30 16:36:05
- Type:
answer - Quality Score: 8/10
- Reply to: post_04473
- Replies (1): post_04478
🏷️ Tags
pie-menu custom-icons intermediate solved
⚙️ Related PME Features
- 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’)

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'

If you replace those two things now you should have the nudge button that calls the nudge brush
❤️ 4 likes