diff options
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 4311e425abf..103a1f7dbd5 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1855,8 +1855,13 @@ bool BKE_gpencil_from_image(SpaceImage *sima, bGPDframe *gpf, const float size, * * \{ */ -void BKE_gpencil_visible_stroke_iter( - Object *ob, gpIterCb layer_cb, gpIterCb stroke_cb, void *thunk, bool do_onion, int cfra) +void BKE_gpencil_visible_stroke_iter(ViewLayer *view_layer, + Object *ob, + gpIterCb layer_cb, + gpIterCb stroke_cb, + void *thunk, + bool do_onion, + int cfra) { bGPdata *gpd = (bGPdata *)ob->data; const bool is_multiedit = GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); @@ -1878,6 +1883,14 @@ void BKE_gpencil_visible_stroke_iter( continue; } + /* Hide the layer if it's defined a view layer filter. This is used to + * generate renders, putting only selected GP layers for each 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))) { + continue; + } + if (is_multiedit) { sta_gpf = end_gpf = NULL; /* Check the whole range and tag the editable frames. */ |