Mesh: Avoid position copying in corrective smooth modifier #108291
|
@ -658,8 +658,9 @@ static void correctivesmooth_modifier_do(ModifierData *md,
|
|||
is_rest_coords_alloc = true;
|
||||
}
|
||||
else {
|
||||
rest_coords = BKE_mesh_vert_positions(static_cast<const Mesh *>(ob->data));
|
||||
me_numVerts = static_cast<const Mesh *>(ob->data)->totvert;
|
||||
const Mesh *me = static_cast<const Mesh *>(ob->data);
|
||||
Chao-Li marked this conversation as resolved
Outdated
|
||||
rest_coords = BKE_mesh_vert_positions(me);
|
||||
me_numVerts = me->totvert;
|
||||
}
|
||||
|
||||
BLI_assert((uint)me_numVerts == verts_num);
|
||||
|
|
Loading…
Reference in New Issue
It would be a bit nicer to make a temporary
Mesh *mesh
variable, to avoid casting the object data twice.Sure. I named it
Mesh *me
since there's a variable namedmesh
in outer scope.