Fix missing type check for Outliner eyedropper query
Mistake in 35a5dee2ef
.
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.
This commit is contained in:
parent
95734e32bf
commit
634b10acbb
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue