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

operator_simple.py « templates « scripts « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 55afe586a1e832a2293c860f929dbf7c74c3503d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import bpy

def main(context):
    for ob in context.scene.objects:
        print(ob)

class SimpleOperator(bpy.types.Operator):
    ''''''
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    @staticmethod
    def poll(context):
        return context.active_object != None

    def execute(self, context):
        main(context)
        return {'FINISHED'}


if __name__ == "__main__":
    bpy.ops.object.simple_operator()