GPencil: Fix unreported interpolate crash if no frames
If there is a layer that hasn't frames but is not the active layer the pointer to frames can be NULL and crash. Now, the empty layers are skipped. Reported to me by Samuel Bernou.
This commit is contained in:
parent
d384ad38bc
commit
0361afb165
Notes:
blender-bot
2023-02-13 13:22:20 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
|
@ -491,9 +491,15 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
|
|||
|
||||
tgpil->gpl = gpl;
|
||||
bGPDframe *gpf = gpencil_get_previous_keyframe(gpl, scene->r.cfra, exclude_breakdowns);
|
||||
if (gpf == NULL) {
|
||||
continue;
|
||||
}
|
||||
tgpil->prevFrame = BKE_gpencil_frame_duplicate(gpf, true);
|
||||
|
||||
gpf = gpencil_get_next_keyframe(gpl, scene->r.cfra, exclude_breakdowns);
|
||||
if (gpf == NULL) {
|
||||
continue;
|
||||
}
|
||||
tgpil->nextFrame = BKE_gpencil_frame_duplicate(gpf, true);
|
||||
|
||||
BLI_addtail(&tgpi->ilayers, tgpil);
|
||||
|
|
Loading…
Reference in New Issue