[Bf-blender-cvs] [fb86d091950] master: GPencil: Improve soft eraser for last stroke points
Antonioya
noreply at git.blender.org
Fri Mar 29 15:39:50 CET 2019
Commit: fb86d0919504b00db2b7f28cf39472d1abca6a90
Author: Antonioya
Date: Fri Mar 29 15:39:29 2019 +0100
Branches: master
https://developer.blender.org/rBfb86d0919504b00db2b7f28cf39472d1abca6a90
GPencil: Improve soft eraser for last stroke points
Now, the last point is managed separately in order to get smoother transition.
===================================================================
M source/blender/editors/gpencil/gpencil_paint.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index eece759035f..d9a58ddc5a6 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1404,6 +1404,19 @@ static void gp_stroke_soft_refine(bGPDstroke *gps, const float cull_thresh)
}
}
+ /* last point special case to get smoother transition */
+ pt = &gps->points[gps->totpoints - 1];
+ pt_before = &gps->points[gps->totpoints - 2];
+ if (pt->flag & GP_SPOINT_TAG) {
+ pt->flag &= ~GP_SPOINT_TAG;
+ pt->flag &= ~GP_SPOINT_TEMP_TAG;
+ pt->strength = 0.0f;
+
+ pt_before->flag &= ~GP_SPOINT_TAG;
+ pt_before->flag &= ~GP_SPOINT_TEMP_TAG;
+ pt_before->strength *= 0.5f;
+ }
+
/* now untag temp tagged */
pt = gps->points;
for (i = 1; i < gps->totpoints - 1; i++, pt++) {
More information about the Bf-blender-cvs
mailing list