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-02-07 08:25:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-07 08:25:53 +0400
commit9e11509b70067c0c24fec6f1c38e7c4b93ba7f06 (patch)
treef8540bde9c30863a530ad072ffed51060799155b /io_mesh_stl
parent05b77ae4f880355178641584939cfb87d6cc7638 (diff)
make option for applying modifiers consistent
Diffstat (limited to 'io_mesh_stl')
-rw-r--r--io_mesh_stl/__init__.py19
-rw-r--r--io_mesh_stl/blender_utils.py6
2 files changed, 14 insertions, 11 deletions
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py
index 34c586a3..cb0badc5 100644
--- a/io_mesh_stl/__init__.py
+++ b/io_mesh_stl/__init__.py
@@ -115,13 +115,16 @@ class ExportSTL(Operator, ExportHelper):
filename_ext = ".stl"
filter_glob = StringProperty(default="*.stl", options={'HIDDEN'})
- ascii = BoolProperty(name="Ascii",
- description="Save the file in ASCII file format",
- default=False)
- apply_modifiers = BoolProperty(name="Apply Modifiers",
- description="Apply the modifiers "
- "before saving",
- default=True)
+ ascii = BoolProperty(
+ name="Ascii",
+ description="Save the file in ASCII file format",
+ default=False,
+ )
+ use_mesh_modifiers = BoolProperty(
+ name="Apply Modifiers",
+ description="Apply the modifiers before saving",
+ default=True,
+ )
def execute(self, context):
from . import stl_utils
@@ -129,7 +132,7 @@ class ExportSTL(Operator, ExportHelper):
import itertools
faces = itertools.chain.from_iterable(
- blender_utils.faces_from_mesh(ob, self.apply_modifiers)
+ blender_utils.faces_from_mesh(ob, self.use_mesh_modifiers)
for ob in context.selected_objects)
stl_utils.write_stl(self.filepath, faces, self.ascii)
diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py
index 1d24369e..5589da4e 100644
--- a/io_mesh_stl/blender_utils.py
+++ b/io_mesh_stl/blender_utils.py
@@ -41,14 +41,14 @@ def create_and_link_mesh(name, faces, points):
obj.select = True
-def faces_from_mesh(ob, apply_modifier=False, triangulate=True):
+def faces_from_mesh(ob, use_mesh_modifiers=False, triangulate=True):
"""
From an object, return a generator over a list of faces.
Each faces is a list of his vertexes. Each vertex is a tuple of
his coordinate.
- apply_modifier
+ use_mesh_modifiers
Apply the preview modifier to the returned liste
triangulate
@@ -57,7 +57,7 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True):
# get the modifiers
try:
- mesh = ob.to_mesh(bpy.context.scene, apply_modifier, "PREVIEW")
+ mesh = ob.to_mesh(bpy.context.scene, use_mesh_modifiers, "PREVIEW")
except RuntimeError:
raise StopIteration