diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-01-20 18:18:04 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-01-20 18:18:20 +0300 |
commit | a5f19e3f7270b335d324c4fa5a9ca33e59376ef0 (patch) | |
tree | 11410888888e8098c42ad74912f7f9c515e2e9e5 /source/blender/blenkernel/intern/gpencil.c | |
parent | 4dbaee02937e887b28696339da2d3ad4840966b1 (diff) |
Fix T73265: GPencil console error when delete frist frame
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 98c8f46970f..b1cf8ad8570 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -939,9 +939,15 @@ bGPDframe *BKE_gpencil_layer_getframe(bGPDlayer *gpl, int cframe, eGP_GetFrame_M gpl->actframe = gpf; } else { - /* unresolved errogenous situation! */ - CLOG_STR_ERROR(&LOG, "cannot find appropriate gp-frame"); - /* gpl->actframe should still be NULL */ + /* If delete first frame, need to find one. */ + if (gpl->frames.first != NULL) { + gpl->actframe = gpl->frames.first; + } + else { + /* unresolved errogenous situation! */ + CLOG_STR_ERROR(&LOG, "cannot find appropriate gp-frame"); + /* gpl->actframe should still be NULL */ + } } } else { |