[Bf-blender-cvs] [0f8af3a5ce7] greasepencil-object: Rename "lazy Mouse" to "Stabilizer"

Antonio Vazquez noreply at git.blender.org
Tue Jan 30 17:33:34 CET 2018


Commit: 0f8af3a5ce7bed9254c45bbfa0ce31f1e4ff010e
Author: Antonio Vazquez
Date:   Tue Jan 30 17:15:38 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB0f8af3a5ce7bed9254c45bbfa0ce31f1e4ff010e

Rename "lazy Mouse" to "Stabilizer"

Also changed "Radius" to "Distance"

Thanks Pablo Vazquez for the feedback.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index bb783facee0..d78423fac6c 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -466,10 +466,10 @@ class GreasePencilBrushOptionsPanel:
             if brush.fill_only is False:
                 row.separator()
                 row = layout.row(align=True)
-                row.prop(brush, "use_lazy_mouse", text="Lazy Mouse")
-                if brush.use_lazy_mouse:
+                row.prop(brush, "use_stabilizer", text="Stabilizer")
+                if brush.use_stabilizer:
                     row = layout.row(align=True)
-                    row.prop(brush, "lazy_radius")
+                    row.prop(brush, "lazy_radius", text="Distance")
                     row = layout.row(align=True)
                     row.prop(brush, "lazy_factor", slider=True)
 
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index fd394ae1051..b72e9f09404 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -302,7 +302,7 @@ static bool gp_stroke_filtermval(tGPsdata *p, const int mval[2], int pmval[2])
 	bGPDbrush *brush = p->brush;
 	int dx = abs(mval[0] - pmval[0]);
 	int dy = abs(mval[1] - pmval[1]);
-	brush->flag &= ~GP_BRUSH_LAZY_MOUSE_TEMP;
+	brush->flag &= ~GP_BRUSH_STABILIZE_MOUSE_TEMP;
 
 	/* if buffer is empty, just let this go through (i.e. so that dots will work) */
 	if (p->gpd->sbuffer_size == 0) {
@@ -310,7 +310,7 @@ static bool gp_stroke_filtermval(tGPsdata *p, const int mval[2], int pmval[2])
 	}
 	/* if lazy mouse, check minimum distance */
 	else if (GPENCIL_LAZY_MODE(brush, p->shift)) {
-		brush->flag |= GP_BRUSH_LAZY_MOUSE_TEMP;
+		brush->flag |= GP_BRUSH_STABILIZE_MOUSE_TEMP;
 		if ((dx * dx + dy * dy) > (brush->lazy_radius * brush->lazy_radius)) {
 			return true;
 		}
@@ -1360,7 +1360,7 @@ static void gp_session_validatebuffer(tGPsdata *p)
 
 	/* reset lazy */
 	if (brush) {
-		brush->flag &= ~GP_BRUSH_LAZY_MOUSE_TEMP;
+		brush->flag &= ~GP_BRUSH_STABILIZE_MOUSE_TEMP;
 	}
 }
 
@@ -2229,7 +2229,7 @@ static void gpencil_draw_apply(bContext *C, wmOperator *op, tGPsdata *p, const D
 		pt = (tGPspoint *)gpd->sbuffer + gpd->sbuffer_size - 1;
 		ED_gpencil_toggle_brush_cursor(C, true, &pt->x);
 	}
-	else if ((p->brush->flag & GP_BRUSH_LAZY_MOUSE_TEMP) && (gpd->sbuffer_size > 0)){
+	else if ((p->brush->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) && (gpd->sbuffer_size > 0)){
 		pt = (tGPspoint *)gpd->sbuffer + gpd->sbuffer_size - 1;
 		ED_gpencil_toggle_brush_cursor(C, true, &pt->x);
 	}
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 4d3701238f7..2a77f61f1e2 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1271,8 +1271,8 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *customdata)
 		paintbrush = BKE_gpencil_brush_getactive(scene->toolsettings);
 		/* while drawing hide */
 		if ((gpd->sbuffer_size > 0) && 
-			(paintbrush) && ((paintbrush->flag & GP_BRUSH_LAZY_MOUSE) == 0) &&
-			((paintbrush->flag & GP_BRUSH_LAZY_MOUSE_TEMP) == 0))
+			(paintbrush) && ((paintbrush->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) &&
+			((paintbrush->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) == 0))
 		{
 			return;
 		}
@@ -1286,8 +1286,8 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *customdata)
 			 * The decision was to use a fix size, instead of paintbrush->thickness value. 
 			 */
 			if ((palcolor) && (GPENCIL_PAINT_MODE(gpd)) && 
-				((paintbrush->flag & GP_BRUSH_LAZY_MOUSE) == 0) &&
-				((paintbrush->flag & GP_BRUSH_LAZY_MOUSE_TEMP) == 0) &&
+				((paintbrush->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) &&
+				((paintbrush->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) == 0) &&
 				((paintbrush->flag & GP_BRUSH_FILL_ONLY) == 0))
 			{
 				radius = 2.0f;
@@ -1328,8 +1328,8 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *customdata)
 	/* Inner Ring: Color from UI panel */
 	immUniformColor4f(color[0], color[1], color[2], 0.8f);
 	if ((palcolor) && (GPENCIL_PAINT_MODE(gpd)) && 
-		((paintbrush->flag & GP_BRUSH_LAZY_MOUSE) == 0) &&
-		((paintbrush->flag & GP_BRUSH_LAZY_MOUSE_TEMP) == 0) &&
+		((paintbrush->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) &&
+		((paintbrush->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) == 0) &&
 		((paintbrush->flag & GP_BRUSH_FILL_ONLY) == 0))
 	{
 		imm_draw_circle_fill_2d(pos, x, y, radius, 40);
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 8b729d5d428..228db28855d 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -160,9 +160,9 @@ typedef enum eGPDbrush_Flag {
 	/* show fill help lines */
 	GP_BRUSH_FILL_SHOW_HELPLINES = (1 << 10),
 	/* lazy mouse */
-	GP_BRUSH_LAZY_MOUSE = (1 << 11),
+	GP_BRUSH_STABILIZE_MOUSE = (1 << 11),
 	/* lazy mouse override (internal only) */
-	GP_BRUSH_LAZY_MOUSE_TEMP = (1 << 12),
+	GP_BRUSH_STABILIZE_MOUSE_TEMP = (1 << 12),
 } eGPDbrush_Flag;
 
 /* ***************************************** */
@@ -568,6 +568,6 @@ typedef enum eGP_BrushIcons {
 #define GPENCIL_PAINT_MODE(gpd) ((gpd) && (gpd->flag & (GP_DATA_STROKE_PAINTMODE))) 
 #define GPENCIL_SCULPT_OR_WEIGHT_MODE(gpd) ((gpd) && (gpd->flag & (GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE))) 
 #define GPENCIL_NONE_EDIT_MODE(gpd) ((gpd) && ((gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)) == 0))
-#define GPENCIL_LAZY_MODE(brush, shift) ((brush) && ((brush->flag & GP_BRUSH_LAZY_MOUSE) && (shift == 0)) || (((brush->flag & GP_BRUSH_LAZY_MOUSE) == 0) && (shift == 1))) 
+#define GPENCIL_LAZY_MODE(brush, shift) ((brush) && ((brush->flag & GP_BRUSH_STABILIZE_MOUSE) && (shift == 0)) || (((brush->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && (shift == 1))) 
 
 #endif /*  __DNA_GPENCIL_TYPES_H__ */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index db23b1a9692..268f0dc0690 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2331,7 +2331,7 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "lazy_radius", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "lazy_radius");
 	RNA_def_property_range(prop, 1, 200);
-	RNA_def_property_ui_text(prop, "Radius", "Minimum distance from last point before stroke continues");
+	RNA_def_property_ui_text(prop, "Distance", "Minimum distance from last point before stroke continues");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
 	prop = RNA_def_property(srna, "lazy_factor", PROP_FLOAT, PROP_FACTOR);
@@ -2371,10 +2371,10 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Random Strength", "Use random value for strength");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
-	prop = RNA_def_property(srna, "use_lazy_mouse", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_LAZY_MOUSE);
+	prop = RNA_def_property(srna, "use_stabilizer", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_STABILIZE_MOUSE);
 	RNA_def_property_boolean_default(prop, true);
-	RNA_def_property_ui_text(prop, "Lazy Mouse", "Draw lines with a delay to allow smooth strokes");
+	RNA_def_property_ui_text(prop, "Stabilizer", "Draw lines with a delay to allow smooth strokes");
 
 	/* Cursor Color */
 	static float default_1[3] = { 1.0f, 1.0f, 1.0f };



More information about the Bf-blender-cvs mailing list