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:
authorChris Foster <cdbfoster@gmail.com>2013-04-11 01:47:33 +0400
committerChris Foster <cdbfoster@gmail.com>2013-04-11 01:47:33 +0400
commit93be85532ba2a3bf030f3211f201c0fe4e055d53 (patch)
treeff021d6f3364b8946722a9705da15a7532bdacff /io_scene_x
parent4c8bfbe850a67d8b99f090950bd3af54e1eae42e (diff)
Re-added Flip Normals option by request. Also removed WIP warning.
Diffstat (limited to 'io_scene_x')
-rw-r--r--io_scene_x/__init__.py10
-rw-r--r--io_scene_x/export_x.py3
2 files changed, 10 insertions, 3 deletions
diff --git a/io_scene_x/__init__.py b/io_scene_x/__init__.py
index f1fa1c4c..519ca16c 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 3aa2b909..75fbf565 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]))