Fix T85947: Missing check of master collection for objects being instanced.

`object_in_any_collection` used during linking/appending to check
whether an object is already instanced by at least one collection, was
not taking into account embedded master collections from scenes.
This commit is contained in:
Bastien Montagne
2021-02-24 14:14:46 +01:00
parent 0c0553ace7
commit 8f6fd07b54

View File

@@ -4600,6 +4600,13 @@ static bool object_in_any_collection(Main *bmain, Object *ob)
}
}
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
if (scene->master_collection != NULL &&
BKE_collection_has_object(scene->master_collection, ob)) {
return true;
}
}
return false;
}