0
$\begingroup$

I created a custom operator which is supposed to invoke the popup info message in info panel. However, all it does is printing the message to console. Is there any way to solve this?

 class TECH_OP_REPORT(bpy.types.Operator):
        bl_idname = 'render.report_message'
        bl_label = 'Report'
        bl_description = 'Reports passed message as error or warning'
        bl_options = {'REGISTER'}

        message = bpy.props.StringProperty()
        type = bpy.props.BoolProperty(name="Report type", description="Type of message displayed", default = True)

        def execute(self, context):
            if self.type:
                self.report({'ERROR'}, self.message)
            else:
                self.report({'WARNING'}, self.message)

            return {'FINISHED'}

        def invoke(self, context, event):
            return self.execute(context)
$\endgroup$
  • $\begingroup$ Pretty comprehensive answer on popups blender.stackexchange.com/a/73548/15543 $\endgroup$ – batFINGER Mar 7 '17 at 17:42
  • $\begingroup$ I mean the error report message in the info panel. This answer does not really cover the problem with report. $\endgroup$ – D. Skarn Mar 9 '17 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.