From 792badcfefcb92aadc16346f0dc11299a8da0ced Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 23 Nov 2021 18:32:23 +0100 Subject: Fix broken handling of constraints reordering with library overrides Alternative to D13291 (description partially copied from there). New drag & drop reordering code would call constraints reordering operator with the generic context, and not the one from the panel's layout. missing the "constraint" member which is mandatory for poll function to properly deal with override vs. local constraints. For this to work in a decent way, there needs to be some panel-wide context that we can restore when executing callbacks outside of the normal draw context. So similar to uiLayoutSetContextPointer() to set context on a layout level, this introduces UI_panel_context_pointer_set() for panel level context (this calls the former for the current panel root layout as well). Differential Revision: https://developer.blender.org/D13308 --- source/blender/editors/include/UI_interface.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 065b0a2d057..1ed10f37de3 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1766,6 +1766,8 @@ void UI_panel_header_buttons_begin(struct Panel *panel); void UI_panel_header_buttons_end(struct Panel *panel); void UI_panel_end(struct Panel *panel, int width, int height); +void UI_panel_context_pointer_set(struct Panel *panel, const char *name, struct PointerRNA *ptr); + bool UI_panel_is_closed(const struct Panel *panel); bool UI_panel_is_active(const struct Panel *panel); void UI_panel_label_offset(const struct uiBlock *block, int *r_x, int *r_y); -- cgit v1.2.3