From 582fa5e36e031e08b2af39d055ac6790a12941ee Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 17 Apr 2015 12:27:27 +1200 Subject: Fix for Grease Pencil and negative frames While investigating T44412, I noticed some weirdness going on when trying to draw on frame 0 (i.e. strokes were getting added to frame 1 instead). Clearly, this seemed like an off-by-one error related to clamping to prevent negative frames which was also excluding frame 0. This commit reverts the fixes made for T36831 in: rBf18f2fbb33d90ecc91e6f3d063cb9f97f217e808 After thinking this over, I think these checks against drawing on negative frames aren't needed. Even if the current userpref setting doesn't allow navigating to negative frames, this may not be true for other users that may work on the same file (in a team environment). Also, negative frame values can get set via the dopesheet. --- source/blender/blenkernel/intern/gpencil.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/gpencil.c') diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 17d87394118..ba4077ed70a 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -133,7 +133,7 @@ bGPDframe *gpencil_frame_addnew(bGPDlayer *gpl, int cframe) short state = 0; /* error checking (neg frame only if they are not allowed in Blender!) */ - if ((gpl == NULL) || ((U.flag & USER_NONEGFRAMES) && (cframe <= 0))) + if (gpl == NULL) return NULL; /* allocate memory for this frame */ @@ -388,8 +388,6 @@ bGPDframe *gpencil_layer_getframe(bGPDlayer *gpl, int cframe, short addnew) /* error checking */ if (gpl == NULL) return NULL; - /* 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) { -- cgit v1.2.3