What is the best way to inform users of an add-on's warnings, info, or things they must do for the function to work? As it seems to be hard to add info to the main header, is it better to use (Blender dreaded) pop-ups? So what are your preferred ways and how do you do it, code-wise?

(I don't mean info view or console, because users do not have these things open - so this is not a duplicate question)


Prefered way is to use Operator.report() method. You only need to pass a certain type of report 'INFO', 'ERROR', 'WARNING' etc. and the corresponding message as string. In case of an error report a popup appears as well as the message is shown in the info bar, automatically.

enter image description here

import bpy
import random

class SimpleOperator(bpy.types.Operator):
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        if bool(random.getrandbits(1)):
            self.report({'ERROR'}, 'Error message')
            self.report({'INFO'}, 'Info message')
        return {'FINISHED'}

def register():

def unregister():

if __name__ == "__main__":

Example based on Python > Templates > Operator Simple.

| improve this answer | |


import bpy

def oops(self, context):
    self.layout.label("You have done something you shouldn't do!")

bpy.context.window_manager.popup_menu(oops, title="Error", icon='ERROR')


| improve this answer | |
  • 4
    $\begingroup$ Prefered way is to use Operator.report() method, check out the API: docs.blender.org/api/current/… $\endgroup$ – brockmann Dec 17 '17 at 14:14
  • 3
    $\begingroup$ This blocks the user interface, which is against Blender's UI paradigm. Use Operator.report() instead. $\endgroup$ – dr. Sybren Dec 18 '17 at 13:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.