[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60412] trunk/blender/source/blender/ blenkernel/intern/gpencil.c: Fix [#36831] Grease Pencil dont create a drawing in current frame less than 1

Bastien Montagne montagne29 at wanadoo.fr
Sat Sep 28 21:28:41 CEST 2013


Revision: 60412
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60412
Author:   mont29
Date:     2013-09-28 19:28:41 +0000 (Sat, 28 Sep 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/gpencil.c

Modified: trunk/blender/source/blender/blenkernel/intern/gpencil.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/gpencil.c	2013-09-28 18:46:56 UTC (rev 60411)
+++ trunk/blender/source/blender/blenkernel/intern/gpencil.c	2013-09-28 19:28:41 UTC (rev 60412)
@@ -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 *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 @@
 	
 	/* 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) {




More information about the Bf-blender-cvs mailing list