Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-11-19 00:01:54 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-11-19 16:26:31 +0300
commit12915aad65fbce5f4533abb1f9f510e88333a439 (patch)
treea2def3f1ae9be87c195b53521ca355ca7a563d8b
parent08588d06e86a096c51ac70da53e74bab67f6a036 (diff)
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
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c7
1 files changed, 7 insertions, 0 deletions
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;
}