diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-16 08:27:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-16 08:27:53 +0300 |
commit | 55939bf21936c6bef5c350fbf679c08a7c57ea88 (patch) | |
tree | 0749c2e1d69a918266e842155203e607fd5d86af /source/blender/editors | |
parent | 61a22262d19e21d457b7a06166c207d2cba717a2 (diff) | |
parent | 80f7249d09a76b7e045525fa8f78c7d660a8749d (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 24 |
2 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index f41aa432b35..75b80627dff 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -1303,7 +1303,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op)) { bArmature *arm; EditBone *curBone, *ebone_next; - Object *obedit = CTX_data_edit_object(C); // XXX get from context + Object *obedit = CTX_data_edit_object(C); bool changed = false; arm = obedit->data; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 71ec7bf700c..c38bcbcd645 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1904,7 +1904,6 @@ static int do_armature_box_select( const rcti *rect, bool select, bool extend) { bArmature *arm = vc->obedit->data; - EditBone *ebone; int a; unsigned int buffer[MAXPICKBUF]; @@ -1913,7 +1912,7 @@ static int do_armature_box_select( hits = view3d_opengl_select(eval_ctx, vc, buffer, MAXPICKBUF, rect, VIEW3D_SELECT_ALL); /* clear flag we use to detect point was affected */ - for (ebone = arm->edbo->first; ebone; ebone = ebone->next) + for (EditBone *ebone = arm->edbo->first; ebone; ebone = ebone->next) ebone->flag &= ~BONE_DONE; if (extend == false && select) @@ -1923,17 +1922,17 @@ static int do_armature_box_select( for (a = 0; a < hits; a++) { int index = buffer[(4 * a) + 3]; if (index != -1) { - ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY)); if ((index & 0xFFFF0000) == 0) { continue; } + EditBone *ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY)); if ((select == false) || ((ebone->flag & BONE_UNSELECTABLE) == 0)) { if (index & BONESEL_TIP) { ebone->flag |= BONE_DONE; if (select) ebone->flag |= BONE_TIPSEL; else ebone->flag &= ~BONE_TIPSEL; } - + if (index & BONESEL_ROOT) { ebone->flag |= BONE_DONE; if (select) ebone->flag |= BONE_ROOTSEL; @@ -1942,27 +1941,30 @@ static int do_armature_box_select( } } } - + /* now we have to flush tag from parents... */ - for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { + for (EditBone *ebone = arm->edbo->first; ebone; ebone = ebone->next) { if (ebone->parent && (ebone->flag & BONE_CONNECTED)) { - if (ebone->parent->flag & BONE_DONE) + if (ebone->parent->flag & BONE_DONE) { ebone->flag |= BONE_DONE; + } } } - + /* only select/deselect entire bones when no points where in the rect */ for (a = 0; a < hits; a++) { int index = buffer[(4 * a) + 3]; if (index != -1) { - ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY)); if (index & BONESEL_BONE) { + EditBone *ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY)); if ((select == false) || ((ebone->flag & BONE_UNSELECTABLE) == 0)) { if (!(ebone->flag & BONE_DONE)) { - if (select) + if (select) { ebone->flag |= (BONE_ROOTSEL | BONE_TIPSEL | BONE_SELECTED); - else + } + else { ebone->flag &= ~(BONE_ROOTSEL | BONE_TIPSEL | BONE_SELECTED); + } } } } |