summaryrefslogtreecommitdiff
path: root/bck_export.py
diff options
context:
space:
mode:
authorOwl <isaclien9752@gmail.com>2025-09-26 14:32:34 -0400
committerOwl <isaclien9752@gmail.com>2025-09-26 14:32:34 -0400
commit70e647076418d114111aa76b5d3639a5b4271e94 (patch)
tree2e67e3c523818c7628497ff2f6e9e5c9645814d2 /bck_export.py
parent45dc6171705fd074657b0ed5bde2502431b74c4b (diff)
downloadblenxy-70e647076418d114111aa76b5d3639a5b4271e94.tar.gz
blenxy-70e647076418d114111aa76b5d3639a5b4271e94.zip
bcsv and other stuff
Diffstat (limited to 'bck_export.py')
-rw-r--r--bck_export.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/bck_export.py b/bck_export.py
index 4ed7d4e..0fc9a20 100644
--- a/bck_export.py
+++ b/bck_export.py
@@ -108,7 +108,8 @@ def export_bck_func(options, context):
if (options.euler_mode != pose_bone.rotation_mode):
# generate the temp fcurves but first check if they are animation tracks named that way already
for fcurve in list(armature.animation_data.action.fcurves):
- if (fcurve.group.name == temp_fcurve_group
+ if (fcurve.group != None
+ and fcurve.group.name == temp_fcurve_group
and fcurve.data_path == temp_fcurve_data_path): # delete this animation track
armature.animation_data.action.fcurves.remove(fcurve)
for j in range(3):
@@ -206,7 +207,8 @@ def export_bck_func(options, context):
elif (k == 1 or k == 4 or k == 7):
value = round(new_mat.to_euler(options.euler_mode)[int((k - 1) / 3)], options.rounding_vec[1])
elif (k == 2 or k == 5 or k == 8):
- value = round(100 * new_mat.to_translation()[int((k - 2) / 3)], options.rounding_vec[2])
+ value = round((100 * options.scale_transl)
+ * new_mat.to_translation()[int((k - 2) / 3)], options.rounding_vec[2])
# 100 times because of blenxy's coordinates
bck_anim.anim_data[i].comp[k].value.append(value)
@@ -328,7 +330,7 @@ def export_bck_func(options, context):
# ~ print(bck_anim)
# create a raw bck struct and write the BCK file
- raw = bck_funcs.create_smg_bck_raw(bck_anim)
+ raw = bck_funcs.create_smg_bck_raw(bck_anim, options.use_std_pad_size)
# ~ print(raw)
endian_ch = ">" # big endian character for struct.unpack()
if (options.endian == "OPT_B"): # little character
@@ -430,7 +432,7 @@ class export_bck(Operator, ExportHelper):
)
)
mult_order = EnumProperty(
- name = "Scale/Rot/Transl mult order",
+ name = "Scale/Rot/Transl order",
description = "Export animations in the specified matrix multiplication order",
default = "SRT",
items = (
@@ -442,6 +444,17 @@ class export_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,
+ )
+ use_std_pad_size = BoolProperty(
+ name = "Keep \"standard\" padding sizes",
+ description = "Keep the usual binary padding sizes when building the BCK.",
+ default = True
+ )
# what the importer actually does
def execute(self, context):
return export_bck_func(self, context)