Commit: 495216d2b8b4cb098a01a8dcbdc3d5235b59f5b3
Author: Clément Foucault
Date:   Wed Feb 27 17:39:44 2019 +0100
Branches: master
https://developer.blender.org/rB495216d2b8b4cb098a01a8dcbdc3d5235b59f5b3

Armature: Make selection only work on outlines in wireframe mode

This was not working in edit mode and broken in posemode + bounding box
display type.

This makes possible to select bones inside other bones.

===================================================================

M       source/blender/draw/modes/edit_armature_mode.c
M       source/blender/draw/modes/object_mode.c
M       source/blender/draw/modes/pose_mode.c

===================================================================

diff --git a/source/blender/draw/modes/edit_armature_mode.c 
b/source/blender/draw/modes/edit_armature_mode.c
index 4eaa9447efe..2c47667a4e9 100644
--- a/source/blender/draw/modes/edit_armature_mode.c
+++ b/source/blender/draw/modes/edit_armature_mode.c
@@ -132,6 +132,16 @@ static void EDIT_ARMATURE_draw_scene(void *vedata)
        DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
        DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
 
+       if (DRW_state_is_select()) {
+               DRW_draw_pass(psl->bone_outline[0]);
+               DRW_draw_pass(psl->bone_solid[0]);
+               DRW_draw_pass(psl->bone_wire[0]);
+               DRW_draw_pass(psl->bone_outline[1]);
+               DRW_draw_pass(psl->bone_solid[1]);
+               DRW_draw_pass(psl->bone_wire[1]);
+               return;
+       }
+
        DRW_draw_pass(psl->bone_envelope[0]);
 
        /* For performance reason, avoid blending on MS target. */
diff --git a/source/blender/draw/modes/object_mode.c 
b/source/blender/draw/modes/object_mode.c
index 77fc75f2890..84c711aff60 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -3085,7 +3085,7 @@ static void OBJECT_cache_populate(void *vedata, Object 
*ob)
                {
                        if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
                            (v3d->overlay.flag & V3D_OVERLAY_HIDE_BONES) ||
-                           (ob->dt < OB_WIRE))
+                           ((ob->dt < OB_WIRE) && !DRW_state_is_select()))
                        {
                                break;
                        }
diff --git a/source/blender/draw/modes/pose_mode.c 
b/source/blender/draw/modes/pose_mode.c
index 69c613e7593..24a9a4753aa 100644
--- a/source/blender/draw/modes/pose_mode.c
+++ b/source/blender/draw/modes/pose_mode.c
@@ -260,8 +260,10 @@ static void POSE_draw_scene(void *vedata)
        const bool bone_selection_overlay = 
POSE_is_bone_selection_overlay_active();
 
        if (DRW_state_is_select()) {
+               DRW_draw_pass(psl->bone_outline[0]);
                DRW_draw_pass(psl->bone_solid[0]);
                DRW_draw_pass(psl->bone_wire[0]);
+               DRW_draw_pass(psl->bone_outline[1]);
                DRW_draw_pass(psl->bone_solid[1]);
                DRW_draw_pass(psl->bone_wire[1]);
                return;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to