diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-06 09:54:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-06 09:57:53 +0300 |
commit | 632f2b5c18310760f61f7a998ff972cde0ac49d6 (patch) | |
tree | d9218fb0773018e9c05842d63e074397cab11f1e /source/blender/windowmanager/intern | |
parent | 9e3bfd92107f3b69e4d1a05ee9cfb9ce00c1ad80 (diff) |
WM: include macros in last-properties
Needed for 2.8 tool system storage of macro properties.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 4f441c293c4..a6c98686f5a 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1078,11 +1078,22 @@ bool WM_operator_last_properties_store(wmOperator *op) if (op->properties) { CLOG_INFO(WM_LOG_OPERATORS, 1, "storing properties for '%s'", op->type->idname); op->type->last_properties = IDP_CopyProperty(op->properties); - return true; } - else { - return false; + + if (op->macro.first != NULL) { + for (wmOperator *opm = op->macro.first; opm; opm = opm->next) { + if (opm->properties) { + if (op->type->last_properties == NULL) { + op->type->last_properties = IDP_New(IDP_GROUP, &(IDPropertyTemplate){0}, "wmOperatorProperties"); + } + IDProperty *idp_macro = IDP_CopyProperty(opm->properties); + STRNCPY(idp_macro->name, opm->idname); + IDP_ReplaceInGroup(op->type->last_properties, idp_macro); + } + } } + + return (op->type->last_properties != NULL); } #else |