@@ -51,9 +51,14 @@ def anim_export(self_pass, filepath, arm_active, action_active, start_frame, end
5151 scale_map_temp = {}
5252 for pbone in arm_active .pose .bones :
5353 tmp_loc , tmp_rot , tmp_scale = pbone .matrix .decompose ()
54+ # Matrix scales necessary to obtain local scales resulting from constraints
55+ if pbone .parent :
56+ parent_scale = pbone .parent .matrix .to_scale ()
57+ tmp_scale = mathutils .Vector ((tmp_scale .x / parent_scale .x , tmp_scale .y / parent_scale .y , tmp_scale .z / parent_scale .z ))
58+
5459 tmp_matrix = mathutils .Matrix .LocRotScale (tmp_loc , tmp_rot , mathutils .Vector ((1.0 , 1.0 , 1.0 )))
5560 matrix_map_temp .update ({pbone .name : tmp_matrix })
56- scale_map_temp .update ({pbone .name : pbone . scale . copy ()}) # normal scale is different from matrix scale
61+ scale_map_temp .update ({pbone .name : tmp_scale })
5762
5863 # Negate unscaled parent matrices, write to buffer with actual scales
5964 for pbone in arm_active .pose .bones :
@@ -64,7 +69,7 @@ def anim_export(self_pass, filepath, arm_active, action_active, start_frame, end
6469 tmp_parent_matrix = mathutils .Matrix ()
6570 tmp_bone_length = 0.0
6671 tmp_matrix = tmp_parent_matrix .inverted () @ matrix_map_temp [pbone .name ]
67- tmp_loc , tmp_rot , tmp_scale = tmp_matrix .decompose ()
72+ tmp_loc , tmp_rot , _ = tmp_matrix .decompose ()
6873 tmp_scale = scale_map_temp [pbone .name ]
6974
7075 if self_pass .bool_yx_skel :
0 commit comments