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

bpy.types.Operator.py « examples « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2efa99ce795486eba645d6879b6cbb01d9556159 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
Basic Operator Example
++++++++++++++++++++++
This script is the most simple operator you can write that does something.
"""
import bpy


class HelloWorldOperator(bpy.types.Operator):
    bl_idname = "wm.hello_world"
    bl_label = "Minimal Operator"

    def execute(self, context):
        print("Hello World")
        return {'FINISHED'}

bpy.utils.register_class(SimpleOperator)

# test call to the newly defined operator
bpy.ops.wm.hello_world()