diff options
Diffstat (limited to 'release/scripts/templates_py/operator_modal.py')
-rw-r--r-- | release/scripts/templates_py/operator_modal.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/templates_py/operator_modal.py b/release/scripts/templates_py/operator_modal.py index c242e3b67b9..41b01e22f78 100644 --- a/release/scripts/templates_py/operator_modal.py +++ b/release/scripts/templates_py/operator_modal.py @@ -35,13 +35,18 @@ class ModalOperator(bpy.types.Operator): self.report({'WARNING'}, "No active object, could not finish") return {'CANCELLED'} +def menu_func(self, context): + self.layout.operator(ModalOperator.bl_idname, text=ModalOperator.bl_label) +# Register and add to the "view" menu (required to also use F3 search "Simple Modal Operator" for quick access) def register(): bpy.utils.register_class(ModalOperator) + bpy.types.VIEW3D_MT_object.append(menu_func) def unregister(): bpy.utils.unregister_class(ModalOperator) + bpy.types.VIEW3D_MT_object.remove(menu_func) if __name__ == "__main__": |