GP: Add Fill keyframe if active not equal to CFRA

When fill a stroke if the fill layer hasn't keyframe, the fill is wrong because previous fill shape hide area to fill.

Now, if the keyframe is missing in the active layer for the current frame, a new frame is added.
This commit is contained in:
Antonio Vazquez 2019-01-04 19:35:42 +01:00
parent bd5394f6c0
commit 4b486eaec9
1 changed files with 7 additions and 0 deletions

View File

@ -220,6 +220,13 @@ static void gp_draw_datablock(tGPDfill *tgpf, const float ink[4])
if (gpl->flag & GP_LAYER_HIDE)
continue;
/* if active layer and no keyframe, create a new one */
if (gpl == tgpf->gpl) {
if (gpl->actframe->framenum != cfra_eval) {
BKE_gpencil_layer_getframe(gpl, cfra_eval, GP_GETFRAME_ADD_NEW);
}
}
/* get frame to draw */
bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, cfra_eval, GP_GETFRAME_USE_PREV);
if (gpf == NULL)