svn merge -r 31060:31144 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / release / scripts / templates / operator_simple.py
1 import bpy
2
3 def main(context):
4     for ob in context.scene.objects:
5         print(ob)
6
7 class SimpleOperator(bpy.types.Operator):
8     ''''''
9     bl_idname = "object.simple_operator"
10     bl_label = "Simple Object Operator"
11
12     @staticmethod
13     def poll(context):
14         return context.active_object != None
15
16     def execute(self, context):
17         main(context)
18         return {'FINISHED'}
19
20
21 if __name__ == "__main__":
22     bpy.ops.object.simple_operator()