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:
authorAntonio Vazquez <blendergit@gmail.com>2020-06-08 10:01:07 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-06-08 10:04:25 +0300
commit11ba9eec70175b39e34943c8ffacb54c35cbb897 (patch)
tree7fd3240e0c84ce39c0b4efff443c405c74f7f8c4 /source/blender/editors/gpencil
parent917ab4fbf99b4d431ef4b7c357eefdcec562ce85 (diff)
GPencil: Show only first frame if current frame is equals or greater than current frame
Previously, the first frame was displayed from frame 0, but now, the first frame is only displayed when the current frame is equal or greater than the keyframe number. The previous system was logical when the grease pencil was not an object, but now it seems more logical to display the keyframe if the current frame is equal to or greater than the keyframe number. Reviewed By: mendio, pepeland Differential Revision: https://developer.blender.org/D7851
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c5
-rw-r--r--source/blender/editors/gpencil/gpencil_primitive.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 06079c34d12..a9eb94498ad 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2127,7 +2127,12 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps
add_frame_mode = GP_GETFRAME_ADD_NEW;
}
+ bool need_tag = p->gpl->actframe == NULL;
p->gpf = BKE_gpencil_layer_frame_get(p->gpl, CFRA, add_frame_mode);
+ /* Only if there wasn't an active frame, need update. */
+ if (need_tag) {
+ DEG_id_tag_update(&p->gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
+ }
if (p->gpf == NULL) {
p->status = GP_STATUS_ERROR;
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 875a6265497..82ae99b30be 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -1308,7 +1308,12 @@ static void gpencil_primitive_interaction_end(bContext *C,
add_frame_mode = GP_GETFRAME_ADD_NEW;
}
+ bool need_tag = tgpi->gpl->actframe == NULL;
gpf = BKE_gpencil_layer_frame_get(tgpi->gpl, tgpi->cframe, add_frame_mode);
+ /* Only if there wasn't an active frame, need update. */
+ if (need_tag) {
+ DEG_id_tag_update(&tgpi->gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
+ }
/* prepare stroke to get transferred */
gps = tgpi->gpf->strokes.first;