# Is it possible to print to the Report window in the Info view?

I wonder if it is currently possible to print or send messages to the Report window in the Info view? this would be quite useful sometimes.

We can always use an operator's report method. Running the following operator:

class RENDER_OT_test(bpy.types.Operator):
bl_idname = 'render.oha_test'
bl_label = 'Test'
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
self.report({'INFO'}, 'Printing report to Info window.')
return {'FINISHED'}


prints this in the Info window:

The color depends on the type enum: INFO gets green, WARNING light red, and ERROR dark red. I don't see reference to any direct output to Info window, other than this method.

• i made this snippet to demo a problem i've experienced: gist.github.com/zeffii/5734884 , say I try to call this operator from a place in a script using bpy.ops.render.oha_test() i get Undefined Type: Printing report to Info window. {'FINISHED'} and there is no printing to the report window.. – zeffii Jun 8 '13 at 11:33
• When the enumeration type is only INFO, WARNING or ERROR, the message is prefixed accordingly (e.g. "Info: ..."). But if we add DEBUG, the prefix turns to "Undefined Type: ...". Maybe we're dealing with a little quirk (bug?) in the C function related to flag-reading. Gotta read the source to make sure, but I don't think it's an error. (and report doesn't output to report area if executed on a Python interpreter area) – Adhi Jun 8 '13 at 11:57
• I don't know if combinations should be allowed, but they were not really intended in the design, so maybe something should be fixed in Blender. That's why I suggest to change the example to use only 1 value. – brecht Jun 8 '13 at 12:19
• I tried the sample but I cant get message in the info view.. import bpy class RENDER_OT_test(bpy.types.Operator): bl_idname = 'render.oha1_test' bl_label = 'Test' bl_options = {'REGISTER', 'UNDO'} def execute(self, context): self.report({'INFO'}, 'Printing report to Info window.') return {'FINISHED'} bpy.utils.register_class(RENDER_OT_test) # test call to the newly defined operator bpy.ops.render.oha1_test() – user918 Jul 9 '13 at 4:13
• After running the script, execute the operator as bpy.ops.render.oha1_test in Python console or as Test in spacebar-menu. Works for me. – Adhi Jul 9 '13 at 5:16

I needed to display a notification message when running a script in the Text Editor by hitting the 'Run Script' button. For exactly this purpose I have found a hack that works, even if this is not the preferred way :)

import bpy

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



• with newer version of blender 2.9x use self.layout.label(text="You have done something you shouldn't do!") – cscholl Feb 15 at 10:48

This should be the code: to get popup in mouse event use ERROR instead INFO. see report -'INFO' is lower and 'ERROR_OUT_OF_MEMORY' is highest level of error type.

def yourfunction(context):
whatever the function

class RENDER_OT_test(bpy.types.Operator):
bl_idname = 'render.oha_test'
bl_label = 'Test'
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
try:
yourfunction(context)
return {'FINISHED'}
except:
self.report({'INFO'}, 'Printing report to Info window.')
return {'CANCELLED'}

• basically is the already accepted solution of 4 years ago... – m.ardito Nov 10 '17 at 21:17
• The accepted answer doesn't work without try condition in Blender 2.79 and the return statement and code blocks are clarified here. – Fahad Hasan Pathik Nov 10 '17 at 22:54