Is it possible to implement a custom tool menu similar to spacebar menu in blender 2.8?

Is it possible to implement a custom tool menu similar to the one (below) we get when pressing spacebar in Blender 2.8 using the python API?

tool_menu

I couldn’t find an Edit Source option when I right-clicked on this menu.

Is it possible?

There seem to be ways to create popup menus using the python API. I haven’t done anything like this myself but maybe this is useful to you:

Hi @lone_noel. Thanks for sharing this. But I wasn’t looking for a search pop up. It can be easily implemented using a prop_search method.

I was looking for a way to create a custom tool menu like the one we get when pressing spacebar.

Hi @brecht, could you share some insight on this?

The operator for this is named wm.toolbar, so I’d start looking at the implementation of that.
https://developer.blender.org/diffusion/B/browse/master/release/scripts/startup/bl_operators/wm.py$1759
https://developer.blender.org/diffusion/B/browse/master/release/scripts/startup/bl_ui/space_toolsystem_common.py$608

1 Like

Thank you so much, @brecht for pointing me to the code itself. I ll try to read and wrap my head around this.