Blender  V2.93
BKE_mesh.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 #pragma once
20 
25 #include "BKE_mesh_types.h"
26 #include "BLI_utildefines.h"
27 
28 struct BLI_Stack;
29 struct BMesh;
30 struct BMeshCreateParams;
31 struct BMeshFromMeshParams;
32 struct BMeshToMeshParams;
33 struct BoundBox;
34 struct CustomData;
36 struct Depsgraph;
37 struct EdgeHash;
38 struct ID;
39 struct KeyBlock;
40 struct LinkNode;
41 struct ListBase;
42 struct MDeformVert;
43 struct MDisps;
44 struct MEdge;
45 struct MFace;
46 struct MLoop;
47 struct MLoopTri;
48 struct MLoopUV;
49 struct MPoly;
50 struct MVert;
51 struct Main;
52 struct MemArena;
53 struct Mesh;
54 struct ModifierData;
55 struct Object;
56 struct PointCloud;
57 struct Scene;
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 /* setting zero so we can catch bugs in OpenMP/BMesh */
64 #ifdef DEBUG
65 # define BKE_MESH_OMP_LIMIT 0
66 #else
67 # define BKE_MESH_OMP_LIMIT 10000
68 #endif
69 
70 /* *** mesh.c *** */
71 
72 struct BMesh *BKE_mesh_to_bmesh_ex(const struct Mesh *me,
73  const struct BMeshCreateParams *create_params,
74  const struct BMeshFromMeshParams *convert_params);
75 struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me,
76  struct Object *ob,
77  const bool add_key_index,
78  const struct BMeshCreateParams *params);
79 
81  const struct BMeshToMeshParams *params,
82  const struct Mesh *me_settings);
84  const struct CustomData_MeshMasks *cd_mask_extra,
85  const struct Mesh *me_settings);
86 
87 int poly_find_loop_from_vert(const struct MPoly *poly, const struct MLoop *loopstart, uint vert);
88 int poly_get_adj_loops_from_vert(const struct MPoly *poly,
89  const struct MLoop *mloop,
90  unsigned int vert,
91  unsigned int r_adj[2]);
92 
93 int BKE_mesh_edge_other_vert(const struct MEdge *e, int v);
95  const struct MLoopTri *looptri,
96  int r_edges[3]);
97 
98 void BKE_mesh_free_data(struct Mesh *me);
99 void BKE_mesh_clear_geometry(struct Mesh *me);
100 struct Mesh *BKE_mesh_add(struct Main *bmain, const char *name);
101 void BKE_mesh_copy_settings(struct Mesh *me_dst, const struct Mesh *me_src);
102 void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd);
103 void BKE_mesh_ensure_skin_customdata(struct Mesh *me);
104 
105 struct Mesh *BKE_mesh_new_nomain(
106  int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len);
107 struct Mesh *BKE_mesh_new_nomain_from_template(const struct Mesh *me_src,
108  int verts_len,
109  int edges_len,
110  int tessface_len,
111  int loops_len,
112  int polys_len);
113 struct Mesh *BKE_mesh_new_nomain_from_template_ex(const struct Mesh *me_src,
114  int verts_len,
115  int edges_len,
116  int tessface_len,
117  int loops_len,
118  int polys_len,
119  struct CustomData_MeshMasks mask);
120 
121 void BKE_mesh_eval_delete(struct Mesh *mesh_eval);
122 
123 /* Performs copy for use during evaluation,
124  * optional referencing original arrays to reduce memory. */
125 struct Mesh *BKE_mesh_copy_for_eval(struct Mesh *source, bool reference);
126 
127 /* These functions construct a new Mesh,
128  * contrary to BKE_mesh_from_nurbs which modifies ob itself. */
129 struct Mesh *BKE_mesh_new_nomain_from_curve(struct Object *ob);
130 struct Mesh *BKE_mesh_new_nomain_from_curve_displist(struct Object *ob, struct ListBase *dispbase);
131 
133 bool BKE_mesh_clear_facemap_customdata(struct Mesh *me);
134 
135 float (*BKE_mesh_orco_verts_get(struct Object *ob))[3];
136 void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totvert, int invert);
137 int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr);
138 struct Mesh *BKE_mesh_from_object(struct Object *ob);
139 void BKE_mesh_assign_object(struct Main *bmain, struct Object *ob, struct Mesh *me);
140 void BKE_mesh_from_metaball(struct ListBase *lb, struct Mesh *me);
141 int BKE_mesh_nurbs_to_mdata(struct Object *ob,
142  struct MVert **r_allvert,
143  int *r_totvert,
144  struct MEdge **r_alledge,
145  int *r_totedge,
146  struct MLoop **r_allloop,
147  struct MPoly **r_allpoly,
148  int *r_totloop,
149  int *r_totpoly);
151  const struct ListBase *dispbase,
152  struct MVert **r_allvert,
153  int *r_totvert,
154  struct MEdge **r_alledge,
155  int *r_totedge,
156  struct MLoop **r_allloop,
157  struct MPoly **r_allpoly,
158  struct MLoopUV **r_alluv,
159  int *r_totloop,
160  int *r_totpoly);
161 void BKE_mesh_from_nurbs_displist(struct Main *bmain,
162  struct Object *ob,
163  struct ListBase *dispbase,
164  const char *obdata_name,
165  bool temporary);
166 void BKE_mesh_from_nurbs(struct Main *bmain, struct Object *ob);
167 void BKE_mesh_to_curve_nurblist(const struct Mesh *me,
168  struct ListBase *nurblist,
169  const int edge_users_test);
170 void BKE_mesh_to_curve(struct Main *bmain,
171  struct Depsgraph *depsgraph,
172  struct Scene *scene,
173  struct Object *ob);
174 void BKE_pointcloud_from_mesh(struct Mesh *me, struct PointCloud *pointcloud);
175 void BKE_mesh_to_pointcloud(struct Main *bmain,
176  struct Depsgraph *depsgraph,
177  struct Scene *scene,
178  struct Object *ob);
179 void BKE_mesh_from_pointcloud(const struct PointCloud *pointcloud, struct Mesh *me);
180 void BKE_pointcloud_to_mesh(struct Main *bmain,
181  struct Depsgraph *depsgraph,
182  struct Scene *scene,
183  struct Object *ob);
184 void BKE_mesh_material_index_remove(struct Mesh *me, short index);
185 bool BKE_mesh_material_index_used(struct Mesh *me, short index);
186 void BKE_mesh_material_index_clear(struct Mesh *me);
187 void BKE_mesh_material_remap(struct Mesh *me, const unsigned int *remap, unsigned int remap_len);
188 void BKE_mesh_smooth_flag_set(struct Mesh *me, const bool use_smooth);
189 
190 /* Needed after converting a mesh with subsurf optimal display to mesh. */
191 void BKE_mesh_edges_set_draw_render(struct Mesh *me);
192 
193 const char *BKE_mesh_cmp(struct Mesh *me1, struct Mesh *me2, float thresh);
194 
195 struct BoundBox *BKE_mesh_boundbox_get(struct Object *ob);
196 
197 void BKE_mesh_texspace_calc(struct Mesh *me);
198 void BKE_mesh_texspace_ensure(struct Mesh *me);
199 void BKE_mesh_texspace_get(struct Mesh *me, float r_loc[3], float r_size[3]);
200 void BKE_mesh_texspace_get_reference(struct Mesh *me,
201  short **r_texflag,
202  float **r_loc,
203  float **r_size);
204 void BKE_mesh_texspace_copy_from_object(struct Mesh *me, struct Object *ob);
205 
206 void BKE_mesh_split_faces(struct Mesh *mesh, bool free_loop_normals);
207 
208 /* Create new mesh from the given object at its current state.
209  * The owner of this mesh is unknown, it is up to the caller to decide.
210  *
211  * If preserve_all_data_layers is truth then the modifier stack is re-evaluated to ensure it
212  * preserves all possible custom data layers.
213  *
214  * NOTE: Dependency graph argument is required when preserve_all_data_layers is truth, and is
215  * ignored otherwise. */
217  struct Object *object,
218  const bool preserve_all_data_layers,
219  const bool preserve_origindex);
220 
221 /* This is a version of BKE_mesh_new_from_object() which stores mesh in the given main database.
222  * However, that function enforces object type to be a geometry one, and ensures a mesh is always
223  * generated, be it empty. */
224 struct Mesh *BKE_mesh_new_from_object_to_bmain(struct Main *bmain,
225  struct Depsgraph *depsgraph,
226  struct Object *object,
227  bool preserve_all_data_layers);
228 
230  struct Scene *scene,
231  struct Object *ob_eval,
232  struct ModifierData *md_eval,
233  const bool build_shapekey_layers);
234 
235 /* Copies a nomain-Mesh into an existing Mesh. */
236 void BKE_mesh_nomain_to_mesh(struct Mesh *mesh_src,
237  struct Mesh *mesh_dst,
238  struct Object *ob,
239  const struct CustomData_MeshMasks *mask,
240  bool take_ownership);
241 void BKE_mesh_nomain_to_meshkey(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct KeyBlock *kb);
242 
243 /* vertex level transformations & checks (no derived mesh) */
244 
245 bool BKE_mesh_minmax(const struct Mesh *me, float r_min[3], float r_max[3]);
246 void BKE_mesh_transform(struct Mesh *me, const float mat[4][4], bool do_keys);
247 void BKE_mesh_translate(struct Mesh *me, const float offset[3], const bool do_keys);
248 
249 void BKE_mesh_tessface_calc(struct Mesh *mesh);
250 void BKE_mesh_tessface_ensure(struct Mesh *mesh);
251 void BKE_mesh_tessface_clear(struct Mesh *mesh);
252 
254 
255 void BKE_mesh_mselect_clear(struct Mesh *me);
256 void BKE_mesh_mselect_validate(struct Mesh *me);
257 int BKE_mesh_mselect_find(struct Mesh *me, int index, int type);
258 int BKE_mesh_mselect_active_get(struct Mesh *me, int type);
259 void BKE_mesh_mselect_active_set(struct Mesh *me, int index, int type);
260 
261 void BKE_mesh_count_selected_items(const struct Mesh *mesh, int r_count[3]);
262 
263 float (*BKE_mesh_vert_coords_alloc(const struct Mesh *mesh, int *r_vert_len))[3];
264 void BKE_mesh_vert_coords_get(const struct Mesh *mesh, float (*vert_coords)[3]);
265 
267  const float (*vert_coords)[3],
268  const float mat[4][4]);
269 void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float (*vert_coords)[3]);
270 void BKE_mesh_vert_normals_apply(struct Mesh *mesh, const short (*vert_normals)[3]);
271 
272 /* *** mesh_evaluate.c *** */
273 
276  int numVerts,
277  const struct MLoop *mloop,
278  const struct MPoly *mpolys,
279  int numLoops,
280  int numPolys,
281  float (*r_polyNors)[3],
282  const struct MFace *mfaces,
283  int numFaces,
284  const int *origIndexFace,
285  float (*r_faceNors)[3]);
287  int numVerts,
288  const struct MLoop *mloop,
289  const struct MPoly *mpolys,
290  int numLoops,
291  int numPolys,
292  float (*r_polyNors)[3],
293  const struct MFace *mfaces,
294  int numFaces,
295  const int *origIndexFace,
296  float (*r_faceNors)[3],
297  const bool only_face_normals);
298 void BKE_mesh_calc_normals_poly(struct MVert *mverts,
299  float (*r_vertnors)[3],
300  int numVerts,
301  const struct MLoop *mloop,
302  const struct MPoly *mpolys,
303  int numLoops,
304  int numPolys,
305  float (*r_polyNors)[3],
306  const bool only_face_normals);
307 void BKE_mesh_calc_normals(struct Mesh *me);
308 void BKE_mesh_ensure_normals(struct Mesh *me);
311  int numVerts,
312  const struct MLoop *mloop,
313  const struct MLoopTri *looptri,
314  int looptri_num,
315  float (*r_tri_nors)[3]);
317  const struct MPoly *mpolys,
318  const int *loop_to_poly,
319  const int *e2lfan_curr,
320  const uint mv_pivot_index,
321  const struct MLoop **r_mlfan_curr,
322  int *r_mlfan_curr_index,
323  int *r_mlfan_vert_index,
324  int *r_mpfan_curr_index);
325 
326 void BKE_edges_sharp_from_angle_set(const struct MVert *mverts,
327  const int numVerts,
328  struct MEdge *medges,
329  const int numEdges,
330  struct MLoop *mloops,
331  const int numLoops,
332  struct MPoly *mpolys,
333  const float (*polynors)[3],
334  const int numPolys,
335  const float split_angle);
336 
340 typedef struct MLoopNorSpace {
342  float vec_lnor[3];
344  float vec_ref[3];
346  float vec_ortho[3];
348  float ref_alpha;
350  float ref_beta;
355  struct LinkNode *loops;
356  char flags;
357 
359  void *user_data;
364 enum {
366 };
367 
371 typedef struct MLoopNorSpaceArray {
372  MLoopNorSpace **lspacearr; /* MLoop aligned array */
373  struct LinkNode
374  *loops_pool; /* Allocated once, avoids to call BLI_linklist_prepend_arena() for each loop! */
375  char data_type; /* Whether we store loop indices, or pointers to BMLoop. */
376  int num_spaces; /* Number of clnors spaces defined in this array. */
377  struct MemArena *mem;
382 enum {
385 };
386 
387 /* Low-level custom normals functions. */
388 void BKE_lnor_spacearr_init(MLoopNorSpaceArray *lnors_spacearr,
389  const int numLoops,
390  const char data_type);
391 void BKE_lnor_spacearr_clear(MLoopNorSpaceArray *lnors_spacearr);
392 void BKE_lnor_spacearr_free(MLoopNorSpaceArray *lnors_spacearr);
394 void BKE_lnor_space_define(MLoopNorSpace *lnor_space,
395  const float lnor[3],
396  float vec_ref[3],
397  float vec_other[3],
398  struct BLI_Stack *edge_vectors);
399 void BKE_lnor_space_add_loop(MLoopNorSpaceArray *lnors_spacearr,
400  MLoopNorSpace *lnor_space,
401  const int ml_index,
402  void *bm_loop,
403  const bool is_single);
405  const short clnor_data[2],
406  float r_custom_lnor[3]);
408  const float custom_lnor[3],
409  short r_clnor_data[2]);
410 
411 /* Medium-level custom normals functions. */
412 void BKE_mesh_normals_loop_split(const struct MVert *mverts,
413  const int numVerts,
414  struct MEdge *medges,
415  const int numEdges,
416  struct MLoop *mloops,
417  float (*r_loopnors)[3],
418  const int numLoops,
419  struct MPoly *mpolys,
420  const float (*polynors)[3],
421  const int numPolys,
422  const bool use_split_normals,
423  const float split_angle,
424  MLoopNorSpaceArray *r_lnors_spacearr,
425  short (*clnors_data)[2],
426  int *r_loop_to_poly);
427 
428 void BKE_mesh_normals_loop_custom_set(const struct MVert *mverts,
429  const int numVerts,
430  struct MEdge *medges,
431  const int numEdges,
432  struct MLoop *mloops,
433  float (*r_custom_loopnors)[3],
434  const int numLoops,
435  struct MPoly *mpolys,
436  const float (*polynors)[3],
437  const int numPolys,
438  short (*r_clnors_data)[2]);
440  float (*r_custom_vertnors)[3],
441  const int numVerts,
442  struct MEdge *medges,
443  const int numEdges,
444  struct MLoop *mloops,
445  const int numLoops,
446  struct MPoly *mpolys,
447  const float (*polynors)[3],
448  const int numPolys,
449  short (*r_clnors_data)[2]);
450 
451 void BKE_mesh_normals_loop_to_vertex(const int numVerts,
452  const struct MLoop *mloops,
453  const int numLoops,
454  const float (*clnors)[3],
455  float (*r_vert_clnors)[3]);
456 
457 /* High-level custom normals functions. */
458 bool BKE_mesh_has_custom_loop_normals(struct Mesh *me);
459 
462  struct MLoopNorSpaceArray *r_lnors_spacearr);
463 
464 void BKE_mesh_set_custom_normals(struct Mesh *mesh, float (*r_custom_loopnors)[3]);
465 void BKE_mesh_set_custom_normals_from_vertices(struct Mesh *mesh, float (*r_custom_vertnors)[3]);
466 
467 void BKE_mesh_calc_poly_normal(const struct MPoly *mpoly,
468  const struct MLoop *loopstart,
469  const struct MVert *mvarray,
470  float r_no[3]);
471 void BKE_mesh_calc_poly_normal_coords(const struct MPoly *mpoly,
472  const struct MLoop *loopstart,
473  const float (*vertex_coords)[3],
474  float r_no[3]);
475 void BKE_mesh_calc_poly_center(const struct MPoly *mpoly,
476  const struct MLoop *loopstart,
477  const struct MVert *mvarray,
478  float r_cent[3]);
479 float BKE_mesh_calc_poly_area(const struct MPoly *mpoly,
480  const struct MLoop *loopstart,
481  const struct MVert *mvarray);
482 float BKE_mesh_calc_area(const struct Mesh *me);
483 float BKE_mesh_calc_poly_uv_area(const struct MPoly *mpoly, const struct MLoopUV *uv_array);
484 void BKE_mesh_calc_poly_angles(const struct MPoly *mpoly,
485  const struct MLoop *loopstart,
486  const struct MVert *mvarray,
487  float angles[]);
488 
490  const struct MPoly *mp,
491  const struct MLoop *mloop);
492 void BKE_mesh_poly_edgebitmap_insert(unsigned int *edge_bitmap,
493  const struct MPoly *mp,
494  const struct MLoop *mloop);
495 
496 bool BKE_mesh_center_median(const struct Mesh *me, float r_cent[3]);
497 bool BKE_mesh_center_median_from_polys(const struct Mesh *me, float r_cent[3]);
498 bool BKE_mesh_center_bounds(const struct Mesh *me, float r_cent[3]);
499 bool BKE_mesh_center_of_surface(const struct Mesh *me, float r_cent[3]);
500 bool BKE_mesh_center_of_volume(const struct Mesh *me, float r_cent[3]);
501 
502 void BKE_mesh_calc_volume(const struct MVert *mverts,
503  const int mverts_num,
504  const struct MLoopTri *mlooptri,
505  const int looptri_num,
506  const struct MLoop *mloop,
507  float *r_volume,
508  float r_center[3]);
509 
510 /* tessface */
512  struct CustomData *ldata,
513  struct CustomData *pdata,
514  unsigned int lindex[4],
515  int findex,
516  const int polyindex,
517  const int mf_len,
518  const int numUV,
519  const int numCol,
520  const bool hasPCol,
521  const bool hasOrigSpace,
522  const bool hasLNor);
523 void BKE_mesh_loops_to_tessdata(struct CustomData *fdata,
524  struct CustomData *ldata,
525  struct MFace *mface,
526  const int *polyindices,
527  unsigned int (*loopindices)[4],
528  const int num_faces);
530  struct CustomData *ldata,
531  struct MFace *mface,
532  const int *polyindices,
533  unsigned int (*loopindices)[4],
534  const int num_faces,
535  const char *layer_name);
536 int BKE_mesh_tessface_calc_ex(struct CustomData *fdata,
537  struct CustomData *ldata,
538  struct CustomData *pdata,
539  struct MVert *mvert,
540  int totface,
541  int totloop,
542  int totpoly,
543  const bool do_face_nor_copy);
544 void BKE_mesh_recalc_looptri(const struct MLoop *mloop,
545  const struct MPoly *mpoly,
546  const struct MVert *mvert,
547  int totloop,
548  int totpoly,
549  struct MLoopTri *mlooptri);
553  struct CustomData *fdata,
554  struct CustomData *ldata,
555  struct CustomData *pdata,
556  int totedge_i,
557  int totface_i,
558  int totloop_i,
559  int totpoly_i,
560  struct MEdge *medge,
561  struct MFace *mface,
562  int *r_totloop,
563  int *r_totpoly,
564  struct MLoop **r_mloop,
565  struct MPoly **r_mpoly);
566 
567 void BKE_mesh_mdisp_flip(struct MDisps *md, const bool use_loop_mdisp_flip);
568 
569 void BKE_mesh_polygon_flip_ex(struct MPoly *mpoly,
570  struct MLoop *mloop,
571  struct CustomData *ldata,
572  float (*lnors)[3],
573  struct MDisps *mdisp,
574  const bool use_loop_mdisp_flip);
575 void BKE_mesh_polygon_flip(struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata);
576 void BKE_mesh_polygons_flip(struct MPoly *mpoly,
577  struct MLoop *mloop,
578  struct CustomData *ldata,
579  int totpoly);
580 
581 /* merge verts */
582 /* Enum for merge_mode of CDDM_merge_verts.
583  * Refer to mesh.c for details. */
584 enum {
587 };
588 struct Mesh *BKE_mesh_merge_verts(struct Mesh *mesh,
589  const int *vtargetmap,
590  const int tot_vtargetmap,
591  const int merge_mode);
592 
593 /* flush flags */
595  const struct MLoop *mloop,
596  struct MEdge *medge,
597  const int totedge,
598  struct MPoly *mpoly,
599  const int totpoly);
600 void BKE_mesh_flush_hidden_from_verts(struct Mesh *me);
602  const struct MLoop *mloop,
603  struct MEdge *medge,
604  const int totedge,
605  const struct MPoly *mpoly,
606  const int totpoly);
607 void BKE_mesh_flush_hidden_from_polys(struct Mesh *me);
609  const int totvert,
610  const struct MLoop *mloop,
611  struct MEdge *medge,
612  const int totedge,
613  const struct MPoly *mpoly,
614  const int totpoly);
615 void BKE_mesh_flush_select_from_polys(struct Mesh *me);
617  const int totvert,
618  const struct MLoop *mloop,
619  struct MEdge *medge,
620  const int totedge,
621  struct MPoly *mpoly,
622  const int totpoly);
623 void BKE_mesh_flush_select_from_verts(struct Mesh *me);
624 
625 /* spatial evaluation */
627  const int totpoly,
628  const struct MLoop *mloop,
629  const int totvert,
630 
631  const float (*vert_cos_src)[3],
632  const float (*vert_cos_dst)[3],
633 
634  const float (*vert_cos_org)[3],
635  float (*vert_cos_new)[3]);
636 
637 /* *** mesh_validate.c *** */
638 
639 bool BKE_mesh_validate(struct Mesh *me, const bool do_verbose, const bool cddata_check_mask);
640 bool BKE_mesh_is_valid(struct Mesh *me);
642 
643 bool BKE_mesh_validate_arrays(struct Mesh *me,
644  struct MVert *mverts,
645  unsigned int totvert,
646  struct MEdge *medges,
647  unsigned int totedge,
648  struct MFace *mfaces,
649  unsigned int totface,
650  struct MLoop *mloops,
651  unsigned int totloop,
652  struct MPoly *mpolys,
653  unsigned int totpoly,
654  struct MDeformVert *dverts, /* assume totvert length */
655  const bool do_verbose,
656  const bool do_fixes,
657  bool *r_change);
658 
660  const uint totvert,
661  struct CustomData *edata,
662  const uint totedge,
663  struct CustomData *ldata,
664  const uint totloop,
665  struct CustomData *pdata,
666  const uint totpoly,
667  const bool check_meshmask,
668  const bool do_verbose,
669  const bool do_fixes,
670  bool *r_change);
671 
672 void BKE_mesh_strip_loose_faces(struct Mesh *me);
673 void BKE_mesh_strip_loose_polysloops(struct Mesh *me);
674 void BKE_mesh_strip_loose_edges(struct Mesh *me);
675 
676 void BKE_mesh_calc_edges_legacy(struct Mesh *me, const bool use_old);
677 void BKE_mesh_calc_edges_loose(struct Mesh *mesh);
678 void BKE_mesh_calc_edges(struct Mesh *mesh, bool keep_existing_edges, const bool select_new_edges);
680 
681 /* In DerivedMesh.cc */
682 void BKE_mesh_wrapper_deferred_finalize(struct Mesh *me_eval,
683  const CustomData_MeshMasks *cd_mask_finalize);
684 
685 /* **** Depsgraph evaluation **** */
686 
687 void BKE_mesh_eval_geometry(struct Depsgraph *depsgraph, struct Mesh *mesh);
688 
689 /* Draw Cache */
691 void BKE_mesh_batch_cache_free(struct Mesh *me);
692 
693 extern void (*BKE_mesh_batch_cache_dirty_tag_cb)(struct Mesh *me, eMeshBatchDirtyMode mode);
694 extern void (*BKE_mesh_batch_cache_free_cb)(struct Mesh *me);
695 
696 /* Inlines */
697 
698 /* Instead of -1 that function uses ORIGINDEX_NONE as defined in BKE_customdata.h,
699  * but I don't want to force every user of BKE_mesh.h to also include that file.
700  * ~~ Sybren */
701 BLI_INLINE int BKE_mesh_origindex_mface_mpoly(const int *index_mf_to_mpoly,
702  const int *index_mp_to_orig,
703  const int i)
704 {
705  const int j = index_mf_to_mpoly[i];
706  return (j != -1) ? (index_mp_to_orig ? index_mp_to_orig[j] : j) : -1;
707 }
708 
709 #ifdef __cplusplus
710 }
711 #endif
typedef float(TangentPoint)[2]
void BKE_mesh_free_data(struct Mesh *me)
Definition: mesh.c:796
void BKE_mesh_calc_normals_split_ex(struct Mesh *mesh, struct MLoopNorSpaceArray *r_lnors_spacearr)
Definition: mesh.c:1797
void BKE_mesh_normals_loop_custom_set(const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, float(*r_custom_loopnors)[3], const int numLoops, struct MPoly *mpolys, const float(*polynors)[3], const int numPolys, short(*r_clnors_data)[2])
void BKE_mesh_calc_edges_tessface(struct Mesh *mesh)
void BKE_mesh_normals_loop_to_vertex(const int numVerts, const struct MLoop *mloops, const int numLoops, const float(*clnors)[3], float(*r_vert_clnors)[3])
void(* BKE_mesh_batch_cache_dirty_tag_cb)(struct Mesh *me, eMeshBatchDirtyMode mode)
Definition: mesh_runtime.c:248
void BKE_mesh_strip_loose_faces(struct Mesh *me)
const char * BKE_mesh_cmp(struct Mesh *me1, struct Mesh *me2, float thresh)
Definition: mesh.c:598
int BKE_mesh_edge_other_vert(const struct MEdge *e, int v)
void BKE_mesh_assign_object(struct Main *bmain, struct Object *ob, struct Mesh *me)
Definition: mesh.c:1283
int poly_get_adj_loops_from_vert(const struct MPoly *poly, const struct MLoop *mloop, unsigned int vert, unsigned int r_adj[2])
bool BKE_mesh_material_index_used(struct Mesh *me, short index)
Definition: mesh.c:1326
float(* BKE_mesh_orco_verts_get(struct Object *ob))[3]
Definition: mesh.c:1162
struct Mesh * BKE_mesh_new_from_object_to_bmain(struct Main *bmain, struct Depsgraph *depsgraph, struct Object *object, bool preserve_all_data_layers)
void BKE_mesh_edges_set_draw_render(struct Mesh *me)
Definition: mesh_convert.c:983
MLoopNorSpace * BKE_lnor_space_create(MLoopNorSpaceArray *lnors_spacearr)
void BKE_mesh_calc_poly_angles(const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float angles[])
void BKE_mesh_tangent_loops_to_tessdata(struct CustomData *fdata, struct CustomData *ldata, struct MFace *mface, const int *polyindices, unsigned int(*loopindices)[4], const int num_faces, const char *layer_name)
void BKE_mesh_polygon_flip_ex(struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata, float(*lnors)[3], struct MDisps *mdisp, const bool use_loop_mdisp_flip)
void BKE_mesh_flush_select_from_verts(struct Mesh *me)
@ MLNOR_SPACE_IS_SINGLE
Definition: BKE_mesh.h:365
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)
bool BKE_mesh_clear_facemap_customdata(struct Mesh *me)
Definition: mesh.c:732
void BKE_mesh_tessface_clear(struct Mesh *mesh)
Definition: mesh.c:1567
void BKE_mesh_calc_normals_mapping_simple(struct Mesh *me)
Definition: mesh_evaluate.c:90
int BKE_mesh_nurbs_to_mdata(struct Object *ob, struct MVert **r_allvert, int *r_totvert, struct MEdge **r_alledge, int *r_totedge, struct MLoop **r_allloop, struct MPoly **r_allpoly, int *r_totloop, int *r_totpoly)
Definition: mesh_convert.c:216
void BKE_mesh_poly_edgebitmap_insert(unsigned int *edge_bitmap, const struct MPoly *mp, const struct MLoop *mloop)
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)
@ MLNOR_SPACEARR_LOOP_INDEX
Definition: BKE_mesh.h:383
@ MLNOR_SPACEARR_BMLOOP_PTR
Definition: BKE_mesh.h:384
bool BKE_mesh_has_custom_loop_normals(struct Mesh *me)
Definition: mesh.c:786
struct Mesh * BKE_mesh_new_nomain_from_template(const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
struct BoundBox * BKE_mesh_boundbox_get(struct Object *ob)
Definition: mesh.c:1055
struct Mesh * BKE_mesh_create_derived_for_modifier(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob_eval, struct ModifierData *md_eval, const bool build_shapekey_layers)
void BKE_mesh_do_versions_convert_mfaces_to_mpolys(struct Mesh *mesh)
struct Mesh * BKE_mesh_from_object(struct Object *ob)
Definition: mesh.c:1271
void BKE_mesh_poly_edgehash_insert(struct EdgeHash *ehash, const struct MPoly *mp, const struct MLoop *mloop)
void BKE_mesh_calc_poly_center(const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float r_cent[3])
void BKE_mesh_strip_loose_edges(struct Mesh *me)
void BKE_mesh_ensure_skin_customdata(struct Mesh *me)
Definition: mesh.c:681
bool BKE_mesh_validate_all_customdata(struct CustomData *vdata, const uint totvert, struct CustomData *edata, const uint totedge, struct CustomData *ldata, const uint totloop, struct CustomData *pdata, const uint totpoly, const bool check_meshmask, const bool do_verbose, const bool do_fixes, bool *r_change)
void BKE_mesh_ensure_normals(struct Mesh *me)
void BKE_mesh_nomain_to_mesh(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct Object *ob, const struct CustomData_MeshMasks *mask, bool take_ownership)
void BKE_pointcloud_to_mesh(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
bool BKE_mesh_center_of_volume(const struct Mesh *me, float r_cent[3])
void BKE_mesh_mselect_active_set(struct Mesh *me, int index, int type)
Definition: mesh.c:1705
void BKE_lnor_space_define(MLoopNorSpace *lnor_space, const float lnor[3], float vec_ref[3], float vec_other[3], struct BLI_Stack *edge_vectors)
void BKE_mesh_calc_normals_mapping(struct MVert *mverts, int numVerts, const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float(*r_polyNors)[3], const struct MFace *mfaces, int numFaces, const int *origIndexFace, float(*r_faceNors)[3])
void BKE_mesh_calc_edges_loose(struct Mesh *mesh)
void BKE_mesh_from_nurbs(struct Main *bmain, struct Object *ob)
Definition: mesh_convert.c:703
void BKE_mesh_mdisp_flip(struct MDisps *md, const bool use_loop_mdisp_flip)
void BKE_mesh_calc_edges_legacy(struct Mesh *me, const bool use_old)
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_mselect_validate(struct Mesh *me)
Definition: mesh.c:1617
void BKE_mesh_from_metaball(struct ListBase *lb, struct Mesh *me)
Definition: mesh_convert.c:77
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)
struct BMesh * BKE_mesh_to_bmesh_ex(const struct Mesh *me, const struct BMeshCreateParams *create_params, const struct BMeshFromMeshParams *convert_params)
struct Mesh * BKE_mesh_add(struct Main *bmain, const char *name)
Definition: mesh.c:849
bool BKE_mesh_is_valid(struct Mesh *me)
void BKE_mesh_calc_normals_mapping_ex(struct MVert *mverts, int numVerts, const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float(*r_polyNors)[3], const struct MFace *mfaces, int numFaces, const int *origIndexFace, float(*r_faceNors)[3], const bool only_face_normals)
void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float(*vert_coords)[3])
Definition: mesh.c:1755
void BKE_mesh_nomain_to_meshkey(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct KeyBlock *kb)
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
Definition: mesh.c:1560
void BKE_mesh_calc_normals_looptri(struct MVert *mverts, int numVerts, const struct MLoop *mloop, const struct MLoopTri *looptri, int looptri_num, float(*r_tri_nors)[3])
void BKE_mesh_to_pointcloud(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
bool BKE_mesh_center_median(const struct Mesh *me, float r_cent[3])
void BKE_mesh_looptri_get_real_edges(const struct Mesh *mesh, const struct MLoopTri *looptri, int r_edges[3])
bool BKE_mesh_center_median_from_polys(const struct Mesh *me, float r_cent[3])
bool BKE_mesh_ensure_facemap_customdata(struct Mesh *me)
Definition: mesh.c:713
int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr)
Definition: mesh.c:1203
int poly_find_loop_from_vert(const struct MPoly *poly, const struct MLoop *loopstart, uint vert)
struct Mesh * BKE_mesh_from_bmesh_nomain(struct BMesh *bm, const struct BMeshToMeshParams *params, const struct Mesh *me_settings)
void BKE_mesh_from_pointcloud(const struct PointCloud *pointcloud, struct Mesh *me)
struct Mesh * BKE_mesh_copy_for_eval(struct Mesh *source, bool reference)
Definition: mesh.c:995
void BKE_mesh_eval_delete(struct Mesh *mesh_eval)
Definition: mesh.c:986
void BKE_edges_sharp_from_angle_set(const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, const int numLoops, struct MPoly *mpolys, const float(*polynors)[3], const int numPolys, const float split_angle)
void BKE_lnor_spacearr_init(MLoopNorSpaceArray *lnors_spacearr, const int numLoops, const char data_type)
void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh)
void BKE_mesh_recalc_looptri(const struct MLoop *mloop, const struct MPoly *mpoly, const struct MVert *mvert, int totloop, int totpoly, struct MLoopTri *mlooptri)
void BKE_mesh_wrapper_deferred_finalize(struct Mesh *me_eval, const CustomData_MeshMasks *cd_mask_finalize)
Definition: DerivedMesh.cc:878
void BKE_lnor_spacearr_clear(MLoopNorSpaceArray *lnors_spacearr)
struct Mesh * BKE_mesh_new_nomain_from_curve_displist(struct Object *ob, struct ListBase *dispbase)
Definition: mesh_convert.c:526
void BKE_mesh_batch_cache_free(struct Mesh *me)
Definition: mesh_runtime.c:257
int BKE_mesh_mselect_active_get(struct Mesh *me, int type)
Definition: mesh.c:1693
void BKE_mesh_vert_coords_apply_with_mat4(struct Mesh *mesh, const float(*vert_coords)[3], const float mat[4][4])
Definition: mesh.c:1766
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
Definition: mesh.c:877
void BKE_mesh_texspace_copy_from_object(struct Mesh *me, struct Object *ob)
Definition: mesh.c:1150
void BKE_mesh_texspace_get_reference(struct Mesh *me, short **r_texflag, float **r_loc, float **r_size)
Definition: mesh.c:1135
struct Mesh * BKE_mesh_from_bmesh_for_eval_nomain(struct BMesh *bm, const struct CustomData_MeshMasks *cd_mask_extra, const struct Mesh *me_settings)
void BKE_mesh_normals_loop_custom_from_vertices_set(const struct MVert *mverts, float(*r_custom_vertnors)[3], const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, const int numLoops, struct MPoly *mpolys, const float(*polynors)[3], const int numPolys, short(*r_clnors_data)[2])
void BKE_mesh_calc_volume(const struct MVert *mverts, const int mverts_num, const struct MLoopTri *mlooptri, const int looptri_num, const struct MLoop *mloop, float *r_volume, float r_center[3])
bool BKE_mesh_validate_material_indices(struct Mesh *me)
struct MLoopNorSpace MLoopNorSpace
void BKE_mesh_to_curve_nurblist(const struct Mesh *me, struct ListBase *nurblist, const int edge_users_test)
int BKE_mesh_tessface_calc_ex(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, struct MVert *mvert, int totface, int totloop, int totpoly, const bool do_face_nor_copy)
void BKE_mesh_calc_normals(struct Mesh *me)
@ MESH_MERGE_VERTS_DUMP_IF_EQUAL
Definition: BKE_mesh.h:586
@ MESH_MERGE_VERTS_DUMP_IF_MAPPED
Definition: BKE_mesh.h:585
void BKE_mesh_calc_poly_normal(const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float r_no[3])
int BKE_mesh_mselect_find(struct Mesh *me, int index, int type)
Definition: mesh.c:1677
void BKE_mesh_batch_cache_dirty_tag(struct Mesh *me, eMeshBatchDirtyMode mode)
Definition: mesh_runtime.c:251
void BKE_mesh_do_versions_cd_flag_init(struct Mesh *mesh)
Definition: mesh.c:1572
void BKE_mesh_tessface_calc(struct Mesh *mesh)
Definition: mesh.c:1544
void BKE_mesh_clear_geometry(struct Mesh *me)
Definition: mesh.c:827
void BKE_mesh_calc_normals_split(struct Mesh *mesh)
Definition: mesh.c:1865
void BKE_mesh_orco_verts_transform(struct Mesh *me, float(*orco)[3], int totvert, int invert)
Definition: mesh.c:1179
bool BKE_mesh_center_of_surface(const struct Mesh *me, float r_cent[3])
void BKE_mesh_from_nurbs_displist(struct Main *bmain, struct Object *ob, struct ListBase *dispbase, const char *obdata_name, bool temporary)
Definition: mesh_convert.c:584
void BKE_mesh_count_selected_items(const struct Mesh *mesh, int r_count[3])
void BKE_mesh_vert_normals_apply(struct Mesh *mesh, const short(*vert_normals)[3])
Definition: mesh.c:1779
void BKE_mesh_strip_loose_polysloops(struct Mesh *me)
void BKE_mesh_loops_to_mface_corners(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, unsigned int lindex[4], int findex, const int polyindex, const int mf_len, const int numUV, const int numCol, const bool hasPCol, const bool hasOrigSpace, const bool hasLNor)
void BKE_mesh_vert_coords_get(const struct Mesh *mesh, float(*vert_coords)[3])
void BKE_mesh_smooth_flag_set(struct Mesh *me, const bool use_smooth)
Definition: mesh.c:1392
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])
void BKE_mesh_texspace_calc(struct Mesh *me)
Definition: mesh.c:1079
void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd)
Definition: mesh.c:766
struct BMesh * BKE_mesh_to_bmesh(struct Mesh *me, struct Object *ob, const bool add_key_index, const struct BMeshCreateParams *params)
Definition: mesh.c:1019
void BKE_mesh_calc_edges(struct Mesh *mesh, bool keep_existing_edges, const bool select_new_edges)
void BKE_mesh_loop_manifold_fan_around_vert_next(const struct MLoop *mloops, const struct MPoly *mpolys, const int *loop_to_poly, const int *e2lfan_curr, const uint mv_pivot_index, const struct MLoop **r_mlfan_curr, int *r_mlfan_curr_index, int *r_mlfan_vert_index, int *r_mpfan_curr_index)
void BKE_mesh_texspace_ensure(struct Mesh *me)
Definition: mesh.c:1116
void BKE_mesh_material_remap(struct Mesh *me, const unsigned int *remap, unsigned int remap_len)
Definition: mesh.c:1362
struct Mesh * BKE_mesh_merge_verts(struct Mesh *mesh, const int *vtargetmap, const int tot_vtargetmap, const int merge_mode)
Definition: mesh_merge.c:239
void BKE_mesh_flush_select_from_polys(struct Mesh *me)
struct Mesh * BKE_mesh_new_from_object(struct Depsgraph *depsgraph, struct Object *object, const bool preserve_all_data_layers, const bool preserve_origindex)
void BKE_mesh_normals_loop_split(const 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, const float(*polynors)[3], const int numPolys, const bool use_split_normals, const float split_angle, MLoopNorSpaceArray *r_lnors_spacearr, short(*clnors_data)[2], int *r_loop_to_poly)
void BKE_pointcloud_from_mesh(struct Mesh *me, struct PointCloud *pointcloud)
Definition: mesh_convert.c:909
int BKE_mesh_nurbs_displist_to_mdata(struct Object *ob, const struct ListBase *dispbase, struct MVert **r_allvert, int *r_totvert, struct MEdge **r_alledge, int *r_totedge, struct MLoop **r_allloop, struct MPoly **r_allpoly, struct MLoopUV **r_alluv, int *r_totloop, int *r_totpoly)
float BKE_mesh_calc_poly_uv_area(const struct MPoly *mpoly, const struct MLoopUV *uv_array)
void BKE_mesh_set_custom_normals_from_vertices(struct Mesh *mesh, float(*r_custom_vertnors)[3])
void BKE_mesh_mselect_clear(struct Mesh *me)
Definition: mesh.c:1608
BLI_INLINE int BKE_mesh_origindex_mface_mpoly(const int *index_mf_to_mpoly, const int *index_mp_to_orig, const int i)
Definition: BKE_mesh.h:701
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)
float BKE_mesh_calc_area(const struct Mesh *me)
void BKE_mesh_split_faces(struct Mesh *mesh, bool free_loop_normals)
Definition: mesh.c:2073
void BKE_lnor_spacearr_free(MLoopNorSpaceArray *lnors_spacearr)
void BKE_mesh_loops_to_tessdata(struct CustomData *fdata, struct CustomData *ldata, struct MFace *mface, const int *polyindices, unsigned int(*loopindices)[4], const int num_faces)
void BKE_lnor_space_custom_data_to_normal(MLoopNorSpace *lnor_space, const short clnor_data[2], float r_custom_lnor[3])
bool BKE_mesh_minmax(const struct Mesh *me, float r_min[3], float r_max[3])
void BKE_mesh_polygons_flip(struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata, int totpoly)
void BKE_mesh_set_custom_normals(struct Mesh *mesh, float(*r_custom_loopnors)[3])
struct Mesh * BKE_mesh_new_nomain_from_template_ex(const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len, struct CustomData_MeshMasks mask)
void BKE_mesh_copy_settings(struct Mesh *me_dst, const struct Mesh *me_src)
struct Mesh * BKE_mesh_new_nomain_from_curve(struct Object *ob)
Definition: mesh_convert.c:572
void BKE_mesh_texspace_get(struct Mesh *me, float r_loc[3], float r_size[3])
Definition: mesh.c:1123
void BKE_mesh_flush_hidden_from_verts(struct Mesh *me)
void BKE_mesh_to_curve(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
struct MLoopNorSpaceArray MLoopNorSpaceArray
float(* BKE_mesh_vert_coords_alloc(const struct Mesh *mesh, int *r_vert_len))[3]
void BKE_mesh_flush_hidden_from_polys(struct Mesh *me)
float BKE_mesh_calc_poly_area(const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray)
void BKE_mesh_ensure_normals_for_display(struct Mesh *mesh)
void BKE_mesh_material_index_remove(struct Mesh *me, short index)
Definition: mesh.c:1307
void BKE_mesh_calc_poly_normal_coords(const struct MPoly *mpoly, const struct MLoop *loopstart, const float(*vertex_coords)[3], float r_no[3])
bool BKE_mesh_center_bounds(const struct Mesh *me, float r_cent[3])
bool BKE_mesh_validate_arrays(struct Mesh *me, struct MVert *mverts, unsigned int totvert, struct MEdge *medges, unsigned int totedge, struct MFace *mfaces, unsigned int totface, struct MLoop *mloops, unsigned int totloop, struct MPoly *mpolys, unsigned int totpoly, struct MDeformVert *dverts, const bool do_verbose, const bool do_fixes, bool *r_change)
void BKE_mesh_transform(struct Mesh *me, const float mat[4][4], bool do_keys)
Definition: mesh.c:1485
void BKE_mesh_material_index_clear(struct Mesh *me)
Definition: mesh.c:1347
void BKE_mesh_polygon_flip(struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata)
void BKE_mesh_eval_geometry(struct Depsgraph *depsgraph, struct Mesh *mesh)
Definition: mesh.c:2146
bool BKE_mesh_validate(struct Mesh *me, const bool do_verbose, const bool cddata_check_mask)
void BKE_mesh_translate(struct Mesh *me, const float offset[3], const bool do_keys)
Definition: mesh.c:1522
void(* BKE_mesh_batch_cache_free_cb)(struct Mesh *me)
Definition: mesh_runtime.c:249
void BKE_mesh_calc_normals_poly(struct MVert *mverts, float(*r_vertnors)[3], int numVerts, const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float(*r_polyNors)[3], const bool only_face_normals)
void BKE_lnor_space_add_loop(MLoopNorSpaceArray *lnors_spacearr, MLoopNorSpace *lnor_space, const int ml_index, void *bm_loop, const bool is_single)
void BKE_lnor_space_custom_normal_to_data(MLoopNorSpace *lnor_space, const float custom_lnor[3], short r_clnor_data[2])
eMeshBatchDirtyMode
#define BLI_INLINE
unsigned int uint
Definition: BLI_sys_types.h:83
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
ATTR_WARN_UNUSED_RESULT BMesh * bm
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
size_t index
Definition: geometry.h:114
Scene scene
const Depsgraph * depsgraph
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
Definition: DNA_ID.h:273
struct LinkNode * loops_pool
Definition: BKE_mesh.h:373
struct MemArena * mem
Definition: BKE_mesh.h:377
MLoopNorSpace ** lspacearr
Definition: BKE_mesh.h:372
float ref_alpha
Definition: BKE_mesh.h:348
float vec_ortho[3]
Definition: BKE_mesh.h:346
float ref_beta
Definition: BKE_mesh.h:350
float vec_ref[3]
Definition: BKE_mesh.h:344
float vec_lnor[3]
Definition: BKE_mesh.h:342
void * user_data
Definition: BKE_mesh.h:359
struct LinkNode * loops
Definition: BKE_mesh.h:355
Definition: BKE_main.h:116
struct MEdge * medge
struct CustomData pdata ldata
struct MVert * mvert
struct Material ** mat
int totedge
int totvert
struct MLoop * mloop
int totface
int totpoly
int totloop
struct MFace * mface
struct MPoly * mpoly
ustring name
Definition: node.h:174
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
Definition: svm_invert.h:19
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)