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/makesdna/DNA_screen_types.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 86fd6b9744a..607b00a833f 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -154,6 +154,9 @@ typedef struct Panel_Runtime { /* Pointer to the panel's block. Useful when changes to panel #uiBlocks * need some context from traversal of the panel "tree". */ struct uiBlock *block; + + /* Non-owning pointer. The context is stored in the block. */ + struct bContextStore *context; } Panel_Runtime; /** The part from uiBlock that needs saved in file. */ -- cgit v1.2.3