[Bf-blender-cvs] [4b486eaec97] master: GP: Add Fill keyframe if active not equal to CFRA

Antonioya noreply at git.blender.org
Fri Jan 4 19:36:17 CET 2019


Commit: 4b486eaec9763108fd471b7705133c45116df966
Author: Antonioya
Date:   Fri Jan 4 19:35:42 2019 +0100
Branches: master
https://developer.blender.org/rB4b486eaec9763108fd471b7705133c45116df966

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.

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

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 95e52290b69..554b94a35f9 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -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)



More information about the Bf-blender-cvs mailing list