diff options
Diffstat (limited to 'io_mesh_stl/__init__.py')
-rw-r--r-- | io_mesh_stl/__init__.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py index 56276e5f..3d1aec5c 100644 --- a/io_mesh_stl/__init__.py +++ b/io_mesh_stl/__init__.py @@ -43,6 +43,7 @@ from bpy.props import ( CollectionProperty, EnumProperty, FloatProperty, + FloatVectorProperty, ) from bpy_extras.io_utils import ( ImportHelper, @@ -227,6 +228,12 @@ class ExportSTL(Operator, ExportHelper): ('OBJECT', "Object", "Each object as a file"), ), ) + global_space: FloatVectorProperty( + name="Global Space", + description="Export in this reference space", + subtype='MATRIX', + size=(4, 4), + ) @property def check_extension(self): @@ -249,7 +256,8 @@ class ExportSTL(Operator, ExportHelper): "filter_glob", "use_scene_unit", "use_mesh_modifiers", - "batch_mode" + "batch_mode", + "global_space", ), ) @@ -269,6 +277,9 @@ class ExportSTL(Operator, ExportHelper): to_up=self.axis_up, ).to_4x4() @ Matrix.Scale(global_scale, 4) + if self.properties.is_property_set("global_space"): + global_matrix = global_matrix @ self.global_space.inverted() + if self.batch_mode == 'OFF': faces = itertools.chain.from_iterable( blender_utils.faces_from_mesh(ob, global_matrix, self.use_mesh_modifiers) |