From ae1dc8f5f98d045b11312401d6f93d0eae15ddc5 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 9 Jul 2021 21:46:55 +0200 Subject: UI: Internal support for custom UI list item drag & activate operators For pose libraries, we need to be able to apply a pose whenever activating (clicking) an item in the Pose Library asset view and blend it by dragging (press & move). And since we want to allow Python scripts to define what happens at least when activating an asset (so they can define for example a custom "Apply" operator for preset assets), it makes sense to just let them pass an operator name to the asset view template. The template will be introduced in a following commit. --- source/blender/windowmanager/intern/wm_operators.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 485e65cf3dc..576f15731a0 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -604,6 +604,12 @@ void WM_operator_properties_create(PointerRNA *ptr, const char *opstring) * used for keymaps and macros */ void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring) { + IDProperty *tmp_properties = NULL; + /* Allow passing NULL for properties, just create the properties here then. */ + if (properties == NULL) { + properties = &tmp_properties; + } + if (*properties == NULL) { IDPropertyTemplate val = {0}; *properties = IDP_New(IDP_GROUP, &val, "wmOpItemProp"); -- cgit v1.2.3