Post #4883: It seems there is some confusion between the text drawing provided by `status_no

📋 Metadata

🏷️ Tags

customization beginner solved

  • Popup Dialog Editor
  • Python Scripting

💬 Content

It seems there is some confusion between the text drawing provided by status_notifier.py and the overlay function offered by PME. Let me clarify the distinction for you.

The text drawn by status_notifier.py is a persistent display, meant to constantly monitor the status of certain features. It runs via PME’s autorun but is not a PME feature per se—it’s designed to operate continuously throughout Blender’s runtime. To customize this functionality, you’ll need to edit the status_notifier.py. Open up the status_notifier.py file.

At the beginning of the file, you can change where the text is displayed:

# Display position settings
overlay_offset_x = 0
overlay_offset_y = 50

# You can change this to: TOP, TOP_LEFT, TOP_RIGHT, BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT
overlay_alignment = 'BOTTOM'  

# ...

For example, to display at the bottom left, you would set:

overlay_offset_x = 50
overlay_offset_y = 50
overlay_alignment = 'BOTTOM_LEFT'  

To change the size or color, modify the following sections.
Change the second argument of blf.size for size (it’s currently set to 50)
Change the second to fourth arguments of blf.color for color.
blf.color(font_id, red, green, blue, alpha)

# ...

def draw_callback_px(self, context):
    font_id = 0  # Use the appropriate font_id
    blf.size(font_id, 50)  # Set font size
    blf.color(font_id, 1.0, 0.5, 0.0, 1.0)  # Set orange color

# ...

For instance, if you want to increase the size and set the color to yellow:

# ...

def draw_callback_px(self, context):
    font_id = 0  # Use the appropriate font_id
    blf.size(font_id, 80)  # Set font size
    blf.color(font_id, 0.922, 0.982, 0.413, 1.0)  # Set Yellow color

# ...

If you want to use a font other than the default, you would use the return value of the blf.load function, but this script does not support that.

Lastly, if you want to change the text that is displayed, adjust the generate_text_lines function. Here, a list of texts based on the status conditions of Blender is being generated. Pay attention to where text_lines.append() is used.
The conditions and messages for the display of texts are all managed here.

def generate_text_lines(context):
    text_lines = []
    mode = context.mode
    tool_settings = context.tool_settings

    # Edit Mesh specific condition
    if mode == 'EDIT_MESH':
        # Check if the Boxcutter tool is active
        if context.workspace.tools.from_space_view3d_mode('EDIT_MESH').idname == "Boxcutter":
            text_lines.append("Boxcutter Active")

        # Check if use_transform_correct_face_attributes is True
        if getattr(tool_settings, "use_transform_correct_face_attributes", False):
            text_lines.append("Correct Face Attributes On")

    # Object Mode specific conditions
    if mode == 'OBJECT':
        # Check if the Boxcutter tool is active
        if context.workspace.tools.from_space_view3d_mode('OBJECT').idname == "Boxcutter":
            text_lines.append("Boxcutter Active")
        
        # Check if use_transform_data_origin is True
        if getattr(tool_settings, "use_transform_data_origin", False):
            text_lines.append("Data Origin Transform On")

    return text_lines

To change “Correct Face Attributes On” to “CFA on” and remove the display of “Data Origin Transform On”, you would edit it as follows:

def generate_text_lines(context):
    text_lines = []
    mode = context.mode
    tool_settings = context.tool_settings

    # Edit Mesh specific condition
    if mode == 'EDIT_MESH':
        # Check if the Boxcutter tool is active
        if context.workspace.tools.from_space_view3d_mode('EDIT_MESH').idname == "Boxcutter":
            text_lines.append("Boxcutter Active")

        # Check if use_transform_correct_face_attributes is True
        if getattr(tool_settings, "use_transform_correct_face_attributes", False):
            text_lines.append("CFA on")

    # Object Mode specific conditions
    if mode == 'OBJECT':
        # Check if the Boxcutter tool is active
        if context.workspace.tools.from_space_view3d_mode('OBJECT').idname == "Boxcutter":
            text_lines.append("Boxcutter Active")
        
        # # Check if use_transform_data_origin is True
        # if getattr(tool_settings, "use_transform_data_origin", False):
        #     text_lines.append("Data Origin Transform On")

    return text_lines

Once you have finished editing, save the text and restart Blender.

That covers the explanation for status_notifier.py.


Now, regarding the overlay function provided by PME, it enables the display of temporary text. This function works by specifying the text you want to display. The color, size, and fade-out time can be changed in the PME settings.

In the command tab of any slot, simply input:

overlay("Your Text")

When executed, the text overlay will appear and then fade out and be removed according to the set decay time.

This feature can be added to or removed from any PME menu.


I’m delighted to help and I hope the instructions I’ve provided will be useful for you to implement the desired features. If you’re interested in tailoring functionality to your specific needs, I would encourage you to explore some basic scripting. It’s a valuable skill that can greatly enhance your ability to customize and extend Blender to your liking.


🔗 View on Blender Artists