diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-07-18 06:21:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-18 07:24:55 +0300 |
commit | 112f0db40d4b4a335bcbb97ce7ca34391dc4408f (patch) | |
tree | 868eaf8ee9ed3d92b9e6a2c07a40fceee93a45bf /source/blender/editors/armature/pose_select.c | |
parent | 807b6c4848723949d929fbcb6620977680e6f8d0 (diff) |
Fix pose de-selection when selecting from object mode
Diffstat (limited to 'source/blender/editors/armature/pose_select.c')
-rw-r--r-- | source/blender/editors/armature/pose_select.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index e9ea49aaf03..5c20b03b908 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -181,10 +181,17 @@ bool ED_armature_pose_select_pick_with_buffer(ViewLayer *view_layer, if (!extend && !deselect && !toggle) { { - uint bases_len = 0; - Base **bases = BKE_object_pose_base_array_get_unique(view_layer, v3d, &bases_len); - ED_pose_deselect_all_multi_ex(bases, bases_len, SEL_DESELECT, true); - MEM_freeN(bases); + /* Don't use 'BKE_object_pose_base_array_get_unique' + * because we may be selecting from object mode. */ + FOREACH_VISIBLE_BASE_BEGIN (view_layer, v3d, base_iter) { + Object *ob_iter = base_iter->object; + if ((ob_iter->type == OB_ARMATURE) && (ob_iter->mode & OB_MODE_POSE)) { + if (ED_pose_deselect_all(ob_iter, SEL_DESELECT, true)) { + ED_pose_bone_select_tag_update(ob_iter); + } + } + } + FOREACH_VISIBLE_BASE_END; } nearBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); arm->act_bone = nearBone; |