Don't tag object data's bounding box as dirty before re-evaluaiton

Most of the time this actually tags evaluated mesh which will be tossed
away few lines below anyway. And this causes issues if the evaluated
mesh is actually owned by the mesh datablock.

The bounding box now has clear separation between original object data
and object data after modifiers, so this should not be causing any
issues.
This commit is contained in:
2019-06-06 12:24:40 +02:00
parent f24a7fa31d
commit 2a5fcfaad0

View File

@@ -429,27 +429,6 @@ static void object_update_from_subsurf_ccg(Object *object)
/* free data derived from mesh, called when mesh changes or is freed */
void BKE_object_free_derived_caches(Object *ob)
{
/* Also serves as signal to remake texspace.
*
* NOTE: This function can be called from threads on different objects
* sharing same data datablock. So we need to ensure atomic nature of
* data modification here.
*/
if (ob->type == OB_MESH) {
Mesh *me = ob->data;
if (me && me->bb) {
atomic_fetch_and_or_int32(&me->bb->flag, BOUNDBOX_DIRTY);
}
}
else if (ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
Curve *cu = ob->data;
if (cu && cu->bb) {
atomic_fetch_and_or_int32(&cu->bb->flag, BOUNDBOX_DIRTY);
}
}
MEM_SAFE_FREE(ob->runtime.bb);
object_update_from_subsurf_ccg(ob);