[Bf-blender-cvs] [70297337e01] greasepencil-object: GP: Enable curve only for Arcs and Beziers

Antonioya noreply at git.blender.org
Fri Dec 7 13:26:05 CET 2018


Commit: 70297337e01e85b06ce8d13de7c680f1ae0200bc
Author: Antonioya
Date:   Fri Dec 7 13:25:56 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB70297337e01e85b06ce8d13de7c680f1ae0200bc

GP: Enable curve only for Arcs and Beziers

===================================================================

M	release/scripts/startup/bl_ui/space_topbar.py
M	source/blender/editors/gpencil/gpencil_primitive.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 6d2e3aefb33..610a41dd195 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -375,7 +375,7 @@ class _draw_left_context_mode:
 
                 draw_color_selector()
 
-                if tool.name == "Bezier":
+                if tool.name in {"Line", "Arc", "Bezier"}:
                     settings = context.tool_settings.gpencil_sculpt
                     row = layout.row(align=True)
                     row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA')
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 756ea06733c..5a07e37c86f 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -515,12 +515,14 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
 
 		/* calc pressure */
 		float pressure = 1.0;
-		if ((gset->flag & GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE) && (gps->totpoints > 1)) {
-			/* normalize value to evaluate curve */
-			float value = (float)i / (gps->totpoints - 1);
-			float curvef = curvemapping_evaluateF(gset->cur_primitive, 0, value);
-			pressure = 1.0f * curvef;
-			CLAMP_MIN(pressure, 0.1f);
+		if (ELEM(tgpi->type, GP_STROKE_LINE, GP_STROKE_ARC, GP_STROKE_BEZIER)) {
+			if ((gset->flag & GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE) && (gps->totpoints > 1)) {
+				/* normalize value to evaluate curve */
+				float value = (float)i / (gps->totpoints - 1);
+				float curvef = curvemapping_evaluateF(gset->cur_primitive, 0, value);
+				pressure = 1.0f * curvef;
+				CLAMP_MIN(pressure, 0.1f);
+			}
 		}
 
 		tpt->pressure = pressure;



More information about the Bf-blender-cvs mailing list