[Bf-blender-cvs] [6bdd1ee77bf] greasepencil-object: Cleanup: Rename property to avoid negative names

Antonio Vazquez noreply at git.blender.org
Sun Feb 11 10:50:13 CET 2018


Commit: 6bdd1ee77bfbac869f89593bd536e54d7ebdca69
Author: Antonio Vazquez
Date:   Sun Feb 11 10:49:59 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6bdd1ee77bfbac869f89593bd536e54d7ebdca69

Cleanup: Rename property to avoid negative names

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

M	source/blender/editors/gpencil/gpencil_ops.c
M	source/blender/editors/gpencil/gpencil_paint.c

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

diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index f14df660485..641dde4eee3 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -493,17 +493,17 @@ static void ed_keymap_gpencil_painting_fill(wmKeyConfig *keyconf)
 	kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
 	RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW);
 	RNA_boolean_set(kmi->ptr, "wait_for_input", false);
-	/* disable straight lines with Ctrl because there is a conflict of keymaps */
-	RNA_boolean_set(kmi->ptr, "no_straight", true);
+	/* disable straight lines */
+	RNA_boolean_set(kmi->ptr, "disable_straight", true);
 
 	/* if press alternative key, the brush now it's for drawing lines */
 	kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_ALT, 0);
 	RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW);
 	RNA_boolean_set(kmi->ptr, "wait_for_input", false);
-	/* disable straight lines with Ctrl because there is a conflict of keymaps */
-	RNA_boolean_set(kmi->ptr, "no_straight", true);
+	/* disable straight lines */
+	RNA_boolean_set(kmi->ptr, "disable_straight", true);
 	/* enable special stroke with no fill flag */
-	RNA_boolean_set(kmi->ptr, "no_fill", true);
+	RNA_boolean_set(kmi->ptr, "disable_fill", true);
 }
 
 /* Stroke Painting Keymap - Only when paintmode is enabled */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 2f2b55086cf..529bb7e92e0 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -180,7 +180,7 @@ typedef struct tGPsdata {
 	bGPDbrush *brush;    /* current drawing brush */
 	short straight[2];   /* 1: line horizontal, 2: line vertical, other: not defined, second element position */
 	int lock_axis;       /* lock drawing to one axis */
-	bool no_fill;        /* the stroke is no fill mode */
+	bool disable_fill;   /* the stroke is no fill mode */
 
 	short keymodifier;   /* key used for invoking the operator */
 	short shift;         /* shift modifier flag */
@@ -1431,7 +1431,7 @@ static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p)
 	p->scene = CTX_data_scene(C);
 	p->graph = CTX_data_depsgraph(C);
 	p->win = CTX_wm_window(C);
-	p->no_fill = RNA_boolean_get(op->ptr, "no_fill");
+	p->disable_fill = RNA_boolean_get(op->ptr, "disable_fill");
 	
 	unit_m4(p->imat);
 	unit_m4(p->mat);
@@ -1795,7 +1795,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, cons
 	}
 
 	/* set special fill stroke mode */
-	if (p->no_fill == true) {
+	if (p->disable_fill == true) {
 		p->gpd->sbuffer_sflag |= GP_STROKE_NOFILL;
 		/* replace stroke color with fill color */
 		copy_v4_v4(p->gpd->scolor, p->gpd->sfill);
@@ -2238,7 +2238,7 @@ static void gpencil_draw_apply_event(bContext *C, wmOperator *op, const wmEvent
 	p->shift = event->shift;
 
 	/* verify key status for straight lines */
-	if ((event->ctrl > 0) && (RNA_boolean_get(op->ptr, "no_straight") == false)) {
+	if ((event->ctrl > 0) && (RNA_boolean_get(op->ptr, "disable_straight") == false)) {
 		if (p->straight[0] == 0) {
 			int dx = abs(p->mval[0] - p->mvalo[0]);
 			int dy = abs(p->mval[1] - p->mvalo[1]);
@@ -2964,9 +2964,9 @@ void GPENCIL_OT_draw(wmOperatorType *ot)
 	prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "Wait for first click instead of painting immediately");
 	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 
-	prop = RNA_def_boolean(ot->srna, "no_straight", false, "No Straight lines", "Disable Ctrl key for straight lines");
+	prop = RNA_def_boolean(ot->srna, "disable_straight", false, "No Straight lines", "Disable key for straight lines");
 	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 
-	prop = RNA_def_boolean(ot->srna, "no_fill", false, "No Fill Areas", "Disable fill to use stroke as fill boundary");
+	prop = RNA_def_boolean(ot->srna, "disable_fill", false, "No Fill Areas", "Disable fill to use stroke as fill boundary");
 	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }



More information about the Bf-blender-cvs mailing list