diff options
Diffstat (limited to 'csv_anim_bck_import.py')
-rw-r--r-- | csv_anim_bck_import.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/csv_anim_bck_import.py b/csv_anim_bck_import.py index b9c5bbf..db65dd5 100644 --- a/csv_anim_bck_import.py +++ b/csv_anim_bck_import.py @@ -2,6 +2,8 @@ CSV importer for the BCK animation type CSVs that come from the j3d animation editor program animations for now will be imported with linear interpolation +seems to me that the majority of the animations just use linear +as the interpolation method between keyframes of animation rows ''' # Notes (AFAIK): @@ -10,15 +12,8 @@ animations for now will be imported with linear interpolation # - In all the Mario CSV BCKs I've seen from J3D Animation # Editor the "smooth" interpolation type isn't used at all # for animation rows that contain more than the first frame value -# or JAE just converts the animation to linear timing for easier -# processing -# - smooth interpolation uses the cubic hermite spline to get in-between -# keyframe values for the animation transition (I am not sure about this) -# - "tangent out" is the "symmetric" tangent mode explained on the link above -# (I am not sure about this) -# - "tangent in-out" is the "piece-wise" tangent mode explained on the link above -# (I am also not sure about this) -# - all "smooth" frame calculations will assume the upper assumptions +# it could be that JAE just converts the animation to linear +# timing for easier processing but I am not certain import bpy, math, re from mathutils import Matrix @@ -513,9 +508,7 @@ def read_csv_bck(context, filepath, import_type): # rest pose (irp) transformation matrix (T * R * S) ################################################### - anim_irp_mat = calc_translation_matrix(anim_temp[6], anim_temp[7], anim_temp[8]) - * calc_rotation_matrix(anim_temp[3], anim_temp[4], anim_temp[5]) - * calc_scale_matrix(anim_temp[0], anim_temp[1], anim_temp[2]) + anim_irp_mat = calc_translation_matrix(anim_temp[6], anim_temp[7], anim_temp[8]) * calc_rotation_matrix(anim_temp[3], anim_temp[4], anim_temp[5]) * calc_scale_matrix(anim_temp[0], anim_temp[1], anim_temp[2]) ######################################################### # calculate the animation matrix related to the rest pose @@ -526,9 +519,7 @@ def read_csv_bck(context, filepath, import_type): if (bone_number == 0): anim_rp_mat = anim_irp_mat else: - anim_rp_mat = (data_bone.parent.matrix_local.inverted() - * data_bone.matrix_local).inverted() - * anim_irp_mat + anim_rp_mat = (data_bone.parent.matrix_local.inverted() * data_bone.matrix_local).inverted() * anim_irp_mat ##################################### # extract calculated animation values |