From d608d3358393ad682567026fc9dfc5632a567511 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Aug 2009 13:30:23 +0000 Subject: output the origin for each map node. thanks to j michaelson for the patch --- release/scripts/export_map.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/export_map.py b/release/scripts/export_map.py index ab32f6d5ff5..aca02288c7a 100644 --- a/release/scripts/export_map.py +++ b/release/scripts/export_map.py @@ -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') \ No newline at end of file +# export_map('/foo.map') -- cgit v1.2.3