Fix T96347: Pose gizmo shown at wrong location with multiple objects

Regression in [0] error iterating over pose bones which only used the
active-object, also follow the same logic as edit-mode for using the
local-matrix.

[0]: d052169e7e
This commit is contained in:
Campbell Barton 2022-03-29 12:49:04 +11:00
parent 87d9d33c00
commit f99beb730a
Notes: blender-bot 2023-02-14 10:29:30 +01:00
Referenced by issue #96347, Regression: The location of "Viewport Gizmos" is not correct in POSE mode (multi-object/armature editing, multiple bones selected)
Referenced by issue #96241, 3.1: Potential candidates for corrective releases
1 changed files with 2 additions and 2 deletions

View File

@ -939,7 +939,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *ob_iter = objects[ob_index];
const bool use_mat_local = params->use_local_axis && (ob_iter != ob);
const bool use_mat_local = (ob_iter != ob);
/* mislead counting bones... bah. We don't know the gizmo mode, could be mixed */
const int mode = TFM_ROTATION;
@ -951,7 +951,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
}
/* Use channels to get stats. */
LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
LISTBASE_FOREACH (bPoseChannel *, pchan, &ob_iter->pose->chanbase) {
if (!(pchan->bone->flag & BONE_TRANSFORM)) {
continue;
}