Status bar for python operators
Modal operators in Blender can display modifier keys in status bar. Now they're fancy with toggling, mode changes and etc.
But it's inaccessible to Python operators. They can only put text in the status bar, but most of them put it in toolbar. This limits python operators (including built-in ons) and forces them to "stand out", and they don't feel like native tools anymore.
How to fix:
Allow bpy.types.Operator to define it's own
draw_statusbar
function, which will be interpreted by Blender during modal. Developer will information in there: what keys to show with what labels, what to show as toggle, what to show with value of the property in brackets and etc.
It could look something like this:
3 Comments
Thanks! This is much needed!
This would ease the development of a lot of add-ons, since they do not need to draw any fancy custom UI anymore for their operations, if they do not want to use the old text in the status bar, which makes it look like a "legacy operation".
Another point is that a lot more add-ons would look consistant, since a lot of them add there own UI and looks nothing alike, due to the meantionde limations of the current statuesbar.
This is already possible.
The draw function is not necessarily defined inside the operator however.
You need to replace the header draw function of the status bar like this. bpy.types.STATUSBAR_HT_header.draw = custom_draw_statusbar
It's a good idea to cache the old header draw function before replacing it, so you can restore the old function when cancelling- or finishing your operator.
You can modify the status bar like other draw functions
Bump, would absolutely love this. Modal operators could use keymap integration for this too. Unfortunately modal keymaps are unavailable for add-ons; that could be a related change too.