From 80bd73639f57203b0383d9b313b4bd640f24f2ca Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 9 Dec 2009 21:42:21 +0000 Subject: =?UTF-8?q?Patch=20[#20290]=20by=20Bj=C3=B8rnar=20Hansen=20for=20b?= =?UTF-8?q?ug=20[#20270]=202.5a0,=20Select=20Random=20says=20percent=20but?= =?UTF-8?q?=20is=20really=200-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/blender/editors/mesh/editmesh_mods.c | 6 +++--- source/blender/editors/object/object_select.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index e7986d227cf..30dc6114097 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -3629,7 +3629,7 @@ static int mesh_select_random_exec(bContext *C, wmOperator *op) if(!RNA_boolean_get(op->ptr, "extend")) EM_deselect_all(em); - selectrandom_mesh(em, RNA_float_get(op->ptr, "percentage")/100.0f); + selectrandom_mesh(em, RNA_float_get(op->ptr, "percent")/100.0f); WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); @@ -3652,8 +3652,8 @@ void MESH_OT_select_random(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_float_percentage(ot->srna, "percentage", 50.f, 0.0f, 100.0f, "Percentage", "Percentage of elements to select randomly.", 0.f, 100.0f); - RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); + RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly.", 0.f, 100.0f); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first."); } void EM_select_by_material(EditMesh *em, int index) diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 5366446c8ae..a0223997cfb 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -996,11 +996,11 @@ static int object_select_random_exec(bContext *C, wmOperator *op) } CTX_DATA_END; } - percent = RNA_float_get(op->ptr, "percent"); + percent = RNA_float_get(op->ptr, "percent")/100.0f; CTX_DATA_BEGIN(C, Base*, base, visible_bases) { if (BLI_frand() < percent) { - ED_base_object_select(base, BA_SELECT); + ED_base_object_select(base, BA_SELECT); } } CTX_DATA_END; @@ -1013,7 +1013,7 @@ static int object_select_random_exec(bContext *C, wmOperator *op) void OBJECT_OT_select_random(wmOperatorType *ot) { /* identifiers */ - ot->name= "Random select"; + ot->name= "Select Random"; ot->description = "Set select on random visible objects."; ot->idname= "OBJECT_OT_select_random"; @@ -1026,8 +1026,8 @@ void OBJECT_OT_select_random(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); - RNA_def_float_percentage(ot->srna, "percent", 0.5f, 0.0f, 1.0f, "Percent", "percentage of objects to randomly select", 0.0001f, 1.0f); + RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of objects to select randomly", 0.f, 100.0f); + RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first."); } -- cgit v1.2.3