output the origin for each map node.

thanks to j michaelson for the patch
This commit is contained in:
2009-08-06 13:30:23 +00:00
parent 5763746af7
commit d608d33583

View File

@@ -249,6 +249,10 @@ def write_node_map(file, ob):
file.write('{\n')
for name_value in props:
file.write('"%s" "%s"\n' % name_value)
if PREF_GRID_SNAP.val:
file.write('"origin" "%d %d %d"\n' % tuple([round(axis*PREF_SCALE.val) for axis in ob.getLocation('worldspace')]) )
else:
file.write('"origin" "%.6f %.6f %.6f"\n' % tuple([axis*PREF_SCALE.val for axis in ob.getLocation('worldspace')]) )
file.write('}\n')
return True
@@ -447,4 +451,4 @@ def main():
Window.FileSelector(export_map, 'EXPORT MAP', '*.map')
if __name__ == '__main__': main()
# export_map('/foo.map')
# export_map('/foo.map')