diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-23 05:18:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-23 05:18:52 +0400 |
commit | e63e95789e23f672b2d55319232e391e254219fb (patch) | |
tree | b25900ebb754df4376e03c49789c6ea5a808506f /io_mesh_stl | |
parent | 5127af871d9ca8493af0c36db6d6ec3f49c42451 (diff) |
update addons enabled by default to use 'faces -> tessfaces' also grease pencil scatter and quake map export.
Diffstat (limited to 'io_mesh_stl')
-rw-r--r-- | io_mesh_stl/__init__.py | 14 | ||||
-rw-r--r-- | io_mesh_stl/blender_utils.py | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py index 7005e50d..f2fe7c16 100644 --- a/io_mesh_stl/__init__.py +++ b/io_mesh_stl/__init__.py @@ -60,9 +60,10 @@ import os import bpy from bpy.props import StringProperty, BoolProperty, CollectionProperty from bpy_extras.io_utils import ExportHelper, ImportHelper +from bpy.types import Operator, OperatorFileListElement -class ImportSTL(bpy.types.Operator, ImportHelper): +class ImportSTL(Operator, ImportHelper): '''Load STL triangle mesh data''' bl_idname = "import_mesh.stl" bl_label = "Import STL" @@ -76,7 +77,7 @@ class ImportSTL(bpy.types.Operator, ImportHelper): ) files = CollectionProperty( name="File Path", - type=bpy.types.OperatorFileListElement, + type=OperatorFileListElement, ) directory = StringProperty( subtype='DIR_PATH', @@ -106,12 +107,13 @@ class ImportSTL(bpy.types.Operator, ImportHelper): return {'FINISHED'} -class ExportSTL(bpy.types.Operator, ExportHelper): +class ExportSTL(Operator, ExportHelper): '''Save STL triangle mesh data from the active object''' bl_idname = "export_mesh.stl" bl_label = "Export STL" filename_ext = ".stl" + filter_glob = StringProperty(default="*.stl", options={'HIDDEN'}) ascii = BoolProperty(name="Ascii", description="Save the file in ASCII file format", @@ -136,14 +138,12 @@ class ExportSTL(bpy.types.Operator, ExportHelper): def menu_import(self, context): - self.layout.operator(ImportSTL.bl_idname, - text="Stl (.stl)").filepath = "*.stl" + self.layout.operator(ImportSTL.bl_idname, text="Stl (.stl)") def menu_export(self, context): default_path = os.path.splitext(bpy.data.filepath)[0] + ".stl" - self.layout.operator(ExportSTL.bl_idname, - text="Stl (.stl)").filepath = default_path + self.layout.operator(ExportSTL.bl_idname, text="Stl (.stl)") def register(): diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py index 2e8c8d6d..76c864cd 100644 --- a/io_mesh_stl/blender_utils.py +++ b/io_mesh_stl/blender_utils.py @@ -66,7 +66,7 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True): if triangulate: # From a list of faces, return the face triangulated if needed. def iter_face_index(): - for face in mesh.faces: + for face in mesh.tessfaces: vertices = face.vertices[:] if len(vertices) == 4: yield vertices[0], vertices[1], vertices[2] @@ -75,7 +75,7 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True): yield vertices else: def iter_face_index(): - for face in mesh.faces: + for face in mesh.tessfaces: yield face.vertices[:] vertices = mesh.vertices |