update to background_job template to use --factory-startup option.
[blender.git] / release / scripts / templates / operator_simple.py
1 import bpy
2
3
4 def main(context):
5     for ob in context.scene.objects:
6         print(ob)
7
8
9 class SimpleOperator(bpy.types.Operator):
10     '''Tooltip'''
11     bl_idname = "object.simple_operator"
12     bl_label = "Simple Object Operator"
13
14     @classmethod
15     def poll(cls, context):
16         return context.active_object != None
17
18     def execute(self, context):
19         main(context)
20         return {'FINISHED'}
21
22
23 if __name__ == "__main__":
24     bpy.ops.object.simple_operator()