Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 551 Bytes

error_helper.rst

File metadata and controls

21 lines (16 loc) · 551 Bytes

error_helper

.. autoclass:: error_helper.ErrorHelper
    :members:

Example:

class MY_ADDON_OT_my_operator(bpy.types.Operator, ErrorHelper):
    bl_idname = "my_addon.my_operator"
    bl_label = "My Operator"

    def execute(self, context):
        if context.mode == "EDIT_MESH":
            self.warning("we are in edit mode")
        elif context.mode == "POSE":
            return self.error("operator doesn't work in pose mode")
        return {"FINISHED"}