From 309cfbceaa590828b61bfd72f12ef976f9808392 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Jun 2020 18:31:10 +1000 Subject: Transform: default to median center instead of bounds When neither bounds or median is selected, snapping the cursor to the selection was using bounds which often doesn't give useful results. Resolves T78135 --- source/blender/editors/armature/armature_edit.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index a7a705a6202..a010fbd5e81 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -140,7 +140,16 @@ void ED_armature_origin_set( mul_m4_v3(ob->imat, cent); } else { - if (around == V3D_AROUND_CENTER_MEDIAN) { + if (around == V3D_AROUND_CENTER_BOUNDS) { + float min[3], max[3]; + INIT_MINMAX(min, max); + for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { + minmax_v3v3_v3(min, max, ebone->head); + minmax_v3v3_v3(min, max, ebone->tail); + } + mid_v3_v3v3(cent, min, max); + } + else { /* #V3D_AROUND_CENTER_MEDIAN. */ int total = 0; zero_v3(cent); for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { @@ -152,15 +161,6 @@ void ED_armature_origin_set( mul_v3_fl(cent, 1.0f / (float)total); } } - else { - float min[3], max[3]; - INIT_MINMAX(min, max); - for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { - minmax_v3v3_v3(min, max, ebone->head); - minmax_v3v3_v3(min, max, ebone->tail); - } - mid_v3_v3v3(cent, min, max); - } } /* Do the adjustments */ -- cgit v1.2.3