diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index c9dd07208c1..a288551aa08 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1320,6 +1320,22 @@ void WM_operator_properties_select_action_simple(wmOperatorType *ot, int default wm_operator_properties_select_action_ex(ot, default_action, select_actions); } +/** + * Use for all select random operators. + * Adds properties: percent, seed, action. + */ +void WM_operator_properties_select_random(wmOperatorType *ot) +{ + 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_int( + ot->srna, "seed", 0, 0, INT_MAX, + "Random Seed", "Seed for the random number generator", 0, 255); + + WM_operator_properties_select_action_simple(ot, SEL_SELECT); +} + void WM_operator_properties_select_all(wmOperatorType *ot) { WM_operator_properties_select_action(ot, SEL_TOGGLE); |