blender/release/scripts/templates/operator_simple.py
Campbell Barton 1f5cec709c update to background_job template to use --factory-startup option.
make all templates pep8 compliant.
2011-01-26 07:54:27 +00:00

25 lines
470 B
Python

import bpy
def main(context):
for ob in context.scene.objects:
print(ob)
class SimpleOperator(bpy.types.Operator):
'''Tooltip'''
bl_idname = "object.simple_operator"
bl_label = "Simple Object Operator"
@classmethod
def poll(cls, context):
return context.active_object != None
def execute(self, context):
main(context)
return {'FINISHED'}
if __name__ == "__main__":
bpy.ops.object.simple_operator()