1
$\begingroup$

I want to add Menu in VIEW3D_HT_header

after VIEW3D_MT_object

before VIEW3D_PT_transform_orientations and after VIEW3D_PT_proportional_edit

before VIEW3D_PT_object_type_visibility

enter image description here enter image description here

$\endgroup$
1
  • $\begingroup$ I'm not sure you can with regular python API, at least without resorting to dark unstable magick. However if you append a menu to VIEW3D_MT_object you'll have an entry between object and transform menus. $\endgroup$
    – Gorgious
    Commented Feb 28, 2022 at 8:42

1 Answer 1

1
$\begingroup$

What @Gorgious said in a comment. More specifically, you can add a menu to the header by writing a draw routine and then calling

bpy.types.VIEW3D_HT_header.append(YOUR_DRAW_ROUTINE)

but it will appear as the last item in the header. You can use prepend rather than append but then it will appear first.

If you want to see an example of the dark unstable magick that's usually used to accomplish adding menus in the middle, take a look at the source for HardOps which does such a thing. It's not for the faint of heart and it breaks easily.

Best to figure out which of the existing menus your new entry would be most suited to and add it to that menu, as @Gorgious suggested.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .