How do I get invoke_props_popup to work? I'm trying to get invoke_props_popup to work. But my code produces this error: 

Error: Operator 'OBJECT_OT_keyframe_changer' does not have register enabled, incorrect invoke function

Traceback &lt;most recet call last):
    File "(Script-path)", line 63, in &lt;module&gt; ...

RuntimeError: Error: Operator 'OBJECT_OT_keyframe_changer' does not have register enabled, incorrect invoke function


Line 63 is bpy.ops.object.keyframe_changer('INVOKE_DEFAULT')

I haven't been able to find any documentation to help me with this. Why does it not run? Why does it give me an error?



This is the code I have so far:

class KeyframeChangerOperator(bpy.types.Operator):
    """Let's you change keyframe position"""
    bl_idname = "object.keyframe_changer"
    bl_label = "Keyframe changer"
    my_float = bpy.props.FloatProperty(name="Keyframe position")


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

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_popup(self, event)

def register():
    bpy.utils.register_class(KeyframeChangerOperator)

def unregister():
    bpy.utils.unregister_class(KeyframeChangerOperator)


if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.keyframe_changer('INVOKE_DEFAULT')
You simply forgot to set bl_options:

import bpy

def set_keyframe_position(flt):
    print (flt)

class KeyframeChangerOperator(bpy.types.Operator):
    """Let's you change keyframe position"""
    bl_idname = "object.keyframe_changer"
    bl_label = "Keyframe changer"
    bl_options = {'REGISTER', 'UNDO'}

    my_float = bpy.props.FloatProperty(name="Keyframe position")

    def invoke(self, context, event):
        return context.window_manager.invoke_props_popup(self, event)

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

def register():
    bpy.utils.register_class(KeyframeChangerOperator)


def unregister():
    bpy.utils.unregister_class(KeyframeChangerOperator)


if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.keyframe_changer('INVOKE_DEFAULT')