From 362cb796d004953274e4986520402de79a68cac5 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Fri, 18 Mar 2016 13:37:02 -0700 Subject: [PATCH 1/3] fixed skinned mesh export --- .../exporters/blender/addons/io_three/exporter/api/mesh.py | 4 ++-- .../blender/addons/io_three/exporter/api/object.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/exporters/blender/addons/io_three/exporter/api/mesh.py b/utils/exporters/blender/addons/io_three/exporter/api/mesh.py index adc4f5bd03a576..1f46962634022d 100644 --- a/utils/exporters/blender/addons/io_three/exporter/api/mesh.py +++ b/utils/exporters/blender/addons/io_three/exporter/api/mesh.py @@ -756,8 +756,8 @@ def vertices(mesh): vertices_ = [] for vertex in mesh.vertices: - vertices_.extend((vertex.co.x, vertex.co.y, vertex.co.z)) - + vertices_.extend((vertex.co.x, vertex.co.z, -vertex.co.y)) + return vertices_ diff --git a/utils/exporters/blender/addons/io_three/exporter/api/object.py b/utils/exporters/blender/addons/io_three/exporter/api/object.py index 156ade28f56c67..827d5cebb6784e 100644 --- a/utils/exporters/blender/addons/io_three/exporter/api/object.py +++ b/utils/exporters/blender/addons/io_three/exporter/api/object.py @@ -218,6 +218,10 @@ def animated_xform(obj, options): track_loc = track_loc[0] use_inverted = options.get(constants.HIERARCHY, False) and obj.parent + if times == None: + logger.info("In animated xform: Unable to extract trackable fields from %s", objName) + return tracks + # for each frame inverted_fallback = mathutils.Matrix() if use_inverted else None convert_matrix = AXIS_CONVERSION # matrix to convert the exported matrix @@ -374,7 +378,7 @@ def matrix(obj, options): parent_inverted = obj.parent.matrix_world.inverted(mathutils.Matrix()) return parent_inverted * obj.matrix_world else: - return AXIS_CONVERSION * obj.matrix_world + return obj.matrix_world @_object From 7857352f44a66592c0e5b7f484f0bdac20824b18 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Fri, 18 Mar 2016 13:53:46 -0700 Subject: [PATCH 2/3] Fixed inconsistent tabs --- .../exporters/blender/addons/io_three/exporter/api/object.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/exporters/blender/addons/io_three/exporter/api/object.py b/utils/exporters/blender/addons/io_three/exporter/api/object.py index 827d5cebb6784e..4f12c6e25014e7 100644 --- a/utils/exporters/blender/addons/io_three/exporter/api/object.py +++ b/utils/exporters/blender/addons/io_three/exporter/api/object.py @@ -219,8 +219,8 @@ def animated_xform(obj, options): use_inverted = options.get(constants.HIERARCHY, False) and obj.parent if times == None: - logger.info("In animated xform: Unable to extract trackable fields from %s", objName) - return tracks + logger.info("In animated xform: Unable to extract trackable fields from %s", objName) + return tracks # for each frame inverted_fallback = mathutils.Matrix() if use_inverted else None From ff054272d12d9dfa872cbce6a6d08ef7efaba38c Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Fri, 18 Mar 2016 15:07:34 -0700 Subject: [PATCH 3/3] removed 'Rest' from keyframe animation drop down since it doesn't work; Added tooltip note when hovering over dropdown to inform user that mesh must be in bind pose when exporting --- utils/exporters/blender/addons/io_three/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/exporters/blender/addons/io_three/__init__.py b/utils/exporters/blender/addons/io_three/__init__.py index c982d201641238..28fd64e77a9d70 100644 --- a/utils/exporters/blender/addons/io_three/__init__.py +++ b/utils/exporters/blender/addons/io_three/__init__.py @@ -525,8 +525,7 @@ def animation_options(): """ anim = [ (constants.OFF, constants.OFF.title(), constants.OFF), - (constants.POSE, constants.POSE.title(), constants.POSE), - (constants.REST, constants.REST.title(), constants.REST) + (constants.POSE, constants.POSE.title(), constants.POSE) ] return anim @@ -727,7 +726,7 @@ class ExportThree(bpy.types.Operator, ExportHelper): option_animation_skeletal = EnumProperty( name="", - description="Export animation (skeletal)", + description="Export animation (skeletal) NOTE: Mesh must be in bind pose", items=animation_options(), default=constants.OFF)