2010-04-18 05:13:58 +00:00
|
|
|
import bpy
|
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"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
return context.active_object != None
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
main(context)
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
2009-10-29 11:26:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2010-08-02 03:30:07 +00:00
|
|
|
bpy.ops.object.simple_operator()
|