Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_scene_map/export_map.py')
-rw-r--r--io_scene_map/export_map.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/io_scene_map/export_map.py b/io_scene_map/export_map.py
index 8feb2cc8..b8f91ed4 100644
--- a/io_scene_map/export_map.py
+++ b/io_scene_map/export_map.py
@@ -26,9 +26,8 @@ PREF_SCALE = 100
PREF_FACE_THICK = 0.1
PREF_GRID_SNAP = False
# Quake 1/2?
-# PREF_DEF_TEX_OPTS = Draw.Create(' 0 0 0 1 1\n') # not user settable yet
# Quake 3+?
-PREF_DEF_TEX_OPTS = ' 0 0 0 1 1 0 0 0\n' # not user settable yet
+PREF_DEF_TEX_OPTS = '0 0 0 1 1 0 0 0' # not user settable yet
PREF_NULL_TEX = 'NULL' # not user settable yet
PREF_INVIS_TEX = 'common/caulk'
@@ -80,7 +79,7 @@ def write_cube2brush(file, faces):
file.write(PREF_NULL_TEX)
# Texture stuff ignored for now
- file.write(PREF_DEF_TEX_OPTS)
+ file.write(" %s\n" % PREF_DEF_TEX_OPTS)
file.write('}\n')
@@ -133,7 +132,7 @@ def write_face2brush(file, face):
file.write(format_vec % co)
file.write(image_text)
# Texture stuff ignored for now
- file.write(PREF_DEF_TEX_OPTS)
+ file.write(" %s\n" % PREF_DEF_TEX_OPTS)
for co in new_vco[:3]:
file.write(format_vec % co)
@@ -143,7 +142,7 @@ def write_face2brush(file, face):
file.write(PREF_INVIS_TEX)
# Texture stuff ignored for now
- file.write(PREF_DEF_TEX_OPTS)
+ file.write(" %s\n" % PREF_DEF_TEX_OPTS)
# sides.
if len(orig_vco) == 3: # Tri, it seemms tri brushes are supported.
@@ -155,7 +154,7 @@ def write_face2brush(file, face):
for co in orig_vco[i1], orig_vco[i2], new_vco[i2]:
file.write(format_vec % co)
file.write(PREF_INVIS_TEX)
- file.write(PREF_DEF_TEX_OPTS)
+ file.write(" %s\n" % PREF_DEF_TEX_OPTS)
file.write('}\n')
@@ -331,7 +330,7 @@ def export_map(context, filepath):
dummy_mesh.transform(ob.matrix_world * SCALE_MAT)
if PREF_GRID_SNAP:
- for v in dummy_mesh.verts:
+ for v in dummy_mesh.vertices:
v.co[:] = v.co.to_tuple(0)
# High quality normals
@@ -464,8 +463,25 @@ NULL
def save(operator,
context,
filepath=None,
+ global_scale=100.0,
+ face_thickness=0.1,
+ texture_null="NULL",
+ texture_opts='0 0 0 1 1 0 0 0',
+ grid_snap=False,
):
+ global PREF_SCALE
+ global PREF_FACE_THICK
+ global PREF_NULL_TEX
+ global PREF_DEF_TEX_OPTS
+ global PREF_GRID_SNAP
+
+ PREF_SCALE = global_scale
+ PREF_FACE_THICK = face_thickness
+ PREF_NULL_TEX = texture_null
+ PREF_DEF_TEX_OPTS = texture_opts
+ PREF_GRID_SNAP = grid_snap
+
export_map(context, filepath)
return {'FINISHED'}