[Bf-blender-cvs] [12915aad65f] master: Fix T69798: Pinning empty image objects

Dalai Felinto noreply at git.blender.org
Tue Nov 19 14:28:22 CET 2019


Commit: 12915aad65fbce5f4533abb1f9f510e88333a439
Author: Dalai Felinto
Date:   Mon Nov 18 18:01:54 2019 -0300
Branches: master
https://developer.blender.org/rB12915aad65fbce5f4533abb1f9f510e88333a439

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

===================================================================

M	source/blender/editors/space_buttons/buttons_context.c

===================================================================

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



More information about the Bf-blender-cvs mailing list