2011-02-18 13:05:18 +00:00
|
|
|
/*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
2011-10-10 09:38:02 +00:00
|
|
|
* Contributor(s): (mar-2001 nzc)
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BKE_MESH_H__
|
|
|
|
#define __BKE_MESH_H__
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-02-18 13:05:18 +00:00
|
|
|
/** \file BKE_mesh.h
|
|
|
|
* \ingroup bke
|
|
|
|
*/
|
|
|
|
|
2012-06-04 12:10:38 +00:00
|
|
|
struct ID;
|
2005-07-14 18:04:27 +00:00
|
|
|
struct BoundBox;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct DispList;
|
2013-04-22 12:00:37 +00:00
|
|
|
struct EdgeHash;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct ListBase;
|
2010-09-04 05:31:25 +00:00
|
|
|
struct BMEditMesh;
|
|
|
|
struct BMesh;
|
2013-02-05 12:46:15 +00:00
|
|
|
struct Main;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct Mesh;
|
2010-09-04 05:31:25 +00:00
|
|
|
struct MPoly;
|
|
|
|
struct MLoop;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct MFace;
|
2009-01-23 20:36:47 +00:00
|
|
|
struct MEdge;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct MVert;
|
2010-09-04 05:31:25 +00:00
|
|
|
struct MDeformVert;
|
- convert all DerivedMesh map functions to use index based
mapping (instead of Edit{Vert,Edge,Face} pointers)
- dropped convertToDispListMeshMapped (whew, glad of it too)
- added DerivedMesh drawMappedFaces function
- dropped EM suffix for DerivedMesh functions, it was neither
particularly correct nor descriptive
- converted test_index_mface to test_index_face that also corrects
MCol and TFace. Good thing we had three versions of this routine,
you never know when one might burn down.
- removed flipnorm_mesh, not used anymore (and was incorrect to
boot)
- Getting face select to work with modifiers turned out to be much
more complicated than expected. Reworked mapping architecture for
modifiers - basically elements in a DispListMesh are now required
to be stored in an order that corresponds exactly to original
ordering. MVert/MEdge/MFace all have a new flag ME_XXX_STEPINDEX
that is set on each element that is set on the first derived element
of each original element. I can't say the code to follow these
requirements for subsurf is particularly transparent, but on the
upside it is a reasonably consistent and simple system that is memory
efficient and allows keeping the DispListMesh structure.
- rewrote mirror modifier to be simpler/conform to new requirements
for mapped DispListMesh structure. This also means that mirror interacts
much better with incremental subsurf calculation (it used to recalc
one entire side on any topology change, now it generally avoids that).
- added EM_{init,free}_index_arrays and EM_get_{vert,edge,face}_for_index
functions to handle mapping indices back into appropriate EditMesh
structures.
- bug fix, make edges didn't recalc object data
- bug fix, initial image assignment to TFace's didn't recalc object data
- new feature, added circle select support for FACESELECT
- bug fix, creating new faces in editmode duplicated the TFACE active
flag - but there should only be one active tface
- bug fix, possible crash when deleting all faces in faceselect mode
on mesh with tfaces...
Still todo: TFace edge drawing is still not always correct in face
mode, in particular with a mirror modifier when mesh has edges (and
no preceeding subsurf). Have not yet decided how to deal with this.
Best solution is probably to do switch to meshes all having MEdge's,
in which case I can get rid of TFace edge flags (and need to recalc
modifiers on tface selection change).
2005-08-20 03:08:23 +00:00
|
|
|
struct MCol;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct Object;
|
Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.
Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData
Replaced TFace by MTFace:
This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.
Removed DispListMesh:
This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.
Removed ssDM and meshDM DerivedMesh backends:
The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.
This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00
|
|
|
struct MTFace;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct VecNor;
|
Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.
Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData
Replaced TFace by MTFace:
This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.
Removed DispListMesh:
This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.
Removed ssDM and meshDM DerivedMesh backends:
The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.
This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00
|
|
|
struct CustomData;
|
2011-02-09 02:28:11 +00:00
|
|
|
struct DerivedMesh;
|
|
|
|
struct Scene;
|
2011-10-30 09:19:07 +00:00
|
|
|
struct MLoopUV;
|
2012-01-17 16:31:13 +00:00
|
|
|
struct UvVertMap;
|
|
|
|
struct UvMapVert;
|
|
|
|
struct UvElementMap;
|
|
|
|
struct UvElement;
|
2014-01-11 11:31:44 +01:00
|
|
|
struct ReportList;
|
2013-09-09 02:11:44 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-09-09 05:42:26 +00:00
|
|
|
/* setting zero so we can catch bugs in OpenMP/BMesh */
|
|
|
|
#ifdef DEBUG
|
|
|
|
# define BKE_MESH_OMP_LIMIT 0
|
|
|
|
#else
|
|
|
|
# define BKE_MESH_OMP_LIMIT 10000
|
|
|
|
#endif
|
2013-05-08 12:56:51 +00:00
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
/* *** mesh.c *** */
|
2013-06-14 08:28:27 +00:00
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me, struct Object *ob);
|
2013-01-24 04:02:30 +00:00
|
|
|
|
2012-02-28 23:08:40 +00:00
|
|
|
int poly_find_loop_from_vert(const struct MPoly *poly,
|
2012-05-05 21:28:12 +00:00
|
|
|
const struct MLoop *loopstart,
|
|
|
|
unsigned vert);
|
2012-02-28 23:08:40 +00:00
|
|
|
|
2014-03-16 03:24:05 +11:00
|
|
|
int poly_get_adj_loops_from_vert(unsigned r_adj[3], const struct MPoly *poly,
|
2012-05-05 21:28:12 +00:00
|
|
|
const struct MLoop *mloop, unsigned vert);
|
2012-02-28 23:08:40 +00:00
|
|
|
|
2012-05-22 15:28:44 +00:00
|
|
|
int BKE_mesh_edge_other_vert(const struct MEdge *e, int v);
|
|
|
|
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_mesh_unlink(struct Mesh *me);
|
2012-05-05 14:03:12 +00:00
|
|
|
void BKE_mesh_free(struct Mesh *me, int unlink);
|
2013-02-05 12:46:15 +00:00
|
|
|
struct Mesh *BKE_mesh_add(struct Main *bmain, const char *name);
|
|
|
|
struct Mesh *BKE_mesh_copy_ex(struct Main *bmain, struct Mesh *me);
|
2012-05-05 14:03:12 +00:00
|
|
|
struct Mesh *BKE_mesh_copy(struct Mesh *me);
|
2013-03-17 19:55:10 +00:00
|
|
|
void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd);
|
2014-03-16 21:55:30 +11:00
|
|
|
void BKE_mesh_ensure_skin_customdata(struct Mesh *me);
|
2009-08-30 21:30:07 +00:00
|
|
|
|
2012-05-05 14:03:12 +00:00
|
|
|
void BKE_mesh_make_local(struct Mesh *me);
|
2012-10-15 09:11:17 +00:00
|
|
|
void BKE_mesh_boundbox_calc(struct Mesh *me, float r_loc[3], float r_size[3]);
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_mesh_texspace_calc(struct Mesh *me);
|
2012-12-21 07:28:14 +00:00
|
|
|
float (*BKE_mesh_orco_verts_get(struct Object *ob))[3];
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totvert, int invert);
|
2008-01-29 19:49:03 +00:00
|
|
|
int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr);
|
2012-05-05 16:03:57 +00:00
|
|
|
struct Mesh *BKE_mesh_from_object(struct Object *ob);
|
2013-03-17 19:55:10 +00:00
|
|
|
void BKE_mesh_assign_object(struct Object *ob, struct Mesh *me);
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_mesh_from_metaball(struct ListBase *lb, struct Mesh *me);
|
|
|
|
int BKE_mesh_nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *totvert,
|
|
|
|
struct MEdge **alledge, int *totedge, struct MLoop **allloop, struct MPoly **allpoly,
|
|
|
|
int *totloop, int *totpoly);
|
2012-07-14 17:30:49 +00:00
|
|
|
int BKE_mesh_nurbs_displist_to_mdata(struct Object *ob, struct ListBase *dispbase, struct MVert **allvert, int *_totvert,
|
2012-05-05 21:28:12 +00:00
|
|
|
struct MEdge **alledge, int *_totedge, struct MLoop **allloop, struct MPoly **allpoly,
|
2013-01-10 17:37:17 +00:00
|
|
|
struct MLoopUV **alluv, int *_totloop, int *_totpoly);
|
2013-03-17 19:55:10 +00:00
|
|
|
void BKE_mesh_from_nurbs_displist(struct Object *ob, struct ListBase *dispbase, const bool use_orco_uv);
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_mesh_from_nurbs(struct Object *ob);
|
2013-03-15 10:48:48 +00:00
|
|
|
void BKE_mesh_to_curve_nurblist(struct DerivedMesh *dm, struct ListBase *nurblist, const int edge_users_test);
|
2013-03-14 18:35:21 +00:00
|
|
|
void BKE_mesh_to_curve(struct Scene *scene, struct Object *ob);
|
2013-08-14 11:29:58 +00:00
|
|
|
void BKE_mesh_material_index_remove(struct Mesh *me, short index);
|
|
|
|
void BKE_mesh_material_index_clear(struct Mesh *me);
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_mesh_smooth_flag_set(struct Object *meshOb, int enableSmooth);
|
2013-09-09 02:11:44 +00:00
|
|
|
|
2012-05-05 21:28:12 +00:00
|
|
|
const char *BKE_mesh_cmp(struct Mesh *me1, struct Mesh *me2, float thresh);
|
2010-10-27 02:22:55 +00:00
|
|
|
|
2012-05-05 21:28:12 +00:00
|
|
|
struct BoundBox *BKE_mesh_boundbox_get(struct Object *ob);
|
|
|
|
void BKE_mesh_texspace_get(struct Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]);
|
2013-07-15 11:11:36 +00:00
|
|
|
void BKE_mesh_texspace_copy_from_object(struct Mesh *me, struct Object *ob);
|
2005-07-14 18:04:27 +00:00
|
|
|
|
2013-09-20 11:14:08 +00:00
|
|
|
bool BKE_mesh_uv_cdlayer_rename_index(struct Mesh *me, const int poly_index, const int loop_index, const int face_index,
|
|
|
|
const char *new_name, const bool do_tessface);
|
|
|
|
bool BKE_mesh_uv_cdlayer_rename(struct Mesh *me, const char *old_name, const char *new_name, bool do_tessface);
|
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
float (*BKE_mesh_vertexCos_get(struct Mesh *me, int *r_numVerts))[3];
|
2011-02-09 15:13:20 +00:00
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
/* vertex level transformations & checks (no derived mesh) */
|
|
|
|
|
|
|
|
bool BKE_mesh_minmax(struct Mesh *me, float r_min[3], float r_max[3]);
|
|
|
|
void BKE_mesh_translate(struct Mesh *me, const float offset[3], const bool do_keys);
|
|
|
|
|
|
|
|
void BKE_mesh_ensure_navmesh(struct Mesh *me);
|
|
|
|
|
|
|
|
void BKE_mesh_tessface_calc(struct Mesh *mesh);
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
void BKE_mesh_mselect_clear(struct Mesh *me);
|
|
|
|
void BKE_mesh_mselect_validate(struct Mesh *me);
|
|
|
|
int BKE_mesh_mselect_find(struct Mesh *me, int index, int type);
|
|
|
|
int BKE_mesh_mselect_active_get(struct Mesh *me, int type);
|
|
|
|
void BKE_mesh_mselect_active_set(struct Mesh *me, int index, int type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *** mesh_evaluate.c *** */
|
2004-07-08 20:38:27 +00:00
|
|
|
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_mesh_calc_normals_mapping(
|
2012-01-06 00:08:37 +00:00
|
|
|
struct MVert *mverts, int numVerts,
|
2014-03-16 03:24:05 +11:00
|
|
|
struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*r_polyNors)[3],
|
|
|
|
struct MFace *mfaces, int numFaces, const int *origIndexFace, float (*r_faceNors)[3]);
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_mesh_calc_normals_mapping_ex(
|
2012-01-06 00:45:07 +00:00
|
|
|
struct MVert *mverts, int numVerts,
|
2014-03-16 03:24:05 +11:00
|
|
|
struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*r_polyNors)[3],
|
|
|
|
struct MFace *mfaces, int numFaces, const int *origIndexFace, float (*r_faceNors)[3],
|
2013-03-19 23:17:44 +00:00
|
|
|
const bool only_face_normals);
|
2013-05-28 14:23:07 +00:00
|
|
|
void BKE_mesh_calc_normals_poly(
|
2012-01-06 00:45:07 +00:00
|
|
|
struct MVert *mverts, int numVerts,
|
|
|
|
struct MLoop *mloop, struct MPoly *mpolys,
|
2014-03-16 03:24:05 +11:00
|
|
|
int numLoops, int numPolys, float (*r_polyNors)[3],
|
2013-06-12 09:35:02 +00:00
|
|
|
const bool only_face_normals);
|
2013-05-28 14:23:07 +00:00
|
|
|
void BKE_mesh_calc_normals(struct Mesh *me);
|
2013-09-09 02:11:44 +00:00
|
|
|
void BKE_mesh_calc_normals_tessface(
|
|
|
|
struct MVert *mverts, int numVerts,
|
|
|
|
struct MFace *mfaces, int numFaces,
|
2014-03-16 03:24:05 +11:00
|
|
|
float (*r_faceNors)[3]);
|
2013-09-10 12:48:08 +00:00
|
|
|
void BKE_mesh_normals_loop_split(
|
2013-10-09 17:48:27 +00:00
|
|
|
struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges,
|
|
|
|
struct MLoop *mloops, float (*r_loopnors)[3], const int numLoops,
|
|
|
|
struct MPoly *mpolys, float (*polynors)[3], const int numPolys, float split_angle);
|
2014-01-11 11:31:44 +01:00
|
|
|
void BKE_mesh_loop_tangents_ex(
|
|
|
|
struct MVert *mverts, const int numVerts, struct MLoop *mloops, float (*r_looptangent)[4], float (*loopnors)[3],
|
|
|
|
struct MLoopUV *loopuv, const int numLoops, struct MPoly *mpolys, const int numPolys,
|
|
|
|
struct ReportList *reports);
|
|
|
|
void BKE_mesh_loop_tangents(
|
|
|
|
struct Mesh *mesh, const char *uvmap, float (*r_looptangents)[4], struct ReportList *reports);
|
2013-09-09 02:11:44 +00:00
|
|
|
|
|
|
|
void BKE_mesh_calc_poly_normal(
|
|
|
|
struct MPoly *mpoly, struct MLoop *loopstart,
|
|
|
|
struct MVert *mvarray, float no[3]);
|
|
|
|
void BKE_mesh_calc_poly_normal_coords(
|
|
|
|
struct MPoly *mpoly, struct MLoop *loopstart,
|
|
|
|
const float (*vertex_coords)[3], float no[3]);
|
|
|
|
void BKE_mesh_calc_poly_center(
|
|
|
|
struct MPoly *mpoly, struct MLoop *loopstart,
|
|
|
|
struct MVert *mvarray, float cent[3]);
|
|
|
|
float BKE_mesh_calc_poly_area(
|
|
|
|
struct MPoly *mpoly, struct MLoop *loopstart,
|
2014-04-16 00:27:35 +10:00
|
|
|
struct MVert *mvarray);
|
2013-09-09 02:11:44 +00:00
|
|
|
void BKE_mesh_calc_poly_angles(
|
|
|
|
struct MPoly *mpoly, struct MLoop *loopstart,
|
|
|
|
struct MVert *mvarray, float angles[]);
|
|
|
|
|
|
|
|
void BKE_mesh_poly_edgehash_insert(
|
|
|
|
struct EdgeHash *ehash,
|
|
|
|
const struct MPoly *mp, const struct MLoop *mloop);
|
|
|
|
void BKE_mesh_poly_edgebitmap_insert(
|
|
|
|
unsigned int *edge_bitmap,
|
|
|
|
const struct MPoly *mp, const struct MLoop *mloop);
|
|
|
|
|
|
|
|
|
|
|
|
bool BKE_mesh_center_median(struct Mesh *me, float cent[3]);
|
|
|
|
bool BKE_mesh_center_bounds(struct Mesh *me, float cent[3]);
|
|
|
|
bool BKE_mesh_center_centroid(struct Mesh *me, float cent[3]);
|
2013-05-28 14:23:07 +00:00
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
/* tessface */
|
|
|
|
void BKE_mesh_loops_to_mface_corners(
|
|
|
|
struct CustomData *fdata, struct CustomData *ldata,
|
2014-01-22 02:56:52 +11:00
|
|
|
struct CustomData *pdata, unsigned int lindex[4], int findex,
|
2013-09-09 02:11:44 +00:00
|
|
|
const int polyindex, const int mf_len,
|
|
|
|
const int numTex, const int numCol,
|
2014-04-13 12:18:51 +02:00
|
|
|
const bool hasPCol, const bool hasOrigSpace, const bool hasLNor);
|
2014-01-21 16:32:36 +01:00
|
|
|
void BKE_mesh_loops_to_tessdata(
|
2014-01-22 19:49:14 +01:00
|
|
|
struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, struct MFace *mface,
|
2014-01-21 16:32:36 +01:00
|
|
|
int *polyindices, unsigned int (*loopindices)[4], const int num_faces);
|
2013-09-09 02:11:44 +00:00
|
|
|
int BKE_mesh_recalc_tessellation(
|
|
|
|
struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata,
|
|
|
|
struct MVert *mvert,
|
|
|
|
int totface, int totloop, int totpoly,
|
|
|
|
const bool do_face_normals);
|
|
|
|
int BKE_mesh_mpoly_to_mface(
|
|
|
|
struct CustomData *fdata, struct CustomData *ldata,
|
|
|
|
struct CustomData *pdata, int totface, int totloop, int totpoly);
|
|
|
|
void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh);
|
|
|
|
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,
|
2014-03-16 03:24:05 +11:00
|
|
|
int *r_totloop, int *r_totpoly,
|
|
|
|
struct MLoop **r_mloop, struct MPoly **r_mpoly);
|
2013-09-09 02:11:44 +00:00
|
|
|
|
|
|
|
/* flush flags */
|
|
|
|
void BKE_mesh_flush_hidden_from_verts_ex(
|
|
|
|
const struct MVert *mvert,
|
|
|
|
const struct MLoop *mloop,
|
|
|
|
struct MEdge *medge, const int totedge,
|
|
|
|
struct MPoly *mpoly, const int totpoly);
|
|
|
|
void BKE_mesh_flush_hidden_from_verts(struct Mesh *me);
|
|
|
|
void BKE_mesh_flush_hidden_from_polys_ex(
|
|
|
|
struct MVert *mvert,
|
|
|
|
const struct MLoop *mloop,
|
|
|
|
struct MEdge *medge, const int totedge,
|
|
|
|
const struct MPoly *mpoly, const int totpoly);
|
|
|
|
void BKE_mesh_flush_hidden_from_polys(struct Mesh *me);
|
|
|
|
void BKE_mesh_flush_select_from_polys_ex(
|
|
|
|
struct MVert *mvert, const int totvert,
|
|
|
|
const struct MLoop *mloop,
|
|
|
|
struct MEdge *medge, const int totedge,
|
|
|
|
const struct MPoly *mpoly, const int totpoly);
|
|
|
|
void BKE_mesh_flush_select_from_polys(struct Mesh *me);
|
|
|
|
void BKE_mesh_flush_select_from_verts_ex(
|
|
|
|
const struct MVert *mvert, const int totvert,
|
|
|
|
const struct MLoop *mloop,
|
|
|
|
struct MEdge *medge, const int totedge,
|
|
|
|
struct MPoly *mpoly, const int totpoly);
|
|
|
|
void BKE_mesh_flush_select_from_verts(struct Mesh *me);
|
2013-06-14 07:15:38 +00:00
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
/* spatial evaluation */
|
|
|
|
void BKE_mesh_calc_relative_deform(
|
|
|
|
const struct MPoly *mpoly, const int totpoly,
|
|
|
|
const struct MLoop *mloop, const int totvert,
|
|
|
|
|
|
|
|
const float (*vert_cos_src)[3],
|
|
|
|
const float (*vert_cos_dst)[3],
|
|
|
|
|
|
|
|
const float (*vert_cos_org)[3],
|
|
|
|
float (*vert_cos_new)[3]);
|
2009-01-21 22:40:28 +00:00
|
|
|
|
2007-09-18 19:39:25 +00:00
|
|
|
|
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
/* *** mesh_validate.c *** */
|
|
|
|
|
|
|
|
int BKE_mesh_validate(struct Mesh *me, const int do_verbose);
|
2013-09-16 06:00:25 +00:00
|
|
|
void BKE_mesh_cd_validate(struct Mesh *me);
|
2013-09-09 02:11:44 +00:00
|
|
|
|
2013-09-04 01:29:34 +00:00
|
|
|
bool BKE_mesh_validate_arrays(
|
2012-03-15 20:10:07 +00:00
|
|
|
struct Mesh *me,
|
2011-12-08 04:51:03 +00:00
|
|
|
struct MVert *mverts, unsigned int totvert,
|
|
|
|
struct MEdge *medges, unsigned int totedge,
|
2012-06-28 09:08:11 +00:00
|
|
|
struct MFace *mfaces, unsigned int totface,
|
2012-03-15 20:10:07 +00:00
|
|
|
struct MLoop *mloops, unsigned int totloop,
|
|
|
|
struct MPoly *mpolys, unsigned int totpoly,
|
2011-12-08 04:51:03 +00:00
|
|
|
struct MDeformVert *dverts, /* assume totvert length */
|
2013-09-04 01:29:34 +00:00
|
|
|
const bool do_verbose, const bool do_fixes,
|
|
|
|
bool *r_change);
|
|
|
|
|
|
|
|
bool BKE_mesh_validate_all_customdata(
|
|
|
|
struct CustomData *vdata, struct CustomData *edata,
|
|
|
|
struct CustomData *ldata, struct CustomData *pdata,
|
2013-09-04 06:50:15 +00:00
|
|
|
const bool check_meshmask,
|
2013-09-04 01:29:34 +00:00
|
|
|
const bool do_verbose, const bool do_fixes,
|
|
|
|
bool *r_change);
|
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
void BKE_mesh_strip_loose_faces(struct Mesh *me);
|
|
|
|
void BKE_mesh_strip_loose_polysloops(struct Mesh *me);
|
|
|
|
void BKE_mesh_strip_loose_edges(struct Mesh *me);
|
2011-02-09 02:28:11 +00:00
|
|
|
|
2013-09-09 02:11:44 +00:00
|
|
|
void BKE_mesh_calc_edges_legacy(struct Mesh *me, const bool use_old);
|
2013-03-16 01:19:03 +00:00
|
|
|
void BKE_mesh_calc_edges(struct Mesh *mesh, bool update, const bool select);
|
2011-02-09 15:13:20 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __BKE_MESH_H__ */
|