GPencil: Create Keyframe using Eraser if Auto-key is ONn

Before, the frame was not created, but now if there is
a previous stroke and teh frame changed, the new keyframe
is created.

This is related to T102623
This commit is contained in:
Antonio Vazquez 2022-11-29 12:15:10 +01:00
parent 2b85151a32
commit 2b639f671f
1 changed files with 2 additions and 4 deletions

View File

@ -2229,10 +2229,8 @@ static void gpencil_paint_initstroke(tGPsdata *p,
* -> If there are no strokes in that frame, don't add a new empty frame
*/
if (gpl->actframe && gpl->actframe->strokes.first) {
if (ts->gpencil_flags & GP_TOOL_FLAG_RETAIN_LAST) {
short frame_mode = IS_AUTOKEY_ON(scene) ? GP_GETFRAME_ADD_COPY : GP_GETFRAME_USE_PREV;
gpl->actframe = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, frame_mode);
}
short frame_mode = IS_AUTOKEY_ON(scene) ? GP_GETFRAME_ADD_COPY : GP_GETFRAME_USE_PREV;
gpl->actframe = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, frame_mode);
has_layer_to_erase = true;
break;
}