Merge branch 'blender-v2.93-release'

This commit is contained in:
Falk David 2021-05-26 16:34:03 +02:00
commit a6f3bb36df
1 changed files with 12 additions and 3 deletions

View File

@ -2667,6 +2667,7 @@ void BKE_gpencil_visible_stroke_iter(ViewLayer *view_layer,
bGPDframe *act_gpf = gpl->actframe;
bGPDframe *sta_gpf = act_gpf;
bGPDframe *end_gpf = act_gpf ? act_gpf->next : NULL;
float prev_opacity = gpl->opacity;
if (gpl->flag & GP_LAYER_HIDE) {
continue;
@ -2682,9 +2683,12 @@ void BKE_gpencil_visible_stroke_iter(ViewLayer *view_layer,
* This is used only in final render and never in Viewport. */
if ((view_layer != NULL) && (gpl->viewlayername[0] != '\0') &&
(!STREQ(view_layer->name, gpl->viewlayername))) {
/* If the layer is used as mask, cannot be filtered or the masking system
* will crash because needs the mask layer in the draw pipeline. */
if (!gpencil_is_layer_mask(view_layer, gpd, gpl)) {
/* Do not skip masks when rendering the viewlayer so that it can still be used to clip
* other layers. Instead set their opacity to zero. */
if (gpencil_is_layer_mask(view_layer, gpd, gpl)) {
gpl->opacity = 0.0f;
}
else {
continue;
}
}
@ -2779,6 +2783,7 @@ void BKE_gpencil_visible_stroke_iter(ViewLayer *view_layer,
if (layer_cb) {
layer_cb(gpl, act_gpf, NULL, thunk);
}
gpl->opacity = prev_opacity;
continue;
}
@ -2816,6 +2821,7 @@ void BKE_gpencil_visible_stroke_iter(ViewLayer *view_layer,
/* If layer solo mode and Paint mode, only keyframes with data are displayed. */
if (GPENCIL_PAINT_MODE(gpd) && (gpl->flag & GP_LAYER_SOLO_MODE) &&
(act_gpf->framenum != cfra)) {
gpl->opacity = prev_opacity;
continue;
}
@ -2826,6 +2832,9 @@ void BKE_gpencil_visible_stroke_iter(ViewLayer *view_layer,
stroke_cb(gpl, act_gpf, gps, thunk);
}
}
/* Restore the opacity in case it was overwritten (used to hide masks in render). */
gpl->opacity = prev_opacity;
}
}