GPencil: Remove Keep parameter from Select Vertex Color

Also changed range of threshold from 0 to 10
This commit is contained in:
Antonio Vazquez 2020-03-15 19:22:33 +01:00
parent 8022fc3220
commit 22925d0dd3
Notes: blender-bot 2023-02-14 08:24:03 +01:00
Referenced by issue #74790, Artifacts in solid view
1 changed files with 4 additions and 19 deletions

View File

@ -1661,7 +1661,7 @@ static void gpencil_selected_hue_table(bContext *C,
const int threshold,
GHash *hue_table)
{
const float range = pow(10, 7 - threshold);
const float range = pow(10, 10 - threshold);
float hsv[3];
/* Extract all colors. */
@ -1727,10 +1727,9 @@ static int gpencil_select_vertex_color_exec(bContext *C, wmOperator *op)
Object *ob = CTX_data_active_object(C);
const float threshold = RNA_int_get(op->ptr, "threshold");
const bool keep = RNA_boolean_get(op->ptr, "keep");
const int selectmode = gpencil_select_mode_from_vertex(ts->gpencil_selectmode_vertex);
bGPdata *gpd = (bGPdata *)ob->data;
const float range = pow(10, 7 - threshold);
const float range = pow(10, 10 - threshold);
bool done = false;
@ -1749,18 +1748,8 @@ static int gpencil_select_vertex_color_exec(bContext *C, wmOperator *op)
bGPDspoint *pt;
int i;
bool gps_selected = false;
/* If clear unselect stroke. */
if (!keep) {
gps->flag &= ~GP_STROKE_SELECT;
}
/* Check all stroke points. */
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
/* Clear any previous point selected. */
if (!keep) {
pt->flag &= ~GP_SPOINT_SELECT;
}
if (pt->vert_color[3] == 0.0f) {
continue;
}
@ -1834,17 +1823,13 @@ void GPENCIL_OT_select_vertex_color(wmOperatorType *ot)
"threshold",
0,
0,
6,
10,
"Threshold",
"Tolerance of the selection. Higher values select a wider range of similar colors",
0,
6);
10);
/* avoid re-using last var */
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(
ot->srna, "keep", true, "Keep Previous Selection", "Keep any previous selection");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/** \} */