[Bf-blender-cvs] [36e4d4af5b0] master: Fix T79772: Gpencil. Additive drawing doesn't work when creating fills

Antonio Vazquez noreply at git.blender.org
Fri Aug 14 19:05:10 CEST 2020


Commit: 36e4d4af5b01e0eb7f90ac34a8b7f8e01118f5fa
Author: Antonio Vazquez
Date:   Fri Aug 14 19:04:53 2020 +0200
Branches: master
https://developer.blender.org/rB36e4d4af5b01e0eb7f90ac34a8b7f8e01118f5fa

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

This option was not supported in Fill tool

===================================================================

M	source/blender/editors/gpencil/gpencil_fill.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 2855f2cc0d7..9d99773348b 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -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);
       }
     }



More information about the Bf-blender-cvs mailing list