Blender  V2.93
ED_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) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct ARegion;
31 struct BMBVHTree;
32 struct BMEdge;
33 struct BMEditMesh;
34 struct BMElem;
35 struct BMFace;
36 struct BMLoop;
37 struct BMVert;
38 struct BMesh;
39 struct Base;
40 struct Depsgraph;
41 struct ID;
42 struct MDeformVert;
43 struct Mesh;
44 struct Object;
45 struct ReportList;
46 struct Scene;
47 struct UndoType;
48 struct UvMapVert;
49 struct UvVertMap;
50 struct View3D;
51 struct ViewContext;
52 struct bContext;
53 struct bDeformGroup;
54 struct wmKeyConfig;
55 struct wmOperator;
56 
57 /* editmesh_utils.c */
59  const int axis,
60  const bool use_self,
61  const bool use_select,
62  const bool respecthide,
63  const bool use_topology,
64  float maxdist,
65  int *r_index);
67  const int axis,
68  const bool use_self,
69  const bool use_select,
70  const bool respecthide,
71  const bool use_topology);
72 void EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to);
73 struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v);
74 struct BMEdge *EDBM_verts_mirror_get_edge(struct BMEditMesh *em, struct BMEdge *e);
75 struct BMFace *EDBM_verts_mirror_get_face(struct BMEditMesh *em, struct BMFace *f);
76 void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v);
78 
79 void EDBM_mesh_normals_update(struct BMEditMesh *em);
80 void EDBM_mesh_clear(struct BMEditMesh *em);
81 
82 void EDBM_selectmode_to_scene(struct bContext *C);
83 void EDBM_mesh_make(struct Object *ob, const int select_mode, const bool add_key_index);
84 void EDBM_mesh_free(struct BMEditMesh *em);
85 void EDBM_mesh_load_ex(struct Main *bmain, struct Object *ob, bool free_data);
86 void EDBM_mesh_load(struct Main *bmain, struct Object *ob);
87 
88 /* flushes based on the current select mode. if in vertex select mode,
89  * verts select/deselect edges and faces, if in edge select mode,
90  * edges select/deselect faces and vertices, and in face select mode faces select/deselect
91  * edges and vertices.*/
92 void EDBM_select_more(struct BMEditMesh *em, const bool use_face_step);
93 void EDBM_select_less(struct BMEditMesh *em, const bool use_face_step);
94 
95 void EDBM_selectmode_flush_ex(struct BMEditMesh *em, const short selectmode);
96 void EDBM_selectmode_flush(struct BMEditMesh *em);
97 
98 void EDBM_deselect_flush(struct BMEditMesh *em);
99 void EDBM_select_flush(struct BMEditMesh *em);
100 
101 bool EDBM_vert_color_check(struct BMEditMesh *em);
102 
103 bool EDBM_mesh_hide(struct BMEditMesh *em, bool swap);
104 bool EDBM_mesh_reveal(struct BMEditMesh *em, bool select);
105 
106 void EDBM_update_generic(struct Mesh *me, const bool do_tessellation, const bool is_destructive);
107 
109  const struct Scene *scene,
110  const bool face_selected,
111  const bool uv_selected,
112  const bool use_winding,
113  const bool do_islands);
114 void BM_uv_element_map_free(struct UvElementMap *element_map);
115 struct UvElement *BM_uv_element_get(struct UvElementMap *map,
116  struct BMFace *efa,
117  struct BMLoop *l);
118 
119 bool EDBM_uv_check(struct BMEditMesh *em);
120 struct BMFace *EDBM_uv_active_face_get(struct BMEditMesh *em,
121  const bool sloppy,
122  const bool selected);
123 
124 void BM_uv_vert_map_free(struct UvVertMap *vmap);
125 struct UvMapVert *BM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int v);
126 struct UvVertMap *BM_uv_vert_map_create(struct BMesh *bm,
127  const bool use_select,
128  const bool use_winding);
129 
130 void EDBM_flag_enable_all(struct BMEditMesh *em, const char hflag);
131 void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag);
132 
133 bool BMBVH_EdgeVisible(struct BMBVHTree *tree,
134  struct BMEdge *e,
135  struct Depsgraph *depsgraph,
136  struct ARegion *region,
137  struct View3D *v3d,
138  struct Object *obedit);
139 
140 void EDBM_project_snap_verts(struct bContext *C,
141  struct Depsgraph *depsgraph,
142  struct ARegion *region,
143  struct Object *obedit,
144  struct BMEditMesh *em);
145 
146 /* editmesh_automerge.c */
147 void EDBM_automerge(struct Object *ob, bool update, const char hflag, const float dist);
149  const bool split_edges,
150  const bool split_faces,
151  const bool update,
152  const char hflag,
153  const float dist);
154 
155 /* editmesh_undo.c */
156 void ED_mesh_undosys_type(struct UndoType *ut);
157 
158 /* editmesh_select.c */
160  const struct Mesh *me,
161  const int axis,
162  const bool extend,
163  int *r_totmirr,
164  int *r_totfail);
165 
166 struct BMVert *EDBM_vert_find_nearest_ex(struct ViewContext *vc,
167  float *dist_px_manhattan_p,
168  const bool use_select_bias,
169  bool use_cycle,
170  struct Base **bases,
171  uint bases_len,
172  uint *r_base_index);
173 struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p);
174 
175 struct BMEdge *EDBM_edge_find_nearest_ex(struct ViewContext *vc,
176  float *dist_px_manhattan,
177  float *r_dist_center,
178  const bool use_select_bias,
179  bool use_cycle,
180  struct BMEdge **r_eed_zbuf,
181  struct Base **bases,
182  uint bases_len,
183  uint *r_base_index);
184 struct BMEdge *EDBM_edge_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p);
185 
186 struct BMFace *EDBM_face_find_nearest_ex(struct ViewContext *vc,
187  float *dist_px_manhattan,
188  float *r_dist_center,
189  const bool use_zbuf_single_px,
190  const bool use_select_bias,
191  bool use_cycle,
192  struct BMFace **r_efa_zbuf,
193  struct Base **bases,
194  uint bases_len,
195  uint *r_base_index);
196 struct BMFace *EDBM_face_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p);
197 
198 bool EDBM_unified_findnearest(struct ViewContext *vc,
199  struct Base **bases,
200  const uint bases_len,
201  int *r_base_index,
202  struct BMVert **r_eve,
203  struct BMEdge **r_eed,
204  struct BMFace **r_efa);
205 
207  struct Base **bases,
208  const uint bases_len,
209  bool use_boundary_vertices,
210  bool use_boundary_edges,
211  int *r_base_index_vert,
212  int *r_base_index_edge,
213  int *r_base_index_face,
214  struct BMVert **r_eve,
215  struct BMEdge **r_eed,
216  struct BMFace **r_efa);
217 
218 bool EDBM_select_pick(
219  struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
220 
221 void EDBM_selectmode_set(struct BMEditMesh *em);
222 void EDBM_selectmode_convert(struct BMEditMesh *em,
223  const short selectmode_old,
224  const short selectmode_new);
225 
226 /* user access this */
227 bool EDBM_selectmode_set_multi(struct bContext *C, const short selectmode);
229  const short selectmode_new,
230  const int action,
231  const bool use_extend,
232  const bool use_expand);
233 
234 bool EDBM_selectmode_disable(struct Scene *scene,
235  struct BMEditMesh *em,
236  const short selectmode_disable,
237  const short selectmode_fallback);
238 
239 bool EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const bool select);
240 
241 void EDBM_select_toggle_all(struct BMEditMesh *em);
242 
243 void EDBM_select_swap(struct BMEditMesh *em); /* exported for UV */
244 bool EDBM_select_interior_faces(struct BMEditMesh *em);
245 void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc); /* rename? */
246 
247 bool EDBM_mesh_deselect_all_multi_ex(struct Base **bases, const uint bases_len);
250  struct Base **bases,
251  const uint bases_len,
252  const short selectmode_disable,
253  const short selectmode_fallback);
255  const short selectmode_disable,
256  const short selectmode_fallback);
257 
258 /* editmesh_preselect_edgering.c */
263 void EDBM_preselect_edgering_draw(struct EditMesh_PreSelEdgeRing *psel, const float matrix[4][4]);
265  struct BMesh *bm,
266  struct BMEdge *eed_start,
267  int previewlines,
268  const float (*coords)[3]);
269 
270 /* editmesh_preselect_elem.c */
271 struct EditMesh_PreSelElem;
277 
282 void EDBM_preselect_elem_draw(struct EditMesh_PreSelElem *psel, const float matrix[4][4]);
284  struct BMesh *bm,
285  struct BMElem *ele,
286  const float (*coords)[3]);
287 
289  struct ViewContext *vc,
290  struct BMesh *bm,
291  struct BMElem *ele,
292  const int mval[2]);
296 /* mesh_ops.c */
297 void ED_operatortypes_mesh(void);
298 void ED_operatormacros_mesh(void);
299 void ED_keymap_mesh(struct wmKeyConfig *keyconf);
300 
301 /* editface.c */
302 void paintface_flush_flags(struct bContext *C, struct Object *ob, short flag);
303 bool paintface_mouse_select(struct bContext *C,
304  struct Object *ob,
305  const int mval[2],
306  bool extend,
307  bool deselect,
308  bool toggle);
310  struct Object *ob,
311  int action,
312  bool flush_flags);
313 void paintface_select_linked(struct bContext *C,
314  struct Object *ob,
315  const int mval[2],
316  const bool select);
317 bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]);
318 
319 void paintface_hide(struct bContext *C, struct Object *ob, const bool unselected);
320 void paintface_reveal(struct bContext *C, struct Object *ob, const bool select);
321 
322 bool paintvert_deselect_all_visible(struct Object *ob, int action, bool flush_flags);
323 void paintvert_select_ungrouped(struct Object *ob, bool extend, bool flush_flags);
324 void paintvert_flush_flags(struct Object *ob);
325 void paintvert_tag_select_update(struct bContext *C, struct Object *ob);
326 
327 /* mirrtopo */
328 typedef struct MirrTopoStore_t {
334 
336  struct Mesh *me,
338 void ED_mesh_mirrtopo_init(struct BMEditMesh *em,
339  struct Mesh *me,
341  const bool skip_em_vert_array_init);
343 
344 /* object_vgroup.c */
345 #define WEIGHT_REPLACE 1
346 #define WEIGHT_ADD 2
347 #define WEIGHT_SUBTRACT 3
348 
349 bool ED_vgroup_sync_from_pose(struct Object *ob);
350 void ED_vgroup_select_by_name(struct Object *ob, const char *name);
351 void ED_vgroup_data_clamp_range(struct ID *id, const int total);
352 bool ED_vgroup_array_copy(struct Object *ob, struct Object *ob_from);
353 bool ED_vgroup_parray_alloc(struct ID *id,
354  struct MDeformVert ***dvert_arr,
355  int *dvert_tot,
356  const bool use_vert_sel);
357 void ED_vgroup_parray_mirror_sync(struct Object *ob,
358  struct MDeformVert **dvert_array,
359  const int dvert_tot,
360  const bool *vgroup_validmap,
361  const int vgroup_tot);
362 void ED_vgroup_parray_mirror_assign(struct Object *ob,
363  struct MDeformVert **dvert_array,
364  const int dvert_tot);
365 void ED_vgroup_parray_remove_zero(struct MDeformVert **dvert_array,
366  const int dvert_tot,
367  const bool *vgroup_validmap,
368  const int vgroup_tot,
369  const float epsilon,
370  const bool keep_single);
371 void ED_vgroup_parray_to_weight_array(const struct MDeformVert **dvert_array,
372  const int dvert_tot,
373  float *dvert_weights,
374  const int def_nr);
375 void ED_vgroup_parray_from_weight_array(struct MDeformVert **dvert_array,
376  const int dvert_tot,
377  const float *dvert_weights,
378  const int def_nr,
379  const bool remove_zero);
380 void ED_vgroup_mirror(struct Object *ob,
381  const bool mirror_weights,
382  const bool flip_vgroups,
383  const bool all_vgroups,
384  const bool use_topology,
385  int *r_totmirr,
386  int *r_totfail);
387 
388 void ED_vgroup_vert_add(
389  struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode);
390 void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum);
391 float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum);
392 void ED_vgroup_vert_active_mirror(struct Object *ob, int def_nr);
393 
394 /* mesh_data.c */
395 void ED_mesh_verts_add(struct Mesh *mesh, struct ReportList *reports, int count);
396 void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count);
397 void ED_mesh_loops_add(struct Mesh *mesh, struct ReportList *reports, int count);
398 void ED_mesh_polys_add(struct Mesh *mesh, struct ReportList *reports, int count);
399 
400 void ED_mesh_verts_remove(struct Mesh *mesh, struct ReportList *reports, int count);
401 void ED_mesh_edges_remove(struct Mesh *mesh, struct ReportList *reports, int count);
402 void ED_mesh_loops_remove(struct Mesh *mesh, struct ReportList *reports, int count);
403 void ED_mesh_polys_remove(struct Mesh *mesh, struct ReportList *reports, int count);
404 
405 void ED_mesh_geometry_clear(struct Mesh *mesh);
406 
407 void ED_mesh_update(struct Mesh *mesh, struct bContext *C, bool calc_edges, bool calc_edges_loose);
408 
409 void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name);
410 int ED_mesh_uv_texture_add(struct Mesh *me,
411  const char *name,
412  const bool active_set,
413  const bool do_init);
414 bool ED_mesh_uv_texture_remove_index(struct Mesh *me, const int n);
415 bool ED_mesh_uv_texture_remove_active(struct Mesh *me);
416 bool ED_mesh_uv_texture_remove_named(struct Mesh *me, const char *name);
417 void ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me);
418 void ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum);
419 bool ED_mesh_color_ensure(struct Mesh *me, const char *name);
420 int ED_mesh_color_add(struct Mesh *me,
421  const char *name,
422  const bool active_set,
423  const bool do_init);
424 bool ED_mesh_color_remove_index(struct Mesh *me, const int n);
425 bool ED_mesh_color_remove_active(struct Mesh *me);
426 bool ED_mesh_color_remove_named(struct Mesh *me, const char *name);
427 
428 bool ED_mesh_sculpt_color_ensure(struct Mesh *me, const char *name);
429 int ED_mesh_sculpt_color_add(struct Mesh *me,
430  const char *name,
431  const bool active_set,
432  const bool do_init);
433 bool ED_mesh_sculpt_color_remove_index(struct Mesh *me, const int n);
435 bool ED_mesh_sculpt_color_remove_named(struct Mesh *me, const char *name);
436 
437 void ED_mesh_report_mirror(struct wmOperator *op, int totmirr, int totfail);
438 void ED_mesh_report_mirror_ex(struct wmOperator *op, int totmirr, int totfail, char selectmode);
439 
440 /* Returns the pinned mesh, the mesh from the pinned object, or the mesh from the active object. */
441 struct Mesh *ED_mesh_context(struct bContext *C);
442 
443 /* mesh backup */
444 typedef struct BMBackup {
445  struct BMesh *bmcopy;
447 
448 /* save a copy of the bmesh for restoring later */
449 struct BMBackup EDBM_redo_state_store(struct BMEditMesh *em);
450 /* restore a bmesh from backup */
451 void EDBM_redo_state_restore(struct BMBackup, struct BMEditMesh *em, int recalctess);
452 /* delete the backup, optionally flushing it to an editmesh */
453 void EDBM_redo_state_free(struct BMBackup *, struct BMEditMesh *em, int recalctess);
454 
455 /* *** meshtools.c *** */
456 int ED_mesh_join_objects_exec(struct bContext *C, struct wmOperator *op);
457 int ED_mesh_shapes_join_objects_exec(struct bContext *C, struct wmOperator *op);
458 
459 /* mirror lookup api */
460 /* Spatial Mirror */
462  struct BMEditMesh *em,
463  struct Mesh *me_eval);
466  struct BMEditMesh *em,
467  struct Mesh *me_eval,
468  const float co[3]);
469 
470 /* Topology Mirror */
471 void ED_mesh_mirror_topo_table_begin(struct Object *ob, struct Mesh *me_eval);
473 
474 /* retrieves mirrored cache vert, or NULL if there isn't one.
475  * note: calling this without ensuring the mirror cache state
476  * is bad.*/
477 int mesh_get_x_mirror_vert(struct Object *ob,
478  struct Mesh *me_eval,
479  int index,
480  const bool use_topology);
481 struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob,
482  struct BMEditMesh *em,
483  struct BMVert *eve,
484  const float co[3],
485  int index,
486  const bool use_topology);
487 int *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em, struct Mesh *me_eval);
488 
489 int ED_mesh_mirror_get_vert(struct Object *ob, int index);
490 
491 bool ED_mesh_pick_vert(struct bContext *C,
492  struct Object *ob,
493  const int mval[2],
494  uint dist_px,
495  bool use_zbuf,
496  uint *r_index);
497 bool ED_mesh_pick_face(
498  struct bContext *C, struct Object *ob, const int mval[2], uint dist_px, uint *r_index);
500  struct bContext *C, struct Object *ob, const int mval[2], uint dist_px, uint *r_index);
501 
502 struct MDeformVert *ED_mesh_active_dvert_get_em(struct Object *ob, struct BMVert **r_eve);
503 struct MDeformVert *ED_mesh_active_dvert_get_ob(struct Object *ob, int *r_index);
505 
506 void EDBM_mesh_stats_multi(struct Object **objects,
507  const uint objects_len,
508  int totelem[3],
509  int totelem_sel[3]);
510 void EDBM_mesh_elem_index_ensure_multi(struct Object **objects,
511  const uint objects_len,
512  const char htype);
513 
514 #define ED_MESH_PICK_DEFAULT_VERT_DIST 25
515 #define ED_MESH_PICK_DEFAULT_FACE_DIST 1
516 
517 #define USE_LOOPSLIDE_HACK
518 
519 #ifdef __cplusplus
520 }
521 #endif
unsigned int uint
Definition: BLI_sys_types.h:83
void swap(T &a, T &b)
Definition: Common.h:33
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void EDBM_selectmode_to_scene(struct bContext *C)
void EDBM_redo_state_free(struct BMBackup *, struct BMEditMesh *em, int recalctess)
bool ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int mval[2], uint dist_px, uint *r_index)
Definition: meshtools.c:1281
bool EDBM_select_interior_faces(struct BMEditMesh *em)
void ED_mesh_undosys_type(struct UndoType *ut)
bool ED_mesh_sculpt_color_remove_named(struct Mesh *me, const char *name)
Definition: mesh_data.c:582
void EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to)
bool EDBM_mesh_deselect_all_multi_ex(struct Base **bases, const uint bases_len)
void EDBM_mesh_load(struct Main *bmain, struct Object *ob)
void EDBM_preselect_elem_update_preview(struct EditMesh_PreSelElem *psel, struct ViewContext *vc, struct BMesh *bm, struct BMElem *ele, const int mval[2])
void EDBM_preselect_elem_destroy(struct EditMesh_PreSelElem *psel)
void EDBM_mesh_clear(struct BMEditMesh *em)
bool ED_mesh_color_remove_active(struct Mesh *me)
Definition: mesh_data.c:466
void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v)
void ED_mesh_mirror_topo_table_end(struct Object *ob)
void EDBM_mesh_make(struct Object *ob, const int select_mode, const bool add_key_index)
bool paintvert_deselect_all_visible(struct Object *ob, int action, bool flush_flags)
Definition: editface.c:499
void paintface_hide(struct bContext *C, struct Object *ob, const bool unselected)
Definition: editface.c:132
void ED_operatortypes_mesh(void)
Definition: mesh_ops.c:38
void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode)
struct BMVert * EDBM_vert_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p)
bool EDBM_selectmode_set_multi(struct bContext *C, const short selectmode)
struct MirrTopoStore_t MirrTopoStore_t
void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], const bool select)
Definition: editface.c:266
void EDBM_selectmode_flush_ex(struct BMEditMesh *em, const short selectmode)
void EDBM_preselect_elem_draw(struct EditMesh_PreSelElem *psel, const float matrix[4][4])
void EDBM_select_more(struct BMEditMesh *em, const bool use_face_step)
void ED_keymap_mesh(struct wmKeyConfig *keyconf)
Definition: mesh_ops.c:376
void ED_mesh_verts_remove(struct Mesh *mesh, struct ReportList *reports, int count)
Definition: mesh_data.c:1266
void EDBM_preselect_edgering_destroy(struct EditMesh_PreSelEdgeRing *psel)
void EDBM_automerge_and_split(struct Object *ob, const bool split_edges, const bool split_faces, const bool update, const char hflag, const float dist)
bool EDBM_unified_findnearest_from_raycast(struct ViewContext *vc, struct Base **bases, const uint bases_len, bool use_boundary_vertices, bool use_boundary_edges, int *r_base_index_vert, int *r_base_index_edge, int *r_base_index_face, struct BMVert **r_eve, struct BMEdge **r_eed, struct BMFace **r_efa)
struct BMFace * EDBM_uv_active_face_get(struct BMEditMesh *em, const bool sloppy, const bool selected)
void EDBM_selectmode_convert(struct BMEditMesh *em, const short selectmode_old, const short selectmode_new)
struct UvElement * BM_uv_element_get(struct UvElementMap *map, struct BMFace *efa, struct BMLoop *l)
struct MDeformVert * ED_mesh_active_dvert_get_ob(struct Object *ob, int *r_index)
Definition: meshtools.c:1499
void EDBM_mesh_elem_index_ensure_multi(struct Object **objects, const uint objects_len, const char htype)
Definition: meshtools.c:1556
eEditMesh_PreSelPreviewAction
Definition: ED_mesh.h:272
@ PRESELECT_ACTION_CREATE
Definition: ED_mesh.h:274
@ PRESELECT_ACTION_DELETE
Definition: ED_mesh.h:275
@ PRESELECT_ACTION_TRANSFORM
Definition: ED_mesh.h:273
struct UvElementMap * BM_uv_element_map_create(struct BMesh *bm, const struct Scene *scene, const bool face_selected, const bool uv_selected, const bool use_winding, const bool do_islands)
int ED_mesh_color_add(struct Mesh *me, const char *name, const bool active_set, const bool do_init)
Definition: mesh_data.c:382
void EDBM_preselect_edgering_clear(struct EditMesh_PreSelEdgeRing *psel)
int mesh_get_x_mirror_vert(struct Object *ob, struct Mesh *me_eval, int index, const bool use_topology)
Definition: meshtools.c:932
void EDBM_preselect_action_set(struct EditMesh_PreSelElem *psel, eEditMesh_PreSelPreviewAction action)
void ED_mesh_geometry_clear(struct Mesh *mesh)
Definition: mesh_data.c:1322
bool paintface_deselect_all_visible(struct bContext *C, struct Object *ob, int action, bool flush_flags)
Definition: editface.c:287
void ED_mesh_verts_add(struct Mesh *mesh, struct ReportList *reports, int count)
Definition: mesh_data.c:1184
struct BMFace * EDBM_verts_mirror_get_face(struct BMEditMesh *em, struct BMFace *f)
void EDBM_project_snap_verts(struct bContext *C, struct Depsgraph *depsgraph, struct ARegion *region, struct Object *obedit, struct BMEditMesh *em)
bool EDBM_selectmode_toggle_multi(struct bContext *C, const short selectmode_new, const int action, const bool use_extend, const bool use_expand)
bool ED_mesh_sculpt_color_remove_active(struct Mesh *me)
Definition: mesh_data.c:573
void EDBM_select_mirrored(struct BMEditMesh *em, const struct Mesh *me, const int axis, const bool extend, int *r_totmirr, int *r_totfail)
void ED_mesh_polys_remove(struct Mesh *mesh, struct ReportList *reports, int count)
Definition: mesh_data.c:1308
void ED_mesh_mirror_topo_table_begin(struct Object *ob, struct Mesh *me_eval)
Definition: meshtools.c:879
void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count)
Definition: mesh_data.c:1193
void ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum)
Definition: mesh_data.c:212
bool EDBM_selectmode_disable_multi_ex(struct Scene *scene, struct Base **bases, const uint bases_len, const short selectmode_disable, const short selectmode_fallback)
void ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
Definition: mesh_data.c:246
void EDBM_mesh_load_ex(struct Main *bmain, struct Object *ob, bool free_data)
bool paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], bool extend, bool deselect, bool toggle)
Definition: editface.c:385
bool ED_mesh_mirrtopo_recalc_check(struct BMEditMesh *em, struct Mesh *me, MirrTopoStore_t *mesh_topo_store)
struct BMEdge * EDBM_edge_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p)
eEditMesh_PreSelPreviewAction EDBM_preselect_action_get(struct EditMesh_PreSelElem *psel)
void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc)
void ED_mesh_mirrtopo_init(struct BMEditMesh *em, struct Mesh *me, MirrTopoStore_t *mesh_topo_store, const bool skip_em_vert_array_init)
bool EDBM_selectmode_disable(struct Scene *scene, struct BMEditMesh *em, const short selectmode_disable, const short selectmode_fallback)
bool EDBM_selectmode_disable_multi(struct bContext *C, const short selectmode_disable, const short selectmode_fallback)
bool EDBM_mesh_hide(struct BMEditMesh *em, bool swap)
int * mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em, struct Mesh *me_eval)
Definition: meshtools.c:1144
bool ED_vgroup_sync_from_pose(struct Object *ob)
bool ED_mesh_color_remove_index(struct Mesh *me, const int n)
Definition: mesh_data.c:447
struct BMBackup EDBM_redo_state_store(struct BMEditMesh *em)
struct BMVert * editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, const float co[3], int index, const bool use_topology)
Definition: meshtools.c:996
struct BMBackup BMBackup
struct MDeformVert * ED_mesh_active_dvert_get_em(struct Object *ob, struct BMVert **r_eve)
Definition: meshtools.c:1474
bool ED_mesh_uv_texture_remove_named(struct Mesh *me, const char *name)
Definition: mesh_data.c:370
struct UvMapVert * BM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int v)
struct Mesh * ED_mesh_context(struct bContext *C)
Definition: mesh_data.c:1360
void EDBM_automerge(struct Object *ob, bool update, const char hflag, const float dist)
struct BMFace * EDBM_face_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p)
void EDBM_mesh_free(struct BMEditMesh *em)
void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name)
Definition: mesh_data.c:318
void ED_mesh_loops_remove(struct Mesh *mesh, struct ReportList *reports, int count)
Definition: mesh_data.c:1294
void ED_mesh_loops_add(struct Mesh *mesh, struct ReportList *reports, int count)
Definition: mesh_data.c:1202
void paintface_flush_flags(struct bContext *C, struct Object *ob, short flag)
Definition: editface.c:55
void paintvert_flush_flags(struct Object *ob)
Definition: editface.c:443
bool ED_mesh_uv_texture_remove_index(struct Mesh *me, const int n)
Definition: mesh_data.c:339
int ED_mesh_shapes_join_objects_exec(struct bContext *C, struct wmOperator *op)
Definition: meshtools.c:757
void EDBM_flag_enable_all(struct BMEditMesh *em, const char hflag)
void ED_mesh_polys_add(struct Mesh *mesh, struct ReportList *reports, int count)
Definition: mesh_data.c:1211
void EDBM_preselect_elem_clear(struct EditMesh_PreSelElem *psel)
void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store)
void EDBM_select_flush(struct BMEditMesh *em)
bool ED_mesh_color_remove_named(struct Mesh *me, const char *name)
Definition: mesh_data.c:475
void EDBM_select_less(struct BMEditMesh *em, const bool use_face_step)
bool EDBM_unified_findnearest(struct ViewContext *vc, struct Base **bases, const uint bases_len, int *r_base_index, struct BMVert **r_eve, struct BMEdge **r_eed, struct BMFace **r_efa)
bool ED_mesh_uv_texture_remove_active(struct Mesh *me)
Definition: mesh_data.c:359
float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum)
struct EditMesh_PreSelEdgeRing * EDBM_preselect_edgering_create(void)
struct BMVert * EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v)
void ED_mesh_edges_remove(struct Mesh *mesh, struct ReportList *reports, int count)
Definition: mesh_data.c:1280
void ED_vgroup_parray_mirror_assign(struct Object *ob, struct MDeformVert **dvert_array, const int dvert_tot)
bool EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const bool select)
void EDBM_preselect_elem_update_from_single(struct EditMesh_PreSelElem *psel, struct BMesh *bm, struct BMElem *ele, const float(*coords)[3])
void EDBM_verts_mirror_cache_end(struct BMEditMesh *em)
bool ED_mesh_color_ensure(struct Mesh *me, const char *name)
Definition: mesh_data.c:433
void ED_mesh_report_mirror(struct wmOperator *op, int totmirr, int totfail)
Definition: mesh_data.c:1355
void ED_vgroup_data_clamp_range(struct ID *id, const int total)
struct UvVertMap * BM_uv_vert_map_create(struct BMesh *bm, const bool use_select, const bool use_winding)
struct MDeformVert * ED_mesh_active_dvert_get_only(struct Object *ob)
Definition: meshtools.c:1512
bool ED_vgroup_array_copy(struct Object *ob, struct Object *ob_from)
void ED_vgroup_select_by_name(struct Object *ob, const char *name)
int ED_mesh_join_objects_exec(struct bContext *C, struct wmOperator *op)
Definition: meshtools.c:331
void EDBM_selectmode_set(struct BMEditMesh *em)
bool ED_mesh_pick_face(struct bContext *C, struct Object *ob, const int mval[2], uint dist_px, uint *r_index)
Definition: meshtools.c:1215
void EDBM_update_generic(struct Mesh *me, const bool do_tessellation, const bool is_destructive)
void ED_mesh_update(struct Mesh *mesh, struct bContext *C, bool calc_edges, bool calc_edges_loose)
Definition: mesh_data.c:1038
void ED_vgroup_parray_to_weight_array(const struct MDeformVert **dvert_array, const int dvert_tot, float *dvert_weights, const int def_nr)
void ED_vgroup_parray_mirror_sync(struct Object *ob, struct MDeformVert **dvert_array, const int dvert_tot, const bool *vgroup_validmap, const int vgroup_tot)
void EDBM_verts_mirror_cache_begin_ex(struct BMEditMesh *em, const int axis, const bool use_self, const bool use_select, const bool respecthide, const bool use_topology, float maxdist, int *r_index)
void EDBM_select_toggle_all(struct BMEditMesh *em)
int ED_mesh_mirror_get_vert(struct Object *ob, int index)
Definition: meshtools.c:1014
void EDBM_deselect_flush(struct BMEditMesh *em)
void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const int axis, const bool use_self, const bool use_select, const bool respecthide, const bool use_topology)
void EDBM_preselect_preview_clear(struct EditMesh_PreSelElem *psel)
void EDBM_select_swap(struct BMEditMesh *em)
void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum)
bool EDBM_mesh_reveal(struct BMEditMesh *em, bool select)
struct BMFace * EDBM_face_find_nearest_ex(struct ViewContext *vc, float *dist_px_manhattan, float *r_dist_center, const bool use_zbuf_single_px, const bool use_select_bias, bool use_cycle, struct BMFace **r_efa_zbuf, struct Base **bases, uint bases_len, uint *r_base_index)
void ED_mesh_mirror_spatial_table_begin(struct Object *ob, struct BMEditMesh *em, struct Mesh *me_eval)
void ED_vgroup_parray_from_weight_array(struct MDeformVert **dvert_array, const int dvert_tot, const float *dvert_weights, const int def_nr, const bool remove_zero)
struct BMEdge * EDBM_edge_find_nearest_ex(struct ViewContext *vc, float *dist_px_manhattan, float *r_dist_center, const bool use_select_bias, bool use_cycle, struct BMEdge **r_eed_zbuf, struct Base **bases, uint bases_len, uint *r_base_index)
void EDBM_preselect_edgering_draw(struct EditMesh_PreSelEdgeRing *psel, const float matrix[4][4])
bool ED_mesh_sculpt_color_ensure(struct Mesh *me, const char *name)
Definition: mesh_data.c:540
int ED_mesh_sculpt_color_add(struct Mesh *me, const char *name, const bool active_set, const bool do_init)
Definition: mesh_data.c:488
void ED_mesh_report_mirror_ex(struct wmOperator *op, int totmirr, int totfail, char selectmode)
Definition: mesh_data.c:1332
struct BMEdge * EDBM_verts_mirror_get_edge(struct BMEditMesh *em, struct BMEdge *e)
bool BMBVH_EdgeVisible(struct BMBVHTree *tree, struct BMEdge *e, struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obedit)
bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3])
Definition: editface.c:348
bool ED_mesh_pick_vert(struct bContext *C, struct Object *ob, const int mval[2], uint dist_px, bool use_zbuf, uint *r_index)
Definition: meshtools.c:1401
bool ED_vgroup_parray_alloc(struct ID *id, struct MDeformVert ***dvert_arr, int *dvert_tot, const bool use_vert_sel)
void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag)
int ED_mesh_uv_texture_add(struct Mesh *me, const char *name, const bool active_set, const bool do_init)
Definition: mesh_data.c:257
bool EDBM_mesh_deselect_all_multi(struct bContext *C)
bool EDBM_uv_check(struct BMEditMesh *em)
struct EditMesh_PreSelElem * EDBM_preselect_elem_create(void)
void ED_mesh_mirror_spatial_table_end(struct Object *ob)
int ED_mesh_mirror_spatial_table_lookup(struct Object *ob, struct BMEditMesh *em, struct Mesh *me_eval, const float co[3])
void ED_vgroup_mirror(struct Object *ob, const bool mirror_weights, const bool flip_vgroups, const bool all_vgroups, const bool use_topology, int *r_totmirr, int *r_totfail)
struct BMVert * EDBM_vert_find_nearest_ex(struct ViewContext *vc, float *dist_px_manhattan_p, const bool use_select_bias, bool use_cycle, struct Base **bases, uint bases_len, uint *r_base_index)
void EDBM_redo_state_restore(struct BMBackup, struct BMEditMesh *em, int recalctess)
void ED_operatormacros_mesh(void)
Definition: mesh_ops.c:224
void BM_uv_element_map_free(struct UvElementMap *element_map)
bool EDBM_vert_color_check(struct BMEditMesh *em)
void paintvert_tag_select_update(struct bContext *C, struct Object *ob)
Definition: editface.c:489
void paintvert_select_ungrouped(struct Object *ob, bool extend, bool flush_flags)
Definition: editface.c:570
void EDBM_preselect_edgering_update_from_edge(struct EditMesh_PreSelEdgeRing *psel, struct BMesh *bm, struct BMEdge *eed_start, int previewlines, const float(*coords)[3])
bool ED_mesh_sculpt_color_remove_index(struct Mesh *me, const int n)
Definition: mesh_data.c:554
bool EDBM_select_pick(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
void ED_vgroup_vert_active_mirror(struct Object *ob, int def_nr)
void EDBM_selectmode_flush(struct BMEditMesh *em)
void EDBM_mesh_normals_update(struct BMEditMesh *em)
void BM_uv_vert_map_free(struct UvVertMap *vmap)
void ED_vgroup_parray_remove_zero(struct MDeformVert **dvert_array, const int dvert_tot, const bool *vgroup_validmap, const int vgroup_tot, const float epsilon, const bool keep_single)
void EDBM_mesh_stats_multi(struct Object **objects, const uint objects_len, int totelem[3], int totelem_sel[3])
Definition: meshtools.c:1523
void paintface_reveal(struct bContext *C, struct Object *ob, const bool select)
Definition: editface.c:164
#define C
Definition: RandGen.cpp:39
ATTR_WARN_UNUSED_RESULT BMesh * bm
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
Scene scene
const Depsgraph * depsgraph
void * tree
int count
static MirrTopoStore_t mesh_topo_store
Definition: meshtools.c:848
static double epsilon
static void update(bNodeTree *ntree)
_W64 int intptr_t
Definition: stdint.h:121
struct BMesh * bmcopy
Definition: ED_mesh.h:445
float co[3]
Definition: bmesh_class.h:99
Definition: DNA_ID.h:273
Definition: BKE_main.h:116
intptr_t * index_lookup
Definition: ED_mesh.h:329
int prev_edge_tot
Definition: ED_mesh.h:331
int prev_vert_tot
Definition: ED_mesh.h:330
bool prev_is_editmode
Definition: ED_mesh.h:332
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: util_avxb.h:167