Cleanup: Use const variables for object's evaluated mesh
Generally the evaluated mesh should not be changed, since that is the job of the modifier stack. Current code is far from const correct in that regard. This commit uses a const variable for the reult of `BKE_object_get_evaluated_mesh` in some cases. The most common remaining case is retrieving a BVH tree from the mesh.
This commit is contained in:
@@ -3860,7 +3860,7 @@ void BKE_object_boundbox_flag(Object *ob, int flag, const bool set)
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_object_boundbox_calc_from_mesh(struct Object *ob, struct Mesh *me_eval)
|
||||
void BKE_object_boundbox_calc_from_mesh(struct Object *ob, const struct Mesh *me_eval)
|
||||
{
|
||||
float min[3], max[3];
|
||||
|
||||
@@ -4169,7 +4169,7 @@ void BKE_object_foreach_display_point(Object *ob,
|
||||
void *user_data)
|
||||
{
|
||||
/* TODO: pointcloud and hair objects support */
|
||||
Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
|
||||
const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
|
||||
float co[3];
|
||||
|
||||
if (mesh_eval != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user