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:
authorJoshua Leung <aligorith@gmail.com>2016-05-08 18:03:40 +0300
committerJoshua Leung <aligorith@gmail.com>2016-05-08 18:03:40 +0300
commite2b79a0a246bc8a4a9a1fd14e97db4cdc8c80cf7 (patch)
tree52c6d608b6725b062153bf717bb25e528a8421c0 /source/blender/editors/gpencil
parentd6fd6d18d763166ee84d5512522f15c81cc79363 (diff)
GPencil Onion Skinning: Setting before/after to -1 will turn off onionskinning in that direction
This is an experimental option that I found would have been useful to have, when making my earlier anim test. The only contentious point is whether it's better to use a separate boolean flag (perhaps bound to the labels) instead of overloading this setting (and describing the usage in the tooltip).
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c14
1 files changed, 10 insertions, 4 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);