[Bf-blender-cvs] [86fb8062d7b] blender-v2.82-release: Fix T72155 Overlay: Bone X-ray no longer works in pose or weight paint mode

Clément Foucault noreply at git.blender.org
Tue Feb 4 19:02:11 CET 2020


Commit: 86fb8062d7ba0b52db7b5685f74d9eb7e102350e
Author: Clément Foucault
Date:   Tue Feb 4 19:01:38 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB86fb8062d7ba0b52db7b5685f74d9eb7e102350e

Fix T72155 Overlay: Bone X-ray no longer works in pose or weight paint mode

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

M	source/blender/draw/engines/overlay/overlay_armature.c
M	source/blender/draw/engines/overlay/overlay_private.h

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

diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c
index be1ff1753ab..f9fd06f2c13 100644
--- a/source/blender/draw/engines/overlay/overlay_armature.c
+++ b/source/blender/draw/engines/overlay/overlay_armature.c
@@ -152,7 +152,8 @@ void OVERLAY_armature_cache_init(OVERLAY_Data *vedata)
                              XRAY_FLAG_ENABLED(draw_ctx->v3d);
   pd->armature.show_relations = ((draw_ctx->v3d->flag & V3D_HIDE_HELPLINES) == 0) &&
                                 !is_select_mode;
-  pd->armature.do_pose_fade_geom = (pd->overlay.flag & V3D_OVERLAY_BONE_SELECT) &&
+  pd->armature.do_pose_xray = (pd->overlay.flag & V3D_OVERLAY_BONE_SELECT) != 0;
+  pd->armature.do_pose_fade_geom = pd->armature.do_pose_xray &&
                                    ((draw_ctx->object_mode & OB_MODE_WEIGHT_PAINT) == 0) &&
                                    draw_ctx->object_pose != NULL;
 
@@ -2190,8 +2191,7 @@ static void armature_context_setup(ArmatureDrawContext *ctx,
                                    float *const_color)
 {
   const bool is_object_mode = !do_envelope_dist;
-  const bool is_xray = (ob->dtx & OB_DRAWXRAY) != 0 ||
-                       (pd->armature.do_pose_fade_geom && is_pose_mode);
+  const bool is_xray = (ob->dtx & OB_DRAWXRAY) != 0 || (pd->armature.do_pose_xray && is_pose_mode);
   const bool draw_as_wire = (ob->dt < OB_SOLID);
   const bool is_filled = (!pd->armature.transparent && !draw_as_wire) || !is_object_mode;
   const bool is_transparent = pd->armature.transparent || (draw_as_wire && !is_object_mode);
@@ -2376,7 +2376,8 @@ void OVERLAY_pose_draw(OVERLAY_Data *vedata)
     DRW_draw_pass(psl->armature_bone_select_ps);
 
     if (DRW_state_is_fbo()) {
-      GPU_framebuffer_bind(fbl->overlay_line_fb);
+      GPU_framebuffer_bind(fbl->overlay_line_in_front_fb);
+      GPU_framebuffer_clear_depth(fbl->overlay_line_in_front_fb, 1.0f);
     }
 
     DRW_draw_pass(psl->armature_ps[1]);
diff --git a/source/blender/draw/engines/overlay/overlay_private.h b/source/blender/draw/engines/overlay/overlay_private.h
index afec20b477d..f8eeeed42ef 100644
--- a/source/blender/draw/engines/overlay/overlay_private.h
+++ b/source/blender/draw/engines/overlay/overlay_private.h
@@ -300,6 +300,7 @@ typedef struct OVERLAY_PrivateData {
   struct {
     bool transparent;
     bool show_relations;
+    bool do_pose_xray;
     bool do_pose_fade_geom;
   } armature;
   struct {



More information about the Bf-blender-cvs mailing list