diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-23 11:31:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-23 11:35:06 +0300 |
commit | 309cfbceaa590828b61bfd72f12ef976f9808392 (patch) | |
tree | 96321104d6fe9fc59ee79c8b784344d76cc6eadc /source/blender/editors/armature/armature_edit.c | |
parent | 3a3708cefb7ae87f53ce45b65754fbb857e945a1 (diff) |
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
Diffstat (limited to 'source/blender/editors/armature/armature_edit.c')
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 20 |
1 files changed, 10 insertions, 10 deletions
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 */ |