diff --git a/io_scene_x/__init__.py b/io_scene_x/__init__.py index f1fa1c4c893267552389d2f8a1cde0296103d07f..519ca16cd3bd29dc885684484ea510c4d8547f7e 100644 --- a/io_scene_x/__init__.py +++ b/io_scene_x/__init__.py @@ -21,12 +21,11 @@ bl_info = { "name": "DirectX X Format", "author": "Chris Foster", - "version": (3, 0, 0), + "version": (3, 0, 1), "blender": (2, 66, 0), "location": "File > Export > DirectX (.x)", "description": "Export mesh vertices, UV's, materials, textures, "\ "vertex colors, armatures, empties, and actions.", - "warning": "This script is a WIP!", "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\ "Scripts/Import-Export/DirectX_Exporter", "tracker_url": "https://projects.blender.org/tracker/index.php?"\ @@ -64,6 +63,11 @@ class ExportDirectX(bpy.types.Operator): description="Export mesh normals", default=True) + FlipNormals = BoolProperty( + name=" Flip Normals", + description="Flip mesh normals before export", + default=False) + ExportUVCoordinates = BoolProperty( name=" Export UV Coordinates", description="Export mesh UV coordinates, if any", @@ -134,7 +138,7 @@ class ExportDirectX(bpy.types.Operator): def execute(self, context): self.filepath = bpy.path.ensure_ext(self.filepath, ".x") - import export_x + from . import export_x Exporter = export_x.DirectXExporter(self, context) Exporter.Export() return {'FINISHED'} diff --git a/io_scene_x/export_x.py b/io_scene_x/export_x.py index 3aa2b909867e54aecf2e4a79d8e9fce3dedf4e07..75fbf565951c15081d279222858829dafda9d06c 100644 --- a/io_scene_x/export_x.py +++ b/io_scene_x/export_x.py @@ -550,6 +550,9 @@ class MeshExportObject(ExportObject): # Write mesh normals. for Index, Vertex in enumerate(MeshEnumerator.vertices): Normal = Vertex.normal + if self.Config.FlipNormals: + Normal = -1.0 * Vertex.normal + self.Exporter.File.Write("{:9f};{:9f};{:9f};".format(Normal[0], Normal[1], Normal[2]))