diff options
author | Owl <isaclien9752@gmail.com> | 2025-09-26 14:32:34 -0400 |
---|---|---|
committer | Owl <isaclien9752@gmail.com> | 2025-09-26 14:32:34 -0400 |
commit | 70e647076418d114111aa76b5d3639a5b4271e94 (patch) | |
tree | 2e67e3c523818c7628497ff2f6e9e5c9645814d2 /bck_import.py | |
parent | 45dc6171705fd074657b0ed5bde2502431b74c4b (diff) | |
download | blenxy-70e647076418d114111aa76b5d3639a5b4271e94.tar.gz blenxy-70e647076418d114111aa76b5d3639a5b4271e94.zip |
bcsv and other stuff
Diffstat (limited to 'bck_import.py')
-rw-r--r-- | bck_import.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/bck_import.py b/bck_import.py index 398f18d..428cae6 100644 --- a/bck_import.py +++ b/bck_import.py @@ -160,7 +160,7 @@ def import_bck_func(context, options): # convert translation values to blenxy's coordinate space comp_value = bone_anim.comp[j].value[k] if (j == 2 or j == 5 or j == 8): - comp_value /= 100 + comp_value = (comp_value / 100) * options.scale_transl # create the keyframe if (bone_anim.comp[j].time[k] == None): # consider 1 keyframe animation tracks fcurve.keyframe_points.insert(lowest_anim_frame, comp_value) @@ -179,8 +179,8 @@ def import_bck_func(context, options): comp_out_slope = bone_anim.comp[j].out_slope[k] if (j == 2 or j == 5 or j == 8): if (bone_anim.comp[j].kf_count > 1): - comp_in_slope = comp_in_slope / 100 - comp_out_slope = comp_out_slope / 100 + comp_in_slope = (comp_in_slope / 100) * options.scale_transl + comp_out_slope = (comp_out_slope / 100) * options.scale_transl # in slope, assign in-slopes only to keyframes after the first one if (k != 0): @@ -286,9 +286,9 @@ def import_bck_func(context, options): # get the initial animation values scale = [bone_anim.comp[0].value[0], bone_anim.comp[3].value[0], bone_anim.comp[6].value[0]] rot = [bone_anim.comp[1].value[0], bone_anim.comp[4].value[0], bone_anim.comp[7].value[0]] - transl = [bone_anim.comp[2].value[0] / 100, - bone_anim.comp[5].value[0] / 100, - bone_anim.comp[8].value[0] / 100] + transl = [(bone_anim.comp[2].value[0] / 100) * options.scale_transl, + (bone_anim.comp[5].value[0] / 100) * options.scale_transl, + (bone_anim.comp[8].value[0] / 100) * options.scale_transl] # declare the current bone's fcurves list fcurves = [None, None, None, # scale XYZ None, None, None, # rot XYZ @@ -370,7 +370,7 @@ def import_bck_func(context, options): rot[int((k - 1) / 3)] = result elif (k == 2 or k == 5 or k == 8): # transl is_transl_anim = True - transl[int((k - 2) / 3)] = result / 100 + transl[int((k - 2) / 3)] = (result / 100) * options.scale_transl # ~ print("frame S R T: %d %s %s %s" %(j, is_scale_anim, is_rot_anim, is_transl_anim)) # ~ print(scale) @@ -582,6 +582,12 @@ class import_bck(Operator, ExportHelper): ("SRT", "SRT", "Scaling first, Rotation second, Translation last") ) ) + scale_transl = FloatProperty( + name = "Scale translation values:", + description = "Scale up/down translation values in all animation tracks.", + default = 1, + min = 10e-9, + ) # what the importer actually does def execute(self, context): |