diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2022-07-26 00:43:48 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2022-07-26 00:43:48 +0300 |
commit | f081e76037432cb926be45e980eac201d337032c (patch) | |
tree | dd1225521c12ea21c0b0c3d51ec1ae3f8730755f /source/blender/blenkernel/BKE_mesh.h | |
parent | fa2084ae58a77b1201289b6bedac427f73c762d1 (diff) | |
parent | 462f99bf38648a08226b1fba423315aec2bc577b (diff) |
Merge branch 'master' into geometry-nodes-iterative-cachegeometry-nodes-rigid-body-integration
Diffstat (limited to 'source/blender/blenkernel/BKE_mesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 78 |
1 files changed, 13 insertions, 65 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 66e0ff8e81a..6c61068b1c2 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -85,10 +85,18 @@ struct Mesh *BKE_mesh_from_bmesh_for_eval_nomain(struct BMesh *bm, * Add original index (#CD_ORIGINDEX) layers if they don't already exist. This is meant to be used * when creating an evaluated mesh from an original edit mode mesh, to allow mapping from the * evaluated vertices to the originals. + * + * The mesh is expected to of a `ME_WRAPPER_TYPE_MDATA` wrapper type. This is asserted. */ void BKE_mesh_ensure_default_orig_index_customdata(struct Mesh *mesh); /** + * Same as #BKE_mesh_ensure_default_orig_index_customdata but does not perform any checks: they + * must be done by the caller. + */ +void BKE_mesh_ensure_default_orig_index_customdata_no_check(struct Mesh *mesh); + +/** * Find the index of the loop in 'poly' which references vertex, * returns -1 if not found */ @@ -183,14 +191,6 @@ void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totver */ void BKE_mesh_orco_ensure(struct Object *ob, struct Mesh *mesh); -/** - * Rotates the vertices of a face in case v[2] or v[3] (vertex index) is = 0. - * this is necessary to make the if #MFace.v4 check for quads work. - */ -int BKE_mesh_mface_index_validate(struct MFace *mface, - struct CustomData *mfdata, - int mfindex, - int nr); struct Mesh *BKE_mesh_from_object(struct Object *ob); void BKE_mesh_assign_object(struct Main *bmain, struct Object *ob, struct Mesh *me); void BKE_mesh_from_metaball(struct ListBase *lb, struct Mesh *me); @@ -304,7 +304,6 @@ bool BKE_mesh_minmax(const struct Mesh *me, float r_min[3], float r_max[3]); void BKE_mesh_transform(struct Mesh *me, const float mat[4][4], bool do_keys); void BKE_mesh_translate(struct Mesh *me, const float offset[3], bool do_keys); -void BKE_mesh_tessface_ensure(struct Mesh *mesh); void BKE_mesh_tessface_clear(struct Mesh *mesh); void BKE_mesh_do_versions_cd_flag_init(struct Mesh *mesh); @@ -334,15 +333,6 @@ void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float (*vert_coords)[3] /* *** mesh_tessellate.c *** */ /** - * Recreate #MFace Tessellation. - * - * \note This doesn't use multi-threading like #BKE_mesh_recalc_looptri since - * it's not used in many places and #MFace should be phased out. - */ - -void BKE_mesh_tessface_calc(struct Mesh *mesh); - -/** * Calculate tessellation into #MLoopTri which exist only for this purpose. */ void BKE_mesh_recalc_looptri(const struct MLoop *mloop, @@ -710,7 +700,8 @@ void BKE_mesh_calc_normals_split(struct Mesh *mesh); * to split geometry along sharp edges. */ void BKE_mesh_calc_normals_split_ex(struct Mesh *mesh, - struct MLoopNorSpaceArray *r_lnors_spacearr); + struct MLoopNorSpaceArray *r_lnors_spacearr, + float (*r_corner_normals)[3]); /** * Higher level functions hiding most of the code needed around call to @@ -789,37 +780,6 @@ void BKE_mesh_calc_volume(const struct MVert *mverts, float *r_volume, float r_center[3]); -/* tessface */ -void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh); -/** - * The same as #BKE_mesh_convert_mfaces_to_mpolys - * but oriented to be used in #do_versions from `readfile.c` - * the difference is how active/render/clone/stencil indices are handled here. - * - * normally they're being set from `pdata` which totally makes sense for meshes which are already - * converted to #BMesh structures, but when loading older files indices shall be updated in other - * way around, so newly added `pdata` and `ldata` would have this indices set - * based on `fdata` layer. - * - * this is normally only needed when reading older files, - * in all other cases #BKE_mesh_convert_mfaces_to_mpolys shall be always used. - */ -void BKE_mesh_do_versions_convert_mfaces_to_mpolys(struct Mesh *mesh); -void BKE_mesh_convert_mfaces_to_mpolys_ex(struct ID *id, - struct CustomData *fdata, - struct CustomData *ldata, - struct CustomData *pdata, - int totedge_i, - int totface_i, - int totloop_i, - int totpoly_i, - struct MEdge *medge, - struct MFace *mface, - int *r_totloop, - int *r_totpoly, - struct MLoop **r_mloop, - struct MPoly **r_mpoly); - /** * Flip a single MLoop's #MDisps structure, * low level function to be called from face-flipping code which re-arranged the mdisps themselves. @@ -1034,7 +994,7 @@ void BKE_mesh_strip_loose_edges(struct Mesh *me); /** * If the mesh is from a very old blender version, - * convert mface->edcode to edge drawflags + * convert #MFace.edcode to edge #ME_EDGEDRAW. */ void BKE_mesh_calc_edges_legacy(struct Mesh *me, bool use_old); void BKE_mesh_calc_edges_loose(struct Mesh *mesh); @@ -1050,8 +1010,8 @@ void BKE_mesh_calc_edges(struct Mesh *mesh, bool keep_existing_edges, bool selec void BKE_mesh_calc_edges_tessface(struct Mesh *mesh); /* In DerivedMesh.cc */ -void BKE_mesh_wrapper_deferred_finalize(struct Mesh *me_eval, - const struct CustomData_MeshMasks *cd_mask_finalize); +void BKE_mesh_wrapper_deferred_finalize_mdata(struct Mesh *me_eval, + const struct CustomData_MeshMasks *cd_mask_finalize); /* **** Depsgraph evaluation **** */ @@ -1072,18 +1032,6 @@ char *BKE_mesh_debug_info(const struct Mesh *me) void BKE_mesh_debug_print(const struct Mesh *me) ATTR_NONNULL(1); #endif -/* Inlines */ - -/* NOTE(@sybren): Instead of -1 that function uses ORIGINDEX_NONE as defined in BKE_customdata.h, - * but I don't want to force every user of BKE_mesh.h to also include that file. */ -BLI_INLINE int BKE_mesh_origindex_mface_mpoly(const int *index_mf_to_mpoly, - const int *index_mp_to_orig, - const int i) -{ - const int j = index_mf_to_mpoly[i]; - return (j != -1) ? (index_mp_to_orig ? index_mp_to_orig[j] : j) : -1; -} - #ifdef __cplusplus } #endif |