diff options
author | Antonioya <blendergit@gmail.com> | 2018-10-30 19:53:30 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-10-30 19:54:01 +0300 |
commit | 6f311ef57ec8760d020b6745be87a6770e5c58ce (patch) | |
tree | b012094a8fb76b858e796a9189aee4679f342771 /source/blender/draw/engines/gpencil/gpencil_draw_utils.c | |
parent | e7811ce0c41652525545989bb1dfce1c8ab2b46b (diff) |
GP: New Fade no active layer overlay option
This option allows to fade all layers except active one. This can help in very crowded scenes with a lot of layers, to verify you are working in the right one.
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_draw_utils.c')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_utils.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index c980e1791db..e0e69e0de91 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1262,6 +1262,7 @@ void DRW_gpencil_populate_datablock( float opacity; bGPDframe *p = NULL; bGPDframe *gpf = NULL; + bGPDlayer *gpl_active = BKE_gpencil_layer_getactive(gpd); /* check if playing animation */ bool playing = stl->storage->is_playing; @@ -1301,14 +1302,20 @@ void DRW_gpencil_populate_datablock( if (gpf == NULL) continue; + opacity = gpl->opacity; /* if pose mode, maybe the overlay to fade geometry is enabled */ if ((draw_ctx->obact) && (draw_ctx->object_mode == OB_MODE_POSE) && (v3d->overlay.flag & V3D_OVERLAY_BONE_SELECT)) { - opacity = gpl->opacity * v3d->overlay.bone_select_alpha; + opacity = opacity * v3d->overlay.bone_select_alpha; } - else { - opacity = gpl->opacity; + /* fade no active layers */ + if ((overlay) && (draw_ctx->object_mode == OB_MODE_GPENCIL_PAINT) && + (v3d->gp_flag & V3D_GP_FADE_NOACTIVE_LAYERS) && + (draw_ctx->obact) && (draw_ctx->obact == ob) && + (gpl != gpl_active)) + { + opacity = opacity * v3d->overlay.gpencil_fade_layer; } /* create derived array data or expand */ |