Fix T44697: Multi-value edit /w layers fails

Not such a nice solution, but good to have this working.
This commit is contained in:
2015-05-26 15:16:30 +10:00
parent 8715fd0925
commit abf7378e44

View File

@@ -162,6 +162,11 @@ typedef enum uiHandleButtonState {
#ifdef USE_ALLSELECT
/* Unfortunately theres no good way handle more generally:
* (propagate single clicks on layer buttons to other objects) */
#define USE_ALLSELECT_LAYER_HACK
typedef struct uiSelectContextElem {
PointerRNA ptr;
union {
@@ -1488,6 +1493,39 @@ static void ui_selectcontext_apply(
}
}
#ifdef USE_ALLSELECT_LAYER_HACK
/* make up for not having 'handle_layer_buttons' */
{
PropertySubType subtype = RNA_property_subtype(prop);
if ((rna_type == PROP_BOOLEAN) &&
ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER) &&
is_array &&
/* could check for 'handle_layer_buttons' */
but->func)
{
wmWindow *win = CTX_wm_window(C);
if (!win->eventstate->shift) {
const int len = RNA_property_array_length(&but->rnapoin, prop);
int *tmparray = MEM_callocN(sizeof(int) * len, __func__);
tmparray[index] = true;
for (i = 0; i < selctx_data->elems_len; i++) {
uiSelectContextElem *other = &selctx_data->elems[i];
PointerRNA lptr = other->ptr;
RNA_property_boolean_set_array(&lptr, lprop, tmparray);
RNA_property_update(C, &lptr, lprop);
}
MEM_freeN(tmparray);
return;
}
}
}
#endif
for (i = 0; i < selctx_data->elems_len; i++) {
uiSelectContextElem *other = &selctx_data->elems[i];
PointerRNA lptr = other->ptr;