diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-05-26 08:16:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-05-26 08:20:46 +0300 |
commit | abf7378e4445ba10828e369edf399ba4c29995c1 (patch) | |
tree | 56e57df389273033fd872d12f241157569398155 /source | |
parent | 8715fd092514547460e58d4f8a39b2fb6704e810 (diff) |
Fix T44697: Multi-value edit /w layers fails
Not such a nice solution, but good to have this working.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index feb9b4047fd..f90c3af2195 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -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; |