Fix T79772: Gpencil. Additive drawing doesn't work when creating fills

This option was not supported in Fill tool
This commit is contained in:
Antonio Vazquez 2020-08-14 19:04:53 +02:00
parent f491442eb0
commit 36e4d4af5b
Notes: blender-bot 2023-02-14 08:47:25 +01:00
Referenced by issue #79772, Gpencil. Additive drawing doesn't work when creating fills
1 changed files with 9 additions and 1 deletions

View File

@ -237,6 +237,7 @@ static void gpencil_draw_datablock(tGPDfill *tgpf, const float ink[4])
bGPdata *gpd = tgpf->gpd;
Brush *brush = tgpf->brush;
BrushGpencilSettings *brush_settings = brush->gpencil_settings;
ToolSettings *ts = tgpf->scene->toolsettings;
tGPDdraw tgpw;
tgpw.rv3d = tgpf->rv3d;
@ -309,7 +310,14 @@ static void gpencil_draw_datablock(tGPDfill *tgpf, const float ink[4])
/* if active layer and no keyframe, create a new one */
if (gpl == tgpf->gpl) {
if ((gpl->actframe == NULL) || (gpl->actframe->framenum != tgpf->active_cfra)) {
BKE_gpencil_layer_frame_get(gpl, tgpf->active_cfra, GP_GETFRAME_ADD_NEW);
short add_frame_mode;
if (ts->gpencil_flags & GP_TOOL_FLAG_RETAIN_LAST) {
add_frame_mode = GP_GETFRAME_ADD_COPY;
}
else {
add_frame_mode = GP_GETFRAME_ADD_NEW;
}
BKE_gpencil_layer_frame_get(gpl, tgpf->active_cfra, add_frame_mode);
}
}