Fix [#36831] Grease Pencil dont create a drawing in current frame less than 1

Only forbid negframes when user has not allowed them in whole Blender (userpref, editing). Else, it's more than annoying to not be able to draw negframed gpencil.
This commit is contained in:
Bastien Montagne
2013-09-28 19:28:41 +00:00
parent f418097bc6
commit f18f2fbb33

View File

@@ -42,6 +42,7 @@
#include "BLF_translation.h"
#include "DNA_gpencil_types.h"
#include "DNA_userdef_types.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
@@ -125,8 +126,8 @@ bGPDframe *gpencil_frame_addnew(bGPDlayer *gpl, int cframe)
bGPDframe *gpf, *gf;
short state = 0;
/* error checking */
if ((gpl == NULL) || (cframe <= 0))
/* error checking (neg frame only if they are not allowed in Blender!) */
if ((gpl == NULL) || ((U.flag & USER_NONEGFRAMES) && (cframe <= 0)))
return NULL;
/* allocate memory for this frame */
@@ -349,7 +350,8 @@ bGPDframe *gpencil_layer_getframe(bGPDlayer *gpl, int cframe, short addnew)
/* error checking */
if (gpl == NULL) return NULL;
if (cframe <= 0) cframe = 1;
/* No reason to forbid negative frames when they are allowed in Blender! */
if ((U.flag & USER_NONEGFRAMES) && cframe <= 0) cframe = 1;
/* check if there is already an active frame */
if (gpl->actframe) {