From 78b348875fb689aa20ff86ea8a99ac79428b2b95 Mon Sep 17 00:00:00 2001 From: SleepKiller Date: Tue, 19 Nov 2019 02:39:23 +1300 Subject: [PATCH] fix blender to .msh space conversions --- addons/io_scene_swbf_msh/msh_model_gather.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/io_scene_swbf_msh/msh_model_gather.py b/addons/io_scene_swbf_msh/msh_model_gather.py index 90be2d9..34792a5 100644 --- a/addons/io_scene_swbf_msh/msh_model_gather.py +++ b/addons/io_scene_swbf_msh/msh_model_gather.py @@ -123,8 +123,8 @@ def create_mesh_geometry(mesh: bpy.types.Mesh) -> List[GeometrySegment]: polygons[tri.material_index].add(tri.polygon_index) segments[tri.material_index].triangles.append([ add_vertex(tri.material_index, tri.vertices[0], tri.loops[0]), - add_vertex(tri.material_index, tri.vertices[2], tri.loops[2]), - add_vertex(tri.material_index, tri.vertices[1], tri.loops[1])]) + add_vertex(tri.material_index, tri.vertices[1], tri.loops[1]), + add_vertex(tri.material_index, tri.vertices[2], tri.loops[2])]) for segment, remap, polys in zip(segments, vertex_remap, polygons): for poly_index in polys: @@ -210,10 +210,10 @@ def get_collision_primitive_shape(obj: bpy.types.Object) -> CollisionPrimitiveSh raise RuntimeError(f"Object '{obj.name}' has no primitive type specified in it's name!") def convert_vector_space(vec: Vector) -> Vector: - return Vector(vec.xzy) + return Vector((-vec.x, vec.z, vec.y)) def convert_scale_space(vec: Vector) -> Vector: return Vector(vec.xzy) def convert_rotation_space(quat: Quaternion) -> Quaternion: - return Quaternion((quat.w, quat.x, quat.z, quat.y)) + return Quaternion((-quat.w, quat.x, -quat.z, -quat.y))