diff --git a/export_seanim.py b/export_seanim.py index 5753ec4..fcdf93e 100644 --- a/export_seanim.py +++ b/export_seanim.py @@ -40,14 +40,14 @@ def get_rot_quat(bone, anim_type): def gen_loc_key(frame, pose_bone, anim_type): # Remove the multiplication later loc = get_loc_vec(pose_bone, anim_type) * g_scale - return SEAnim.KeyFrame(frame, (loc.x, loc.y, loc.z)) + return SEAnim.KeyFrame(frame, (loc.x, loc.z, loc.y)) # Generate a SEAnim compatible ROT keyframe from a given pose bone def gen_rot_key(frame, pose_bone, anim_type): quat = get_rot_quat(pose_bone, anim_type) - return SEAnim.KeyFrame(frame, (quat.x, quat.y, quat.z, quat.w)) + return SEAnim.KeyFrame(frame, (quat.x, quat.z, quat.y, -quat.w)) def gen_scale_key(frame, pose_bone, anim_type): @@ -55,7 +55,7 @@ def gen_scale_key(frame, pose_bone, anim_type): Generate an SEAnim compatible SCALE keyframe from a given pose bone ''' scale = tuple(pose_bone.scale) - return SEAnim.KeyFrame(frame, scale) + return SEAnim.KeyFrame(frame, (scale[0], scale[2], scale[1])) def resolve_animtype(self): diff --git a/import_seanim.py b/import_seanim.py index 5761a4e..82a8429 100644 --- a/import_seanim.py +++ b/import_seanim.py @@ -172,7 +172,9 @@ def load_seanim(self, context, progress, filepath=""): for k, key in enumerate(tag.posKeys): # Currently the conversion is only here because I never # added scaling options for Blender-CoD - offset = Vector(key.data) * g_scale + offset = Vector(( + key.data[0], key.data[2], key.data[1] + )) * g_scale # Viewanims are SEANIM_TYPE_ABSOLUTE - But all children of # j_gun has a SEANIM_TYPE_RELATIVE override @@ -207,8 +209,9 @@ def load_seanim(self, context, progress, filepath=""): for k, key in enumerate(tag.rotKeys): # Convert the Quaternion to WXYZ - quat = Quaternion( - (key.data[3], key.data[0], key.data[1], key.data[2])) + quat = Quaternion(( + -key.data[3], key.data[0], key.data[2], key.data[1] + )) angle = quat.to_matrix().to_3x3() bone.matrix_basis.identity() @@ -247,7 +250,7 @@ def load_seanim(self, context, progress, filepath=""): (-1, bone.scale[axis])) # Add the control keyframe for k, key in enumerate(tag.scaleKeys): - scale = Vector(key.data) + scale = Vector((key.data[0], key.data[2], key.data[1])) for axis, fcurve in enumerate(fcurves): fcurve.keyframe_points[