summaryrefslogtreecommitdiff
path: root/csv_anim_bck_import.py
diff options
context:
space:
mode:
author“Humming-Owl” <“isaclien9752@gmail.com”>2023-08-29 01:59:50 -0400
committer“Humming-Owl” <“isaclien9752@gmail.com”>2023-08-29 01:59:50 -0400
commit4f8872265b483f0e6c6568dcb423b3638d5dee51 (patch)
tree20d45b689f470cb783019d3457aa5d0a0334d5b3 /csv_anim_bck_import.py
parentc16097bbf4230bc761e0f60be238b3362ef89c2b (diff)
downloadblenxy-4f8872265b483f0e6c6568dcb423b3638d5dee51.tar.gz
blenxy-4f8872265b483f0e6c6568dcb423b3638d5dee51.zip
some minor edits
Diffstat (limited to 'csv_anim_bck_import.py')
-rw-r--r--csv_anim_bck_import.py21
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