Commit: ab0195c78fa20b1c1f8abd1474f0fee07ffb6c8c
Author: Philipp Oeser
Date:   Wed Oct 20 17:27:40 2021 +0200
Branches: master
https://developer.blender.org/rBab0195c78fa20b1c1f8abd1474f0fee07ffb6c8c

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

===================================================================

M       source/blender/blenkernel/intern/armature.c

===================================================================

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 {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to