Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_select.c
| Show First 20 Lines • Show All 1,447 Lines • ▼ Show 20 Lines | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Select Random | /** \name Select Random | ||||
| * \{ */ | * \{ */ | ||||
| static int object_select_random_exec(bContext *C, wmOperator *op) | static int object_select_random_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| const float randfac = RNA_float_get(op->ptr, "percent") / 100.0f; | const float randfac = RNA_float_get(op->ptr, "ratio"); | ||||
| const int seed = WM_operator_properties_select_random_seed_increment_get(op); | const int seed = WM_operator_properties_select_random_seed_increment_get(op); | ||||
| const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); | const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); | ||||
| RNG *rng = BLI_rng_new_srandom(seed); | RNG *rng = BLI_rng_new_srandom(seed); | ||||
| CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { | CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { | ||||
| if (BLI_rng_get_float(rng) < randfac) { | if (BLI_rng_get_float(rng) < randfac) { | ||||
| ED_object_base_select(base, select); | ED_object_base_select(base, select); | ||||
| Show All 35 Lines | |||||