Fix T87615: No snapping to objects instanced by Geometry nodes
The code of the snapping system to interact the objects in the scene only considers instances what comes from "DUPLI" objects. This commit adds instances coming from Geometry nodes. Differential Revision: https://developer.blender.org/D11020
This commit is contained in:
@@ -415,10 +415,12 @@ static void iter_snap_objects(SnapObjectContext *sctx,
|
||||
}
|
||||
|
||||
Object *obj_eval = DEG_get_evaluated_object(depsgraph, base->object);
|
||||
if (obj_eval->transflag & OB_DUPLI) {
|
||||
DupliObject *dupli_ob;
|
||||
if (obj_eval->transflag & OB_DUPLI ||
|
||||
(obj_eval->runtime.geometry_set_eval != NULL &&
|
||||
BKE_geometry_set_has_instances(obj_eval->runtime.geometry_set_eval))) {
|
||||
ListBase *lb = object_duplilist(depsgraph, sctx->scene, obj_eval);
|
||||
for (dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next) {
|
||||
for (DupliObject *dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next) {
|
||||
BLI_assert(DEG_is_evaluated_object(dupli_ob->ob));
|
||||
sob_callback(sctx,
|
||||
dupli_ob->ob,
|
||||
dupli_ob->mat,
|
||||
|
||||
Reference in New Issue
Block a user