Fix T73265: GPencil console error when delete frist frame
This commit is contained in:
@@ -938,12 +938,18 @@ bGPDframe *BKE_gpencil_layer_getframe(bGPDlayer *gpl, int cframe, eGP_GetFrame_M
|
|||||||
else if (found) {
|
else if (found) {
|
||||||
gpl->actframe = gpf;
|
gpl->actframe = gpf;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* If delete first frame, need to find one. */
|
||||||
|
if (gpl->frames.first != NULL) {
|
||||||
|
gpl->actframe = gpl->frames.first;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* unresolved errogenous situation! */
|
/* unresolved errogenous situation! */
|
||||||
CLOG_STR_ERROR(&LOG, "cannot find appropriate gp-frame");
|
CLOG_STR_ERROR(&LOG, "cannot find appropriate gp-frame");
|
||||||
/* gpl->actframe should still be NULL */
|
/* gpl->actframe should still be NULL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* currently no frames (add if allowed to) */
|
/* currently no frames (add if allowed to) */
|
||||||
if (addnew) {
|
if (addnew) {
|
||||||
|
Reference in New Issue
Block a user