2009-11-01 15:21:20 +00:00
|
|
|
|
2009-10-29 11:26:44 +00:00
|
|
|
def main(context):
|
2009-10-31 19:31:45 +00:00
|
|
|
for ob in context.scene.objects:
|
|
|
|
print(ob)
|
|
|
|
|
2009-10-29 11:26:44 +00:00
|
|
|
class SimpleOperator(bpy.types.Operator):
|
2009-10-31 19:31:45 +00:00
|
|
|
''''''
|
|
|
|
bl_idname = "object.simple_operator"
|
|
|
|
bl_label = "Simple Object Operator"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return context.active_object != None
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
main(context)
|
|
|
|
return ('FINISHED',)
|
2009-10-29 11:26:44 +00:00
|
|
|
|
|
|
|
bpy.ops.add(SimpleOperator)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2009-10-31 19:31:45 +00:00
|
|
|
bpy.ops.object.simple_operator()
|