I have a simple script:

import bpy
from bpy.types import Panel,Operator

class MarkerAdd(Operator):
    bl_idname = 'marker.add'
    bl_label = 'Add Marker'
    def execute(self,context):
        return '{FINISHED}'

class AddObject(bpy.types.Panel):
    bl_label = "Add Object"
    bl_idname = "add_object"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"
    def draw(self, context):
        layout = self.layout
        scn = context.scene
        row = layout.row()

def register():
def unregister():

if __name__ == "__main__":

Which seems to work, but after pressing the button, a huge error appears:

RuntimeError: class MARKER_OT_add, function execute: incompatible return value , str(, Function.result expected a set, not a NoneType)

which I have no idea why. Is the execute function from MarkerAdd operator supposed to have a different result type? It does not matter whether I put there '{FINISHED}' or not.


1 Answer 1


OK, I realized that I made a typo/mistake. In the MarkerAdd operator, in the function execute I've put

def execute(self, context):
    return '{FINISHED}'

which is a string, while it should be a Set:

def execute(self, context):
    return {'FINISHED'} 

Notice apostrophes. That simple mistake caused me to get lost in and I waste hours trying to understand what's wrong. I hope somebody could avoid similar mistake.

  • $\begingroup$ this error can also arise if u dont have return statement atol just like me $\endgroup$ Commented Mar 26, 2021 at 8:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .