Commit: 9af30e3611c73a8366effd7283316ffd59431c3f Author: Hans Goudey Date: Fri Feb 3 22:25:52 2023 -0500 Branches: refactor-mesh-face-generic https://developer.blender.org/rB9af30e3611c73a8366effd7283316ffd59431c3f
Merge branch 'refactor-mesh-sharp-face-generic' into refactor-mesh-face-generic =================================================================== =================================================================== diff --cc source/blender/blenkernel/BKE_mesh_mapping.h index d1fea1fe2d6,97c7ce6b2b0..2bd5b40862c --- a/source/blender/blenkernel/BKE_mesh_mapping.h +++ b/source/blender/blenkernel/BKE_mesh_mapping.h @@@ -97,13 -99,12 +97,14 @@@ typedef struct MeshElemMap int count; } MeshElemMap; +#ifdef __cplusplus + /* mapping */ + -UvVertMap *BKE_mesh_uv_vert_map_create(const struct MPoly *mpoly, +UvVertMap *BKE_mesh_uv_vert_map_create(blender::OffsetIndices<int> polys, const bool *hide_poly, const bool *select_poly, - const struct MLoop *mloop, + const int *corner_verts, const float (*mloopuv)[2], unsigned int totpoly, unsigned int totvert, diff --cc source/blender/blenkernel/intern/mesh_mapping.cc index 02983a7eb81,d7eed3863d6..689cfd5cb3a --- a/source/blender/blenkernel/intern/mesh_mapping.cc +++ b/source/blender/blenkernel/intern/mesh_mapping.cc @@@ -30,20 -29,22 +30,21 @@@ /** \name Mesh Connectivity Mapping * \{ */ - /* ngon version wip, based on BM_uv_vert_map_create */ -UvVertMap *BKE_mesh_uv_vert_map_create(const MPoly *mpoly, - const bool *hide_poly, - const bool *select_poly, - const MLoop *mloop, - const float (*mloopuv)[2], - uint totpoly, - uint totvert, - const float limit[2], - const bool selected, - const bool use_winding) +UvVertMap *BKE_mesh_uv_vert_map_createconst(blender::OffsetIndices<int> polys, + const bool *hide_poly, + const bool *select_poly, + const int *corner_verts, + const float (*mloopuv)[2], + uint totpoly, + uint totvert, + const float limit[2], + const bool selected, + const bool use_winding) { + /* NOTE: N-gon version WIP, based on #BM_uv_vert_map_create. */ + UvVertMap *vmap; UvMapVert *buf; - const MPoly *mp; uint a; int i, totuv, nverts; @@@ -75,7 -73,13 +72,12 @@@ return nullptr; } + bool *winding = nullptr; + if (use_winding) { + winding = static_cast<bool *>(MEM_callocN(sizeof(*winding) * totpoly, "winding")); + } + - mp = mpoly; - for (a = 0; a < totpoly; a++, mp++) { + for (a = 0; a < totpoly; a++) { if (!selected || (!(hide_poly && hide_poly[a]) && (select_poly && select_poly[a]))) { float(*tf_uv)[2] = nullptr; diff --cc source/blender/blenkernel/intern/multires_reshape.hh index 01beb6dc04c,8e112f18d7b..417944b7d89 --- a/source/blender/blenkernel/intern/multires_reshape.hh +++ b/source/blender/blenkernel/intern/multires_reshape.hh @@@ -31,12 -32,11 +31,12 @@@ struct MultiresReshapeContext /* Base mesh from original object. * NOTE: Does NOT include any leading modifiers in it. */ - struct Mesh *base_mesh; + Mesh *base_mesh; const float (*base_positions)[3]; - const struct MEdge *base_edges; - const struct MPoly *base_polys; + const MEdge *base_edges; + const MPoly *base_polys; - const MLoop *base_loops; + const int *base_corner_verts; + const int *base_corner_edges; /* Subdivision surface created for multires modifier. * diff --cc source/blender/bmesh/intern/bmesh_mesh_convert.cc index ced5178c58c,97b33a72d77..1b63da4925a --- a/source/blender/bmesh/intern/bmesh_mesh_convert.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_convert.cc @@@ -111,10 -111,21 +111,22 @@@ using blender::MutableSpan using blender::Span; using blender::StringRef; + static char bm_edge_flag_from_mflag(const short mflag) + { + return ((mflag & ME_SEAM) ? BM_ELEM_SEAM : 0) | ((mflag & ME_EDGEDRAW) ? BM_ELEM_DRAW : 0); + } + + static short bm_edge_flag_to_mflag(const BMEdge *e) + { + const char hflag = e->head.hflag; + + return ((hflag & BM_ELEM_SEAM) ? ME_SEAM : 0) | ((hflag & BM_ELEM_DRAW) ? ME_EDGEDRAW : 0); + } + /* Static function for alloc (duplicate in modifiers_bmesh.c) */ static BMFace *bm_face_create_from_mpoly(BMesh &bm, - Span<MLoop> loops, + Span<int> poly_verts, + Span<int> poly_edges, Span<BMVert *> vtable, Span<BMEdge *> etable) { _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs