diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-08-03 14:43:24 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-08-03 14:43:42 +0300 |
commit | 0342fb5d20cd13b495a7511ccfdfc3044d83cb04 (patch) | |
tree | b1ee5f64b75c5f071999496daa7e2e4819627d2c /source/blender/blenkernel/intern | |
parent | dbd34a5acb3d0be2bdbad54a427153de49e47f8e (diff) |
Fix T90387: division by zero when trying to invert scale
Fix division by zero when `BKE_bone_parent_transform_invert()` inverts a
scale vector with zero components.
Zero values in the to-be-inverted vector are now simply skipped, i.e.
remain zero after inversion. This at least ensures that
`invert_v3_safe(invert_v3_safe(vector))` results in the same vector.
This commit does NOT fix the conceptual problem that an inversion of a
potentially non-invertible vector is relied upon. It just avoids the
division by zero.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 434d696f9bd..1f02b084534 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1882,7 +1882,7 @@ void BKE_bone_parent_transform_invert(struct BoneParentTransform *bpt) { invert_m4(bpt->rotscale_mat); invert_m4(bpt->loc_mat); - invert_v3(bpt->post_scale); + invert_v3_safe(bpt->post_scale); } void BKE_bone_parent_transform_combine(const struct BoneParentTransform *in1, |