Writing cylinders based on number of faces < 256
git-svn-id: svn://anubis/misc/phy_export@139 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
3d82e311cf
commit
c98eafac70
@ -17,17 +17,25 @@ def write(filename):
|
||||
if len(ob.data.faces) == 1:
|
||||
# found a plane
|
||||
e = ob.getEuler()
|
||||
out.write("plane \"%s\" %f %f %f %f %f %f\n" %
|
||||
out.write("plane \"%s\" %f %f %f %f %f %f\n" %
|
||||
((ob.name,) + ob.getLocation() + (e[0], e[1], e[2])))
|
||||
elif len(ob.data.faces) == 6:
|
||||
# found a cube
|
||||
e = ob.getEuler()
|
||||
out.write("cube \"%s\" %f %f %f %f %f %f %f %f %f\n" %
|
||||
out.write("cube \"%s\" %f %f %f %f %f %f %f %f %f\n" %
|
||||
((ob.name,) + ob.getSize() +
|
||||
ob.getLocation() +
|
||||
(e[0], e[1], e[2])))
|
||||
elif len(ob.data.faces) >= 1024:
|
||||
out.write("sphere \"%s\" %f %f %f %f\n" %
|
||||
elif len(ob.data.faces) < 256:
|
||||
# found a cylinder
|
||||
e = ob.getEuler()
|
||||
out.write("cylinder \"%s\" %f %f %f %f %f %f %f %f\n" %
|
||||
((ob.name,) + (ob.getSize()[0], ob.getSize()[2]) +
|
||||
ob.getLocation() +
|
||||
(e[0], e[1], e[2])))
|
||||
elif len(ob.data.faces) >= 256:
|
||||
# found a sphere
|
||||
out.write("sphere \"%s\" %f %f %f %f\n" %
|
||||
((ob.name, ob.SizeX) + ob.getLocation()))
|
||||
|
||||
Blender.Window.FileSelector(write, "Export")
|
||||
|
Loading…
x
Reference in New Issue
Block a user