Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-09-28 23:28:41 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-09-28 23:28:41 +0400
commitf18f2fbb33d90ecc91e6f3d063cb9f97f217e808 (patch)
tree6c4a4b91904f252fe957f66280aab784c8d443aa /source/blender/blenkernel/intern/gpencil.c
parentf418097bc600fab537538ede72923d833ce60573 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r--source/blender/blenkernel/intern/gpencil.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 31dd79e7623..4d17bd286b4 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -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) {