|
|
@ -3,6 +3,7 @@ from .geomesh import *
|
|
|
|
from .bones import *
|
|
|
|
from .bones import *
|
|
|
|
import bpy.path
|
|
|
|
import bpy.path
|
|
|
|
import bpy
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
import mathutils
|
|
|
|
|
|
|
|
|
|
|
|
from bpy_extras.io_utils import axis_conversion
|
|
|
|
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)
|
|
|
|
body_name = bpy.path.display_name_from_filepath(filepath)
|
|
|
|
geo.setName(body_name)
|
|
|
|
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 = axis_conversion('Y', 'Z', '-Z', 'Y')
|
|
|
|
|
|
|
|
axis_rotation = mathutils.Matrix([
|
|
|
|
|
|
|
|
[-1, 0, 0],
|
|
|
|
|
|
|
|
[0, 0, -1],
|
|
|
|
|
|
|
|
[0, 1, 0],
|
|
|
|
|
|
|
|
])
|
|
|
|
axis_rotation.resize_4x4()
|
|
|
|
axis_rotation.resize_4x4()
|
|
|
|
|
|
|
|
|
|
|
|
print("scale: %s" % (scale, ))
|
|
|
|
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)
|
|
|
|
convert_mesh(geo_model, mesh, ob)
|
|
|
|
|
|
|
|
|
|
|
|
if True: #flip bones
|
|
|
|
if False: #flip bones
|
|
|
|
for i in range(len(geo.models) - 1, -1, -1):
|
|
|
|
for i in range(len(geo.models) - 1, -1, -1):
|
|
|
|
name = geo.models[i].name.decode("utf-8")
|
|
|
|
name = geo.models[i].name.decode("utf-8")
|
|
|
|
#if reg_exp.search(name) is not None:
|
|
|
|
#if reg_exp.search(name) is not None:
|
|
|
|