Advertisement
Guest User

Untitled

a guest
Sep 24th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. for mesh in bpy.data.meshes:
  2.     if mesh.name not in bpy.data.objects:
  3.         continue
  4.     o = bpy.data.objects[mesh.name]
  5.     minx = min(mesh.vertices, key=lambda x:x.co[0]).co[0] * o.scale[0] + o.location[0]
  6.     minz = min(mesh.vertices, key=lambda x:x.co[1]).co[1] * o.scale[1] + o.location[1]
  7.     miny = min(mesh.vertices, key=lambda x:x.co[2]).co[2] * o.scale[2] + o.location[2]
  8.     maxx = max(mesh.vertices, key=lambda x:x.co[0]).co[0] * o.scale[0] + o.location[0]
  9.     maxz = max(mesh.vertices, key=lambda x:x.co[1]).co[1] * o.scale[1] + o.location[1]
  10.     maxy= max(mesh.vertices, key=lambda x:x.co[2]).co[2] * o.scale[2] + o.location[2]
  11.     print("{%.3f,%.3f,%.3f,%.3f,%.3f,%.3f}," % (minx, miny, minz, maxx, maxy, maxz))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement