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.
This commit is contained in:
parent
4cd37541b0
commit
582fa5e36e
|
@ -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) {
|
||||
|
|
|
@ -568,7 +568,7 @@ static void rna_def_gpencil_frame(BlenderRNA *brna)
|
|||
prop = RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "framenum");
|
||||
/* XXX note: this cannot occur on the same frame as another sketch */
|
||||
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
|
||||
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
|
||||
RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears");
|
||||
|
||||
/* Flags */
|
||||
|
@ -579,7 +579,9 @@ static void rna_def_gpencil_frame(BlenderRNA *brna)
|
|||
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT);
|
||||
RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the Dope Sheet");
|
||||
|
||||
|
||||
|
||||
/* API */
|
||||
func = RNA_def_function(srna, "clear", "rna_GPencil_frame_clear");
|
||||
RNA_def_function_ui_description(func, "Remove all the grease pencil frame data");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue