Differential D16893 Diff 59975 source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_area.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_stretch_area.cc
| Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | if (mr->extract_type == MR_EXTRACT_BMESH) { | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_assert(mr->extract_type == MR_EXTRACT_MESH); | BLI_assert(mr->extract_type == MR_EXTRACT_MESH); | ||||
| const float2 *uv_data = (const float2 *)CustomData_get_layer(&mr->me->ldata, CD_PROP_FLOAT2); | const float2 *uv_data = (const float2 *)CustomData_get_layer(&mr->me->ldata, CD_PROP_FLOAT2); | ||||
| const MPoly *mp = mr->mpoly; | const MPoly *mp = mr->mpoly; | ||||
| for (int mp_index = 0; mp_index < mr->poly_len; mp_index++, mp++) { | for (int mp_index = 0; mp_index < mr->poly_len; mp_index++, mp++) { | ||||
| float area = BKE_mesh_calc_poly_area( | float area = BKE_mesh_calc_poly_area( | ||||
| mp, &mr->mloop[mp->loopstart], reinterpret_cast<const float(*)[3]>(mr->vert_positions)); | mp, | ||||
| &mr->corner_verts[mp->loopstart], | |||||
| reinterpret_cast<const float(*)[3]>(mr->vert_positions)); | |||||
| float uvarea = area_poly_v2(reinterpret_cast<const float(*)[2]>(&uv_data[mp->loopstart]), | float uvarea = area_poly_v2(reinterpret_cast<const float(*)[2]>(&uv_data[mp->loopstart]), | ||||
| mp->totloop); | mp->totloop); | ||||
| tot_area += area; | tot_area += area; | ||||
| tot_uv_area += uvarea; | tot_uv_area += uvarea; | ||||
| r_area_ratio[mp_index] = area_ratio_get(area, uvarea); | r_area_ratio[mp_index] = area_ratio_get(area, uvarea); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||