From 899fe33e913b3960353d7c19be95b679ea30909e Mon Sep 17 00:00:00 2001 From: TigerKat Date: Tue, 26 Jan 2021 23:41:09 +0930 Subject: [PATCH] A proper fix for the X-axis flipping. --- export_geo.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/export_geo.py b/export_geo.py index 6c45f57..5129c39 100644 --- a/export_geo.py +++ b/export_geo.py @@ -3,6 +3,7 @@ from .geomesh import * from .bones import * import bpy.path import bpy +import mathutils from bpy_extras.io_utils import axis_conversion @@ -111,8 +112,13 @@ def save(operator, context, scale = 1.0, filepath = "", global_matrix = None, us body_name = bpy.path.display_name_from_filepath(filepath) geo.setName(body_name) - axis_rotation = axis_conversion('-Y', 'Z', 'Z', 'Y') + #axis_rotation = axis_conversion('-Y', 'Z', 'Z', 'Y') #axis_rotation = axis_conversion('Y', 'Z', '-Z', 'Y') + axis_rotation = mathutils.Matrix([ + [-1, 0, 0], + [0, 0, -1], + [0, 1, 0], + ]) axis_rotation.resize_4x4() print("scale: %s" % (scale, )) @@ -152,7 +158,7 @@ def save(operator, context, scale = 1.0, filepath = "", global_matrix = None, us convert_mesh(geo_model, mesh, ob) - if True: #flip bones + if False: #flip bones for i in range(len(geo.models) - 1, -1, -1): name = geo.models[i].name.decode("utf-8") #if reg_exp.search(name) is not None: