1
$\begingroup$

I've got a modal operator in my add-on that allows the user to draw a gradient. I'd really like to show the user more information about an axis snap feature the operator has, but I'm not sure how best to do this. From looking at other operators, such as vertex slide, the Blender way is to show a tool tip in the bar at the bottom of the screen, as shown in this image.

enter image description here

How do I do this?

$\endgroup$

1 Answer 1

2
$\begingroup$

Area.header_text_set

A call to area.header_text_set(text) sets the header text to text No argument area.header_text_set() and it returns header to usual mode (menus et al).

Code below from Scripting > Templates > Python > operator_modal_view3d.py

    if event.type == 'MOUSEMOVE':
        self.offset = (self._initial_mouse - Vector((event.mouse_x, event.mouse_y, 0.0))) * 0.02
        self.execute(context)
        context.area.header_text_set("Offset %.4f %.4f %.4f" % tuple(self.offset))

    elif event.type == 'LEFTMOUSE':
        context.area.header_text_set()
        return {'FINISHED'}
$\endgroup$

You must log in to answer this question.

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