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:
@@ -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. */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user