[Bf-blender-cvs] [634b10acbb6] master: Fix missing type check for Outliner eyedropper query

Julian Eisel noreply at git.blender.org
Mon Dec 7 14:36:05 CET 2020


Commit: 634b10acbb6962f9901f0ad610d12b24f7d76c06
Author: Julian Eisel
Date:   Mon Dec 7 14:14:31 2020 +0100
Branches: master
https://developer.blender.org/rB634b10acbb6962f9901f0ad610d12b24f7d76c06

Fix missing type check for Outliner eyedropper query

Mistake in 35a5dee2ef73.

Code would simply assume that the element under the cursor is an Object if it
was an ID (but not a collection).

This wouldn't cause any issues in current code, since the only other ID that
set the direct-data were collections, which are special in that they don't have
a `TreeStoreElem.type` of 0, which is already being checked for here. And if
there was no direct-data set, the object lookup in the View-Layer would
correctly fail too.

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

M	source/blender/editors/space_outliner/outliner_utils.c

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

diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c
index fe4cc29b738..e0d63dfcf81 100644
--- a/source/blender/editors/space_outliner/outliner_utils.c
+++ b/source/blender/editors/space_outliner/outliner_utils.c
@@ -510,7 +510,7 @@ Base *ED_outliner_give_base_under_cursor(bContext *C, const int mval[2])
   te = outliner_find_item_at_y(space_outliner, &space_outliner->tree, view_mval[1]);
   if (te) {
     TreeStoreElem *tselem = TREESTORE(te);
-    if (tselem->type == 0) {
+    if ((tselem->type == 0) && (te->idcode == ID_OB)) {
       Object *ob = (Object *)tselem->id;
       base = (te->directdata) ? (Base *)te->directdata : BKE_view_layer_base_find(view_layer, ob);
     }



More information about the Bf-blender-cvs mailing list