From 8c25889bb67db4c1d2f94bf85ca6d1c2a050fcfe Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 18 Apr 2022 23:48:43 -0500 Subject: Refactor: Move mesh face dot tag out of MVert Continuing the refactors described in T93602, this commit moves the face dot tag set by the subdivision surface modifier out of `MVert` to `MeshRuntime`. This clarifies its status as runtime data and allows further refactoring of mesh positions in the future. Before, `BKE_modifiers_uses_subsurf_facedots` was used to check whether subsurf face dots should be drawn, but now we can just check if the tags exist on the mesh. Modifiers that create new new geometry or modify topology will already remove the array by clearing mesh runtime data. Differential Revision: https://developer.blender.org/D14680 --- .../draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc') diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc index 27149a80f9b..43aa52f08c8 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc @@ -5,9 +5,7 @@ * \ingroup draw */ -#include "BLI_vector.hh" - -#include "MEM_guardedalloc.h" +#include "BLI_bitmap.h" #include "extract_mesh.h" @@ -538,7 +536,8 @@ static void extract_edituv_fdots_iter_poly_mesh(const MeshRenderData *mr, { MeshExtract_EditUvElem_Data *data = static_cast(_data); if (mr->use_subsurf_fdots) { - /* Check #ME_VERT_FACEDOT. */ + const BLI_bitmap *facedot_tags = mr->me->runtime.subsurf_face_dot_tags; + const MLoop *mloop = mr->mloop; const int ml_index_end = mp->loopstart + mp->totloop; for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { @@ -546,8 +545,7 @@ static void extract_edituv_fdots_iter_poly_mesh(const MeshRenderData *mr, const bool real_fdot = (mr->extract_type == MR_EXTRACT_MAPPED && mr->p_origindex && mr->p_origindex[mp_index] != ORIGINDEX_NONE); - const bool subd_fdot = (!mr->use_subsurf_fdots || - (mr->mvert[ml->v].flag & ME_VERT_FACEDOT) != 0); + const bool subd_fdot = BLI_BITMAP_TEST(facedot_tags, ml->v); edituv_facedot_add(data, ((mp->flag & ME_HIDE) != 0) || !real_fdot || !subd_fdot, (mp->flag & ME_FACE_SEL) != 0, -- cgit v1.2.3