Fix #34366: mesh.select_mode operator could not be configure the use_extend
and use_expand properly. These are hardcoded to shift and ctrl to make them work when clicking buttons or menus. Now it checks if the properties are set, which is still not ideal but makes it possible to override them from the key configuration.
This commit is contained in:
@@ -923,9 +923,13 @@ static int edbm_select_mode_exec(bContext *C, wmOperator *op)
|
||||
|
||||
static int edbm_select_mode_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
// RNA_enum_set(op->ptr, "type"); /* type must be set already */
|
||||
RNA_boolean_set(op->ptr, "use_extend", event->shift);
|
||||
RNA_boolean_set(op->ptr, "use_expand", event->ctrl);
|
||||
/* detecting these options based on shift/ctrl here is weak, but it's done
|
||||
* to make this work when clicking buttons or menus */
|
||||
if (!RNA_struct_property_is_set(op->ptr, "use_extend"))
|
||||
RNA_boolean_set(op->ptr, "use_extend", event->shift);
|
||||
if (!RNA_struct_property_is_set(op->ptr, "use_expand"))
|
||||
RNA_boolean_set(op->ptr, "use_expand", event->ctrl);
|
||||
|
||||
return edbm_select_mode_exec(C, op);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user