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:
parent
0ba0d27d36
commit
80536e8bae
Notes:
blender-bot
2023-02-14 10:43:47 +01:00
Referenced by issue #87615, Snapping to objects instanced by Geometry nodes
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue