sphinx doc gen: multiple examples possible and include the scripts docstring inline...
[blender-staging.git] / doc / python_api / examples / bpy.types.Operator.py
1 """
2 Basic Operator Example
3 ++++++++++++++++++++++
4 This script is the most simple operator you can write that does something.
5 """
6 import bpy
7
8
9 class HelloWorldOperator(bpy.types.Operator):
10     bl_idname = "wm.hello_world"
11     bl_label = "Minimal Operator"
12
13     def execute(self, context):
14         print("Hello World")
15         return {'FINISHED'}
16
17 bpy.utils.register_class(SimpleOperator)
18
19 # test call to the newly defined operator
20 bpy.ops.wm.hello_world()