From d4194576b727afa9498394268cafd6439a2f90a1 Mon Sep 17 00:00:00 2001 From: TigerKat Date: Mon, 22 Jul 2019 12:29:46 +0930 Subject: [PATCH] Now applies the object's world scale to the exported mesh. --- __init__.py | 2 +- export_geo.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index ca83f7b..f214823 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ bl_info = { "name": "City of Heroes (.geo)", "author": "TigerKat", - "version": (0, 1, 1), + "version": (0, 1, 2), "blender": (2, 79, 0), "location": "File > Import/Export,", "description": "City of Heroes (.geo)", diff --git a/export_geo.py b/export_geo.py index 9ee122f..425b9e8 100644 --- a/export_geo.py +++ b/export_geo.py @@ -93,8 +93,11 @@ def save(operator, context, filepath = "", global_matrix = None, use_mesh_modifi #translate_matrix = Matrix.Translation(-ob.location) translate_matrix = Matrix() - # * ob.matrix_world - mesh.transform(global_matrix * translate_matrix * axis_rotation) + #scale_matrix = Matrix.Scale(1 / 0.30480000376701355, 4) + scale_matrix = Matrix.Scale(1, 4) + obj_matrix = ob.matrix_world + obj_scale = obj_matrix.to_scale()[0] #assume scaling is uniform on all axis + mesh.transform(global_matrix *obj_scale * translate_matrix * scale_matrix * axis_rotation) mesh.calc_normals()