Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-01-04 21:35:42 +0300
committerAntonioya <blendergit@gmail.com>2019-01-04 21:36:06 +0300
commit4b486eaec9763108fd471b7705133c45116df966 (patch)
tree60c81593aae709eef8a49cd6bb04ae588af0ec1a
parentbd5394f6c0bec4eb969aa8bd24b072d7dd9ab04d (diff)
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.
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c7
1 files changed, 7 insertions, 0 deletions
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)