diff options
Diffstat (limited to 'source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_weights.cc')
-rw-r--r-- | source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_weights.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_weights.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_weights.cc index ba194a4b167..509331f2f1e 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_weights.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_weights.cc @@ -8,6 +8,7 @@ #include "MEM_guardedalloc.h" #include "BKE_deform.h" +#include "BKE_mesh.h" #include "draw_subdivision.h" #include "extract_mesh.hh" @@ -171,8 +172,9 @@ static void extract_weights_init_subdiv(const DRWSubdivCache *subdiv_cache, extract_weights_init(mr, cache, coarse_weights, _data); if (mr->extract_type != MR_EXTRACT_BMESH) { - for (int i = 0; i < coarse_mesh->totpoly; i++) { - const MPoly *mpoly = &coarse_mesh->mpoly[i]; + const Span<MPoly> coarse_polys = coarse_mesh->polygons(); + for (const int i : coarse_polys.index_range()) { + const MPoly *mpoly = &coarse_polys[i]; extract_weights_iter_poly_mesh(mr, mpoly, i, _data); } } |