Fix T101433: crash when deleting hierarchy referenced by Collection Info node

The issue was that geometry nodes was not reevaluated after changing the
content of the collection. That resulted in the other object still having a
reference to the deleted object, which resulted in a crash when it tried to
access it.

Adding the `ID_RECALC_GEOMETRY` tag indicates that the content of the
collection has changed and will trigger geometry nodes setups that depend
on the collection to update.
This commit is contained in:
Jacques Lucke 2022-11-28 12:51:10 +01:00
parent 143e74c0b8
commit 99c5146e9a
Notes: blender-bot 2023-02-21 17:59:30 +01:00
Referenced by issue #101433, Delete Hierarchy operator crashes on an object whose collection is referenced by a Collection Info node with Separate Children enabled
1 changed files with 2 additions and 1 deletions

View File

@ -1122,7 +1122,8 @@ static bool collection_object_remove(Main *bmain,
id_us_min(&ob->id);
}
collection_tag_update_parent_recursive(bmain, collection, ID_RECALC_COPY_ON_WRITE);
collection_tag_update_parent_recursive(
bmain, collection, ID_RECALC_COPY_ON_WRITE | ID_RECALC_GEOMETRY);
return true;
}