diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 18:31:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 18:34:32 +0300 |
commit | be2bd5d722bf36e076663a27537860bb1842931e (patch) | |
tree | 8f94eee3e7b5c18ada5c90eccd523a8bf0f08388 /source/blender/editors/space_view3d/view3d_edit.c | |
parent | 92786141159430fa36e59e0229e4bbb84f2f04be (diff) |
Fix mixed weight-paint & pose mode
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 6c80033f9df..20eb65197e5 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2821,24 +2821,12 @@ static int viewselected_exec(bContext *C, wmOperator *op) } if (ob && (eval_ctx.object_mode & OB_MODE_WEIGHT_PAINT)) { - /* hard-coded exception, we look for the one selected armature */ - /* this is weak code this way, we should make a generic active/selection callback interface once... */ - Base *base; - for (base = view_layer->object_bases.first; base; base = base->next) { - if (TESTBASELIB(base)) { - if (base->object->type == OB_ARMATURE) { - const bArmature *arm = base->object->data; - if (arm->flag & ARM_POSEMODE) { - break; - } - } - } + Object *ob_armature = BKE_object_pose_armature_get_visible(ob, view_layer); + if (ob_armature) { + ob = ob_armature; } - if (base) - ob = base->object; } - if (is_gp_edit) { CTX_DATA_BEGIN(C, bGPDstroke *, gps, editable_gpencil_strokes) { |