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:
authorCampbell Barton <ideasman42@gmail.com>2013-04-15 21:21:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-15 21:21:17 +0400
commite88ccb06cc638467174f8b2e0ad3af1828db2c68 (patch)
treeabb90f6cdfd7f294e3d45fadb633a736eaf9ad82 /object_print3d_utils/export.py
parent81507f54080373b9f23f212e23e3ea6299490140 (diff)
option to apply scale on export. also add global scale options for exporters. OBJ/X3D/VRML/PLY/STL
Diffstat (limited to 'object_print3d_utils/export.py')
-rw-r--r--object_print3d_utils/export.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/object_print3d_utils/export.py b/object_print3d_utils/export.py
index 4c582f8a..d0eeca3f 100644
--- a/object_print3d_utils/export.py
+++ b/object_print3d_utils/export.py
@@ -51,13 +51,15 @@ def image_copy_guess(filepath, objects):
def write_mesh(context, info, report_cb):
scene = context.scene
+ unit = scene.unit_settings
print_3d = scene.print_3d
obj_base = scene.object_bases.active
obj = obj_base.object
export_format = print_3d.export_format
- path_mode = 'COPY' if print_3d.use_export_texture else 'AUTO'
+ global_scale = unit.scale_length if (unit.system != 'NONE' and print_3d.use_apply_scale) else 1.0
+ path_mode = 'COPY' if print_3d.use_export_texture else 'AUTO'
context_override = context.copy()
@@ -120,6 +122,7 @@ def write_mesh(context, info, report_cb):
filepath=filepath,
ascii=False,
use_mesh_modifiers=True,
+ global_scale=global_scale,
)
elif export_format == 'PLY':
addon_ensure("io_mesh_ply")
@@ -128,6 +131,7 @@ def write_mesh(context, info, report_cb):
context_override,
filepath=filepath,
use_mesh_modifiers=True,
+ global_scale=global_scale,
)
elif export_format == 'X3D':
addon_ensure("io_scene_x3d")
@@ -138,6 +142,7 @@ def write_mesh(context, info, report_cb):
use_mesh_modifiers=True,
use_selection=True,
path_mode=path_mode,
+ global_scale=global_scale,
)
elif export_format == 'WRL':
addon_ensure("io_scene_vrml2")
@@ -148,6 +153,7 @@ def write_mesh(context, info, report_cb):
use_mesh_modifiers=True,
use_selection=True,
path_mode=path_mode,
+ global_scale=global_scale,
)
elif export_format == 'OBJ':
addon_ensure("io_scene_obj")
@@ -158,6 +164,7 @@ def write_mesh(context, info, report_cb):
use_mesh_modifiers=True,
use_selection=True,
path_mode=path_mode,
+ global_scale=global_scale,
)
else:
assert(0)