From 12915aad65fbce5f4533abb1f9f510e88333a439 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 18 Nov 2019 18:01:54 -0300 Subject: Fix T69798: Pinning empty image objects We have no dedicated image context tab, so for now making sure we don't end up passing its ID as the pinned one. If we ever get one, we then will need a different solution here, like changing the ID that owns the data to be the object, instead of the empty image datablock. Differential Revision: https://developer.blender.org/D6273 --- source/blender/editors/space_buttons/buttons_context.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index a6584966643..8cb0a3f3c86 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1249,6 +1249,13 @@ ID *buttons_context_id_path(const bContext *C) } } + /* There is no valid image ID panel, Image Empty objects need this workaround.*/ + if (sbuts->mainb == BCONTEXT_DATA && sbuts->flag & SB_PIN_CONTEXT) { + if (ptr->type == &RNA_Image && ptr->data) { + continue; + } + } + if (ptr->owner_id) { return ptr->owner_id; } -- cgit v1.2.3