diff options
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 14 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 8 |
2 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 6ccbd2777b4..7715169cafb 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -1067,7 +1067,7 @@ static void gp_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int of copy_v3_v3(color, gpl->color); } - if (gpl->gstep) { + if (gpl->gstep > 0) { bGPDframe *gf; float fac; @@ -1084,13 +1084,16 @@ static void gp_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int of break; } } - else { + else if (gpl->gstep == 0) { /* draw the strokes for the ghost frames (at half of the alpha set by user) */ if (gpf->prev) { color[3] = (alpha / 7); gp_draw_strokes(gpf->prev, offsx, offsy, winx, winy, dflag, debug, lthick, color, color); } } + else { + /* don't draw - disabled */ + } /* 2) Now draw next frames */ @@ -1101,7 +1104,7 @@ static void gp_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int of copy_v3_v3(color, gpl->color); } - if (gpl->gstep_next) { + if (gpl->gstep_next > 0) { bGPDframe *gf; float fac; @@ -1118,13 +1121,16 @@ static void gp_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int of break; } } - else { + else if (gpl->gstep_next == 0) { /* draw the strokes for the ghost frames (at half of the alpha set by user) */ if (gpf->next) { color[3] = (alpha / 4); gp_draw_strokes(gpf->next, offsx, offsy, winx, winy, dflag, debug, lthick, color, color); } } + else { + /* don't draw - disabled */ + } /* 3) restore alpha */ glColor4fv(gpl->color); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 82d98d4b199..691eae18d4d 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -770,18 +770,18 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) prop = RNA_def_property(srna, "ghost_before_range", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gstep"); - RNA_def_property_range(prop, 0, 120); + RNA_def_property_range(prop, -1, 120); RNA_def_property_ui_text(prop, "Frames Before", "Maximum number of frames to show before current frame " - "(0 = show only the previous sketch)"); + "(0 = show only the previous sketch, -1 = Don't show any frames before current)"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); prop = RNA_def_property(srna, "ghost_after_range", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gstep_next"); - RNA_def_property_range(prop, 0, 120); + RNA_def_property_range(prop, -1, 120); RNA_def_property_ui_text(prop, "Frames After", "Maximum number of frames to show after current frame " - "(0 = show only the next sketch)"); + "(0 = show only the next sketch, -1 = Don't show any frames after current)"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); prop = RNA_def_property(srna, "use_ghost_custom_colors", PROP_BOOLEAN, PROP_NONE); |