diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-10-20 18:27:40 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-10-21 15:39:42 +0300 |
commit | ab0195c78fa20b1c1f8abd1474f0fee07ffb6c8c (patch) | |
tree | 2ac49b3b756cdf206516f8a5dcb73e9f862ac9cf /source | |
parent | a5917175d8c1a7cab83b401ae2f4affcd4ab8df4 (diff) |
Fix T92169: "View Selected" on Custom Boneshape with transform wrong
Since the introduction in rBfc5bf09fd88c, `BKE_pose_minmax` was not
taking these custom transforms into account (making "View Selected"
ignoring these as well and focusing on the bone instead).
Now consider these transforms in `BKE_pose_minmax`.
Maniphest Tasks: T92169
Differential Revision: https://developer.blender.org/D12942
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 0fa4c6e47e8..65fdc9278e1 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2970,10 +2970,16 @@ bool BKE_pose_minmax(Object *ob, float r_min[3], float r_max[3], bool use_hidden BKE_object_boundbox_get(pchan->custom) : NULL; if (bb_custom) { - float mat[4][4], smat[4][4]; + float mat[4][4], smat[4][4], rmat[4][4], tmp[4][4]; scale_m4_fl(smat, PCHAN_CUSTOM_BONE_LENGTH(pchan)); rescale_m4(smat, pchan->custom_scale_xyz); - mul_m4_series(mat, ob->obmat, pchan_tx->pose_mat, smat); + eulO_to_mat4(rmat, pchan->custom_rotation_euler, ROT_MODE_XYZ); + copy_m4_m4(tmp, pchan_tx->pose_mat); + translate_m4(tmp, + pchan->custom_translation[0], + pchan->custom_translation[1], + pchan->custom_translation[2]); + mul_m4_series(mat, ob->obmat, tmp, rmat, smat); BKE_boundbox_minmax(bb_custom, mat, r_min, r_max); } else { |