diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-09-03 21:18:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-09-03 21:23:18 +0300 |
commit | c3fef001ee926fc183255b623f56da9fc5fcbb73 (patch) | |
tree | 493dcccebf779cb52f462a01c79407350da65286 /source/blender/editors/space_view3d | |
parent | 54ad5766669a23976b9a9fab379bb44ba740c9be (diff) |
View-Selected: use custom bones boundbox
Support using custom pose-bone transform and object when calculating view bounds.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 811eb7e731e..a14d3eab281 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -44,6 +44,7 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BKE_armature.h" #include "BKE_camera.h" #include "BKE_context.h" #include "BKE_font.h" @@ -3042,24 +3043,7 @@ static int viewselected_exec(bContext *C, wmOperator *op) ok = ED_view3d_minmax_verts(obedit, min, max); /* only selected */ } else if (ob && (ob->mode & OB_MODE_POSE)) { - if (ob->pose) { - bArmature *arm = ob->data; - bPoseChannel *pchan; - float vec[3]; - - for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { - if (pchan->bone->flag & BONE_SELECTED) { - if (pchan->bone->layer & arm->layer) { - bPoseChannel *pchan_tx = pchan->custom_tx ? pchan->custom_tx : pchan; - ok = 1; - mul_v3_m4v3(vec, ob->obmat, pchan_tx->pose_head); - minmax_v3v3_v3(min, max, vec); - mul_v3_m4v3(vec, ob->obmat, pchan_tx->pose_tail); - minmax_v3v3_v3(min, max, vec); - } - } - } - } + ok = BKE_pose_minmax(ob, min, max, true, true); } else if (BKE_paint_select_face_test(ob)) { ok = paintface_minmax(ob, min, max); |