How would I call the paint or sculpt brush menus?

Is there a default layout menu like “VIEW3D_MT_transform” that I could plugin here for bringing up the sculpt or texture paint brush menus? Or enum list (preferably the first)?


import bpy

class brushMenu(bpy.types.Menu):
    bl_idname = "OBJECT MT_brushMenu"
    bl_label = "Select Brush"
    
    def draw(self, context):
        layout = self.layout
        
        layout.menu("<i><b>BrushMenu?</b></i>")
        
bpy.utils.register_class(brushMenu)
bpy.ops.wm.call_menu(name ="OBJECT MT_brushMenu")

VIEW3D_MT_brush ?

You just need to hover a menu in the UI and it will show you the name

Thanks. That’s closer than I was. For this situation I’m looking to figure out what is called when you click on the actual brush icon when you want to change your brush, to bring up the selection of brushes that exist for either texture paint or sculpt mode so I can set up a hotkey for it.

Cool man. Thanks. I’ll check out the widget.

That’s bad ass. I like that better than the standard preview.

I’ve been monkeying with this code, was wondering if there was a way to get the menu to dismiss, once a brush was selected?

That’s not possible, you need to use the Menu instead if you want it to close after a click.