[Bf-blender-cvs] [632f2b5c183] master: WM: include macros in last-properties

Campbell Barton noreply at git.blender.org
Sun May 6 08:58:34 CEST 2018


Commit: 632f2b5c18310760f61f7a998ff972cde0ac49d6
Author: Campbell Barton
Date:   Sun May 6 08:54:58 2018 +0200
Branches: master
https://developer.blender.org/rB632f2b5c18310760f61f7a998ff972cde0ac49d6

WM: include macros in last-properties

Needed for 2.8 tool system storage of macro properties.

===================================================================

M	source/blender/windowmanager/intern/wm_event_system.c

===================================================================

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



More information about the Bf-blender-cvs mailing list