change blender python interface for classes not to ise __idname__ rather bl_idname...
[blender.git] / release / scripts / templates / operator_simple.py
1 def main(context):
2         for ob in context.scene.objects:
3                 print(ob)
4         
5 class SimpleOperator(bpy.types.Operator):
6         ''''''
7         bl_idname = "object.simple_operator"
8         bl_label = "Simple Object Operator"
9         
10         def poll(self, context):
11                 return context.active_object != None
12         
13         def execute(self, context):
14                 main(context)
15                 return ('FINISHED',)
16
17 bpy.ops.add(SimpleOperator)
18
19 if __name__ == "__main__":
20         bpy.ops.object.simple_operator()