Now applies the object's world scale to the exported mesh.

master
TigerKat 5 years ago
parent f1f5148584
commit d4194576b7

@ -2,7 +2,7 @@
bl_info = { bl_info = {
"name": "City of Heroes (.geo)", "name": "City of Heroes (.geo)",
"author": "TigerKat", "author": "TigerKat",
"version": (0, 1, 1), "version": (0, 1, 2),
"blender": (2, 79, 0), "blender": (2, 79, 0),
"location": "File > Import/Export,", "location": "File > Import/Export,",
"description": "City of Heroes (.geo)", "description": "City of Heroes (.geo)",

@ -93,8 +93,11 @@ def save(operator, context, filepath = "", global_matrix = None, use_mesh_modifi
#translate_matrix = Matrix.Translation(-ob.location) #translate_matrix = Matrix.Translation(-ob.location)
translate_matrix = Matrix() translate_matrix = Matrix()
# * ob.matrix_world #scale_matrix = Matrix.Scale(1 / 0.30480000376701355, 4)
mesh.transform(global_matrix * translate_matrix * axis_rotation) 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() mesh.calc_normals()

Loading…
Cancel
Save