I want to change the pretty barren header for sculpt mode. Add some buttons, dropdowns, etc.
It seems the only way to properly do that is to go into space_view3d.py
copy the code for the ENTIRE VIEW3D_HT_header
class, paste it into my addon and register it over there again. Then make the changes to the area of the code responsible for the sculpt header.
Feels a little bit overkill, the thing is 500 lines and I just want to add/change maybe 10, but I can’t see any other way to make those changes to the sculpting header. The way I’ve been doing it up till now is to append
the stuff I wanted to the end of the View / Sculpt / Mask / Face Sets
menu. This approach worked when the whole sculpt header was empty, but now thare are those Color Attribute and Masking popovers, and they get in the way. There’s no way to prepend
on their other side, since there are no menus there, just panels. It’s also a messy way and if I collapse the menus into a “hamburger” [≡], then the appended stuff also gets collapsed and disappears.
So… THE QUESTION(s): is there maybe another way? An easier way? Is overwriting this pretty important looking class a bad idea? Does Blender really care where the code for that class is located and where it’s registered?
As a side note, I don’t get why Blender has to have everything for the header stuffed into one class. It’s a giant jumble of conditions in there: if grease_pencil elif texture_paint elif vertex_paint elif whatever
. Everything is on top of everything else. I feel it would be much nicer and more readable if every header was separated into it’s own thing, but maybe there’s some technical reason