Fix T86692: Start Line Art GP objects on frame 0

If playback starts before the first GP frame, we will get "ghost"
strokes.
This commit is contained in:
2021-03-18 17:48:46 +08:00
committed by Sebastian Parborg
parent c114c78f57
commit d39a1e3cab
3 changed files with 2 additions and 2 deletions

View File

@@ -111,7 +111,7 @@ void ED_gpencil_create_lineart(bContext *C, Object *ob)
bGPDlayer *lines = BKE_gpencil_layer_addnew(gpd, "Lines", true);
/* frames */
BKE_gpencil_frame_addnew(lines, CFRA);
BKE_gpencil_frame_addnew(lines, 0);
/* update depsgraph */
/* To trigger modifier update, this is still needed although we don't have any strokes. */

View File

@@ -152,7 +152,6 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec
BKE_gpencil_frame_active_set(depsgraph, gpd);
bGPDframe *gpf = gpl->actframe;
if (gpf == NULL) {
BKE_gpencil_frame_addnew(gpl, DEG_get_evaluated_scene(depsgraph)->r.cfra);
return;
}

View File

@@ -355,6 +355,7 @@ static void lineart_gpencil_clear_strokes_exec_common(Object *ob)
continue;
}
BKE_gpencil_free_frames(gpl);
BKE_gpencil_frame_addnew(gpl, 0);
md->mode |= eGpencilModifierMode_Realtime | eGpencilModifierMode_Render;