Fix #122451: Crash on animated viewport visibility + animated mesh positions

Move the bounding box synchronization to the geometry evaluation component.
This way it is ensured that it is only done when the geometry is actually
evaluated, solving the problem of accessing stale data when object level
flags are modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/122509
This commit is contained in:
Sergey Sharybin
2024-05-31 11:51:36 +02:00
committed by Sergey Sharybin
parent 6359464507
commit 1a9db9992a

View File

@@ -228,6 +228,11 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o
}
}
}
if (DEG_is_active(depsgraph)) {
Object *object_orig = DEG_get_original_object(ob);
object_orig->runtime->bounds_eval = BKE_object_evaluated_geometry_bounds(ob);
}
}
void BKE_object_sync_to_original(Depsgraph *depsgraph, Object *object)
@@ -257,8 +262,6 @@ void BKE_object_sync_to_original(Depsgraph *depsgraph, Object *object)
md_orig->error = BLI_strdup(md->error);
}
}
object_orig->runtime->bounds_eval = BKE_object_evaluated_geometry_bounds(object);
}
void BKE_object_eval_uber_transform(Depsgraph * /*depsgraph*/, Object * /*object*/) {}