diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py index eef29f97c09fabd39e89af7976cccfdccf155599..60a43168ba1a5237e7c8229c848c46e1ce7ca205 100644 --- a/io_scene_obj/__init__.py +++ b/io_scene_obj/__init__.py @@ -291,15 +291,6 @@ class ExportOBJ(bpy.types.Operator, ExportHelper): default=False, ) - global_scale = FloatProperty( - name="Scale", - description="Scale all data", - min=0.01, max=1000.0, - soft_min=0.01, - soft_max=1000.0, - default=1.0, - ) - axis_forward = EnumProperty( name="Forward", items=(('X', "X Forward", ""), @@ -323,6 +314,11 @@ class ExportOBJ(bpy.types.Operator, ExportHelper): ), default='Y', ) + global_scale = FloatProperty( + name="Scale", + min=0.01, max=1000.0, + default=1.0, + ) path_mode = path_reference_mode @@ -339,13 +335,7 @@ class ExportOBJ(bpy.types.Operator, ExportHelper): "filter_glob", )) - global_matrix = Matrix() - - global_matrix[0][0] = \ - global_matrix[1][1] = \ - global_matrix[2][2] = self.global_scale - - global_matrix = (global_matrix * + global_matrix = (Matrix.Scale(self.global_scale, 4) * axis_conversion(to_forward=self.axis_forward, to_up=self.axis_up, ).to_4x4()) diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py index f87bd428eb3db165da9a8a320d37db42238df4b6..22f41dc98f6fd1b15f0851e7e5c7534f3a4a7a1d 100644 --- a/io_scene_x3d/__init__.py +++ b/io_scene_x3d/__init__.py @@ -39,7 +39,7 @@ if "bpy" in locals(): imp.reload(export_x3d) import bpy -from bpy.props import StringProperty, BoolProperty, EnumProperty +from bpy.props import StringProperty, BoolProperty, EnumProperty, FloatProperty from bpy_extras.io_utils import (ImportHelper, ExportHelper, axis_conversion, @@ -168,20 +168,28 @@ class ExportX3D(bpy.types.Operator, ExportHelper): ), default='Y', ) + global_scale = FloatProperty( + name="Scale", + min=0.01, max=1000.0, + default=1.0, + ) path_mode = path_reference_mode def execute(self, context): from . import export_x3d + from mathutils import Matrix + keywords = self.as_keywords(ignore=("axis_forward", "axis_up", + "global_scale", "check_existing", "filter_glob", )) global_matrix = axis_conversion(to_forward=self.axis_forward, to_up=self.axis_up, - ).to_4x4() + ).to_4x4() * Matrix.Scale(self.global_scale, 4) keywords["global_matrix"] = global_matrix return export_x3d.save(self, context, **keywords)