Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / release / scripts / export_map.py
index ab32f6d..aca0228 100644 (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')
\ No newline at end of file
+# export_map('/foo.map')