diff --git a/phy_export.py b/phy_export.py index b3bbcb9..9576143 100644 --- a/phy_export.py +++ b/phy_export.py @@ -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")