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
This commit is contained in:
Dalai Felinto 2019-11-18 18:01:54 -03:00
parent 08588d06e8
commit 12915aad65
Notes: blender-bot 2023-02-14 06:27:47 +01:00
Referenced by issue #69798, Pinning the 'object data properties' doesn't work in the properties editor with empty image objects
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}