taking absolute values of shape sizes to avoid ODE errors
git-svn-id: svn://anubis/misc/phy_export@208 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
bc293f5b0c
commit
62b0450b0c
@ -26,19 +26,23 @@ def write(filename):
|
|||||||
e = ob.getEuler()
|
e = ob.getEuler()
|
||||||
size = ob.getSize()
|
size = ob.getSize()
|
||||||
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,2*size[0],2*size[1],2*size[2]) +
|
((ob.name,
|
||||||
|
2 * abs(size[0]),
|
||||||
|
2 * abs(size[1]),
|
||||||
|
2 * abs(size[2])) +
|
||||||
ob.getLocation() +
|
ob.getLocation() +
|
||||||
(e[0], e[1], e[2])))
|
(e[0], e[1], e[2])))
|
||||||
elif len(ob.data.faces) < 256:
|
elif len(ob.data.faces) < 256:
|
||||||
# found a capsule
|
# found a capsule
|
||||||
e = ob.getEuler()
|
e = ob.getEuler()
|
||||||
out.write("capsule \"%s\" %f %f %f %f %f %f %f %f\n" %
|
out.write("capsule \"%s\" %f %f %f %f %f %f %f %f\n" %
|
||||||
((ob.name,) + (ob.getSize()[0], ob.getSize()[2]*2) +
|
((ob.name,)
|
||||||
ob.getLocation() +
|
+ (abs(ob.getSize()[0]), abs(ob.getSize()[2]) * 2)
|
||||||
(e[0], e[1], e[2])))
|
+ ob.getLocation()
|
||||||
|
+ (e[0], e[1], e[2])))
|
||||||
elif len(ob.data.faces) >= 256:
|
elif len(ob.data.faces) >= 256:
|
||||||
# found a sphere
|
# found a sphere
|
||||||
out.write("sphere \"%s\" %f %f %f %f\n" %
|
out.write("sphere \"%s\" %f %f %f %f\n" %
|
||||||
((ob.name, ob.SizeX) + ob.getLocation()))
|
((ob.name, abs(ob.SizeX)) + ob.getLocation()))
|
||||||
|
|
||||||
Blender.Window.FileSelector(write, "Export")
|
Blender.Window.FileSelector(write, "Export")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user