[Bf-blender-cvs] [351f87fc84a] greasepencil-object: GPencil: Increase Input Samples and reduce distance
Antonio Vazquez
noreply at git.blender.org
Sat Aug 17 19:01:18 CEST 2019
Commit: 351f87fc84a2394b4862144a024e3d1eb903e551
Author: Antonio Vazquez
Date: Sat Aug 17 19:00:12 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB351f87fc84a2394b4862144a024e3d1eb903e551
GPencil: Increase Input Samples and reduce distance
This commit is to test new brushes.
===================================================================
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/makesdna/DNA_gpencil_types.h
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index ce4b89f0d2e..3984a256c10 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -3371,6 +3371,11 @@ static void gpencil_add_missing_events(bContext *C,
}
float factor = ((thickness * dot_factor) / scale) * samples;
+ /* If samples are more than 33%, divide the factor. */
+ if (input_samples > (GP_MAX_INPUT_SAMPLES / 3)) {
+ factor *= 0.5f;
+ }
+
copy_v2_v2(a, p->mvalo);
b[0] = (float)event->mval[0] + 1.0f;
b[1] = (float)event->mval[1] + 1.0f;
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 3edd529eb68..64a5b6e7091 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -36,7 +36,7 @@ struct MDeformVert;
#define GP_DEFAULT_PIX_FACTOR 1.0f
#define GP_DEFAULT_GRID_LINES 4
-#define GP_MAX_INPUT_SAMPLES 50
+#define GP_MAX_INPUT_SAMPLES 100
/* ***************************************** */
/* GP Stroke Points */
More information about the Bf-blender-cvs
mailing list