diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-01 11:39:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-01 11:39:38 +0400 |
commit | 5a293f4af6a4ed624770adeefd5d198ca65ec44d (patch) | |
tree | 0e42518d93dae643613c13444ed4a9ff8a378f1b /io_mesh_stl/__init__.py | |
parent | c2d53d79dcae48c74d78c77ae8e56d27f1af693e (diff) |
Add support for exporting normals with STL
patch T36787 by Andrew Peel with own modifications.
Diffstat (limited to 'io_mesh_stl/__init__.py')
-rw-r--r-- | io_mesh_stl/__init__.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py index 4074aec5..6994fcef 100644 --- a/io_mesh_stl/__init__.py +++ b/io_mesh_stl/__init__.py @@ -128,6 +128,11 @@ class ExportSTL(Operator, ExportHelper): description="Save the file in ASCII file format", default=False, ) + use_normals = BoolProperty( + name="Write Normals", + description="Export one normal per face, to represent flat faces and sharp edges", + default=False, + ) use_mesh_modifiers = BoolProperty( name="Apply Modifiers", description="Apply the modifiers before saving", @@ -167,6 +172,13 @@ class ExportSTL(Operator, ExportHelper): from . import blender_utils import itertools from mathutils import Matrix + keywords = self.as_keywords(ignore=("axis_forward", + "axis_up", + "global_scale", + "check_existing", + "filter_glob", + "use_mesh_modifiers", + )) global_matrix = axis_conversion(to_forward=self.axis_forward, to_up=self.axis_up, @@ -176,7 +188,7 @@ class ExportSTL(Operator, ExportHelper): blender_utils.faces_from_mesh(ob, global_matrix, self.use_mesh_modifiers) for ob in context.selected_objects) - stl_utils.write_stl(self.filepath, faces, self.ascii) + stl_utils.write_stl(faces=faces, **keywords) return {'FINISHED'} |