Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/python_api/examples/bpy.types.Operator.py')
-rw-r--r--doc/python_api/examples/bpy.types.Operator.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/python_api/examples/bpy.types.Operator.py b/doc/python_api/examples/bpy.types.Operator.py
index 5299b198774..41b96ac402f 100644
--- a/doc/python_api/examples/bpy.types.Operator.py
+++ b/doc/python_api/examples/bpy.types.Operator.py
@@ -22,13 +22,15 @@ class HelloWorldOperator(bpy.types.Operator):
print("Hello World")
return {'FINISHED'}
-# Only needed if you want to add into a dynamic menu
+
+# Only needed if you want to add into a dynamic menu.
def menu_func(self, context):
self.layout.operator(HelloWorldOperator.bl_idname, text="Hello World Operator")
-# Register and add to the view menu (required to also use F3 search "Hello World Operator" for quick access)
+
+# Register and add to the view menu (required to also use F3 search "Hello World Operator" for quick access).
bpy.utils.register_class(HelloWorldOperator)
bpy.types.VIEW3D_MT_view.append(menu_func)
-# test call to the newly defined operator
+# Test call to the newly defined operator.
bpy.ops.wm.hello_world()