Cleanup: Further use of const when accessing evaluated mesh

Also resolve a warning from the previous commit. The next blocker to
using const is `BKE_mesh_wrapper_ensure_mdata`.
This commit is contained in:
Hans Goudey 2021-07-02 11:56:29 -05:00
parent 5f8969bb4b
commit 8221d64844
4 changed files with 6 additions and 6 deletions

View File

@ -5099,7 +5099,7 @@ static void followtrack_project_to_depth_object_if_needed(FollowTrackContext *co
}
Object *depth_object = context->depth_object;
Mesh *depth_mesh = BKE_object_get_evaluated_mesh(depth_object);
const Mesh *depth_mesh = BKE_object_get_evaluated_mesh(depth_object);
if (depth_mesh == NULL) {
return;
}

View File

@ -175,7 +175,7 @@ const MLoopTri *BKE_mesh_runtime_looptri_ensure(const Mesh *mesh)
}
else {
/* Must isolate multithreaded tasks while holding a mutex lock. */
BLI_task_isolate(mesh_runtime_looptri_recalc_isolated, mesh);
BLI_task_isolate(mesh_runtime_looptri_recalc_isolated, (void *)mesh);
looptri = mesh->runtime.looptris.array;
}

View File

@ -537,7 +537,7 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
static bool PE_create_shape_tree(PEData *data, Object *shapeob)
{
Object *shapeob_eval = DEG_get_evaluated_object(data->depsgraph, shapeob);
Mesh *mesh = BKE_object_get_evaluated_mesh(shapeob_eval);
const Mesh *mesh = BKE_object_get_evaluated_mesh(shapeob_eval);
memset(&data->shape_bvh, 0, sizeof(data->shape_bvh));

View File

@ -255,7 +255,7 @@ static SnapObjectData *snap_object_data_lookup(SnapObjectContext *sctx, Object *
static SnapObjectData *snap_object_data_mesh_get(SnapObjectContext *sctx,
Object *ob_eval,
Mesh *me_eval,
const Mesh *me_eval,
bool use_hide)
{
SnapObjectData *sod;
@ -687,7 +687,7 @@ static bool raycastMesh(SnapObjectContext *sctx,
const float ray_start[3],
const float ray_dir[3],
Object *ob_eval,
Mesh *me_eval,
const Mesh *me_eval,
const float obmat[4][4],
const uint ob_index,
bool use_hide,
@ -1088,7 +1088,7 @@ static void raycast_obj_fn(SnapObjectContext *sctx,
case OB_SURF:
case OB_FONT: {
if (!is_object_active) {
Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob_eval);
const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob_eval);
if (mesh_eval) {
retval = raycastMesh(sctx,
dt->ray_start,