diff options
Diffstat (limited to 'release/scripts/templates_py/operator_simple.py')
-rw-r--r-- | release/scripts/templates_py/operator_simple.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/templates_py/operator_simple.py b/release/scripts/templates_py/operator_simple.py index 715daa3a8b4..9edb07996c0 100644 --- a/release/scripts/templates_py/operator_simple.py +++ b/release/scripts/templates_py/operator_simple.py @@ -19,13 +19,18 @@ class SimpleOperator(bpy.types.Operator): main(context) return {'FINISHED'} +def menu_func(self, context): + self.layout.operator(SimpleOperator.bl_idname, text=SimpleOperator.bl_label) +# Register and add to the "object" menu (required to also use F3 search "Simple Object Operator" for quick access) def register(): bpy.utils.register_class(SimpleOperator) + bpy.types.VIEW3D_MT_object.append(menu_func) def unregister(): bpy.utils.unregister_class(SimpleOperator) + bpy.types.VIEW3D_MT_object.remove(menu_func) if __name__ == "__main__": |