diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-01-21 17:57:10 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-01-21 17:57:10 +0300 |
commit | 9c4c3fbabc4f1d535d77f2219db7aedcae222ac9 (patch) | |
tree | ba35664ec2148b1250edcb67c75adfe36955c005 /source/blender/editors | |
parent | f817a11dc6088471ef60512967f793fadae45056 (diff) |
GPencil: Make Layer and Frame duplicate functions more flexible
Now it's possible to copy only part of the data. This will be used in future operators.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/gpencil/editaction_gpencil.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_interpolate.c | 8 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_undo.c | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index aae31b11025..166111c582c 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -276,7 +276,7 @@ void ED_gpencil_layer_frames_duplicate(bGPDlayer *gpl) bGPDframe *gpfd; /* duplicate frame, and deselect self */ - gpfd = BKE_gpencil_frame_duplicate(gpf); + gpfd = BKE_gpencil_frame_duplicate(gpf, true); gpf->flag &= ~GP_FRAME_SELECT; BLI_insertlinkafter(&gpl->frames, gpf, gpfd); @@ -361,7 +361,7 @@ bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac) /* if frame is selected, make duplicate it and its strokes */ if (gpf->flag & GP_FRAME_SELECT) { /* make a copy of this frame */ - bGPDframe *new_frame = BKE_gpencil_frame_duplicate(gpf); + bGPDframe *new_frame = BKE_gpencil_frame_duplicate(gpf, true); BLI_addtail(&copied_frames, new_frame); /* extend extents for keyframes encountered */ diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 9a952e1a54b..fd0d5656448 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -283,8 +283,8 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi) tgpil = MEM_callocN(sizeof(tGPDinterpolate_layer), "GPencil Interpolate Layer"); tgpil->gpl = gpl; - tgpil->prevFrame = BKE_gpencil_frame_duplicate(gpl->actframe); - tgpil->nextFrame = BKE_gpencil_frame_duplicate(gpl->actframe->next); + tgpil->prevFrame = BKE_gpencil_frame_duplicate(gpl->actframe, true); + tgpil->nextFrame = BKE_gpencil_frame_duplicate(gpl->actframe->next, true); BLI_addtail(&tgpi->ilayers, tgpil); @@ -998,8 +998,8 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op) } /* store extremes */ - prevFrame = BKE_gpencil_frame_duplicate(gpl->actframe); - nextFrame = BKE_gpencil_frame_duplicate(gpl->actframe->next); + prevFrame = BKE_gpencil_frame_duplicate(gpl->actframe, true); + nextFrame = BKE_gpencil_frame_duplicate(gpl->actframe->next, true); /* Loop over intermediary frames and create the interpolation */ for (cframe = prevFrame->framenum + step; cframe < nextFrame->framenum; cframe += step) { diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c index d9bc77c8715..e545a3365e9 100644 --- a/source/blender/editors/gpencil/gpencil_undo.c +++ b/source/blender/editors/gpencil/gpencil_undo.c @@ -93,7 +93,7 @@ int ED_undo_gpencil_step(bContext *C, const int step) LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { /* make a copy of source layer and its data */ - gpld = BKE_gpencil_layer_duplicate(gpl); + gpld = BKE_gpencil_layer_duplicate(gpl, true, true); BLI_addtail(&gpd->layers, gpld); } } |