0

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)
D. Skarn
  • 695
  • 4
  • 16

0 Answers0