Blender  V2.93
mesh_intern.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 
24 /* Internal for editmesh_xxxx.c functions */
25 
26 #pragma once
27 
28 struct BMEditMesh;
29 struct BMElem;
30 struct BMOperator;
31 struct EnumPropertyItem;
32 struct LinkNode;
33 struct bContext;
34 struct wmKeyConfig;
35 struct wmKeyMap;
36 struct wmOperator;
37 struct wmOperatorType;
38 
39 /* *** editmesh_utils.c *** */
40 
41 /*
42  * ok: the EDBM module is for editmode bmesh stuff. in contrast, the
43  * BMEdit module is for code shared with blenkernel that concerns
44  * the BMEditMesh structure. */
45 
46 /* Calls a bmesh op, reporting errors to the user, etc */
47 bool EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
48 bool EDBM_op_call_and_selectf(struct BMEditMesh *em,
49  struct wmOperator *op,
50  const char *select_slot,
51  const bool select_replace,
52  const char *fmt,
53  ...);
54 /* Same as above, but doesn't report errors.*/
55 bool EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...);
56 
57 /* these next two functions are the split version of EDBM_op_callf, so you can
58  * do stuff with a bmesh operator, after initializing it but before executing
59  * it.
60  *
61  * execute the operator with BM_Exec_Op */
62 bool EDBM_op_init(
63  struct BMEditMesh *em, struct BMOperator *bmop, struct wmOperator *op, const char *fmt, ...);
64 /* Cleans up after a bmesh operator */
65 bool EDBM_op_finish(struct BMEditMesh *em,
66  struct BMOperator *bmop,
67  struct wmOperator *op,
68  const bool do_report);
69 
70 void EDBM_stats_update(struct BMEditMesh *em);
71 
72 bool EDBM_view3d_poll(struct bContext *C);
73 
75  struct BMVert *eve,
76  struct BMEdge *eed,
77  struct BMFace *efa);
78 
79 int EDBM_elem_to_index_any(struct BMEditMesh *em, struct BMElem *ele);
80 struct BMElem *EDBM_elem_from_index_any(struct BMEditMesh *em, int index);
81 
82 int EDBM_elem_to_index_any_multi(struct ViewLayer *view_layer,
83  struct BMEditMesh *em,
84  struct BMElem *ele,
85  int *r_object_index);
86 struct BMElem *EDBM_elem_from_index_any_multi(struct ViewLayer *view_layer,
87  int object_index,
88  int elem_index,
89  struct Object **r_obedit);
90 
91 bool edbm_extrude_edges_indiv(struct BMEditMesh *em,
92  struct wmOperator *op,
93  const char hflag,
94  const bool use_normal_flip);
95 
96 /* *** editmesh_add.c *** */
106 
107 /* *** editmesh_add_gizmo.c *** */
109 
110 /* *** editmesh_bevel.c *** */
111 void MESH_OT_bevel(struct wmOperatorType *ot);
112 struct wmKeyMap *bevel_modal_keymap(struct wmKeyConfig *keyconf);
113 
114 /* *** editmesh_bisect.c *** */
115 void MESH_OT_bisect(struct wmOperatorType *ot);
116 
117 /* *** editmesh_extrude.c *** */
125 
126 /* *** editmesh_extrude_screw.c *** */
127 void MESH_OT_screw(struct wmOperatorType *ot);
128 
129 /* *** editmesh_extrude_spin.c *** */
130 void MESH_OT_spin(struct wmOperatorType *ot);
131 /* *** editmesh_extrude_spin_gizmo.c *** */
132 void MESH_GGT_spin(struct wmGizmoGroupType *gzgt);
133 void MESH_GGT_spin_redo(struct wmGizmoGroupType *gzgt);
134 
135 /* *** editmesh_polybuild.c *** */
141 
142 /* *** editmesh_inset.c *** */
143 void MESH_OT_inset(struct wmOperatorType *ot);
144 
145 /* *** editmesh_intersect.c *** */
146 void MESH_OT_intersect(struct wmOperatorType *ot);
149 
150 /* *** editmesh_knife.c *** */
151 void MESH_OT_knife_tool(struct wmOperatorType *ot);
153 void EDBM_mesh_knife(struct bContext *C, struct LinkNode *polys, bool use_tag, bool cut_through);
154 
155 struct wmKeyMap *knifetool_modal_keymap(struct wmKeyConfig *keyconf);
156 
157 /* *** editmesh_loopcut.c *** */
158 void MESH_OT_loopcut(struct wmOperatorType *ot);
159 
160 /* *** editmesh_rip.c *** */
161 void MESH_OT_rip(struct wmOperatorType *ot);
162 void MESH_OT_rip_edge(struct wmOperatorType *ot);
163 
164 /* *** editmesh_select.c *** */
171 void MESH_OT_select_all(struct wmOperatorType *ot);
181 void MESH_OT_select_nth(struct wmOperatorType *ot);
191 
192 extern struct EnumPropertyItem *corner_type_items;
193 
194 /* *** editmesh_tools.c *** */
195 void MESH_OT_subdivide(struct wmOperatorType *ot);
206 void MESH_OT_edge_split(struct wmOperatorType *ot);
209 void MESH_OT_wireframe(struct wmOperatorType *ot);
211 void MESH_OT_symmetrize(struct wmOperatorType *ot);
216 void MESH_OT_uvs_rotate(struct wmOperatorType *ot);
220 void MESH_OT_delete(struct wmOperatorType *ot);
225 void MESH_OT_split(struct wmOperatorType *ot);
227 void MESH_OT_hide(struct wmOperatorType *ot);
228 void MESH_OT_reveal(struct wmOperatorType *ot);
229 void MESH_OT_mark_seam(struct wmOperatorType *ot);
230 void MESH_OT_mark_sharp(struct wmOperatorType *ot);
232 void MESH_OT_solidify(struct wmOperatorType *ot);
233 void MESH_OT_knife_cut(struct wmOperatorType *ot);
234 void MESH_OT_separate(struct wmOperatorType *ot);
235 void MESH_OT_fill(struct wmOperatorType *ot);
236 void MESH_OT_fill_grid(struct wmOperatorType *ot);
237 void MESH_OT_fill_holes(struct wmOperatorType *ot);
241 void MESH_OT_decimate(struct wmOperatorType *ot);
250 void MESH_OT_duplicate(struct wmOperatorType *ot);
251 void MESH_OT_merge(struct wmOperatorType *ot);
253 void MESH_OT_poke(struct wmOperatorType *ot);
262 
263 /* *** editmesh_mask_extract.c *** */
267 
269 
270 #if defined(WITH_FREESTYLE)
271 void MESH_OT_mark_freestyle_edge(struct wmOperatorType *ot);
272 void MESH_OT_mark_freestyle_face(struct wmOperatorType *ot);
273 #endif
274 
275 /* *** mesh_data.c *** */
282 /* no create_mask yet */
#define C
Definition: RandGen.cpp:39
bool EDBM_op_call_and_selectf(struct BMEditMesh *em, struct wmOperator *op, const char *select_slot, const bool select_replace, const char *fmt,...)
void MESH_OT_intersect_boolean(struct wmOperatorType *ot)
void MESH_OT_loop_multi_select(struct wmOperatorType *ot)
void MESH_OT_edges_select_sharp(struct wmOperatorType *ot)
void MESH_OT_paint_mask_extract(struct wmOperatorType *ot)
void MESH_OT_dissolve_degenerate(struct wmOperatorType *ot)
void MESH_OT_bisect(struct wmOperatorType *ot)
void MESH_OT_delete_loose(struct wmOperatorType *ot)
void MESH_OT_dissolve_edges(struct wmOperatorType *ot)
bool EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop, struct wmOperator *op, const char *fmt,...)
void MESH_OT_customdata_mask_clear(struct wmOperatorType *ot)
Definition: mesh_data.c:842
void MESH_OT_bridge_edge_loops(struct wmOperatorType *ot)
void MESH_OT_fill_holes(struct wmOperatorType *ot)
void MESH_OT_uv_texture_add(struct wmOperatorType *ot)
Definition: mesh_data.c:619
void MESH_OT_primitive_circle_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:293
void MESH_OT_quads_convert_to_tris(struct wmOperatorType *ot)
void MESH_OT_primitive_plane_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:153
void MESH_OT_blend_from_shape(struct wmOperatorType *ot)
bool EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop, struct wmOperator *op, const bool do_report)
void MESH_OT_edge_split(struct wmOperatorType *ot)
void MESH_OT_select_linked(struct wmOperatorType *ot)
void MESH_OT_loop_select(struct wmOperatorType *ot)
void MESH_OT_rip_edge(struct wmOperatorType *ot)
void MESH_OT_customdata_skin_clear(struct wmOperatorType *ot)
Definition: mesh_data.c:919
void MESH_OT_select_similar_region(struct wmOperatorType *ot)
void MESH_OT_subdivide_edgering(struct wmOperatorType *ot)
void MESH_OT_faces_shade_smooth(struct wmOperatorType *ot)
void MESH_OT_polybuild_dissolve_at_cursor(struct wmOperatorType *ot)
void MESH_OT_extrude_edges_indiv(struct wmOperatorType *ot)
void MESH_OT_select_ungrouped(struct wmOperatorType *ot)
void MESH_OT_sculpt_vertex_color_remove(struct wmOperatorType *ot)
Definition: mesh_data.c:764
void MESH_OT_uvs_rotate(struct wmOperatorType *ot)
void MESH_OT_spin(struct wmOperatorType *ot)
void MESH_OT_mark_sharp(struct wmOperatorType *ot)
void MESH_OT_primitive_cylinder_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:367
void MESH_OT_fill(struct wmOperatorType *ot)
bool EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt,...)
void MESH_OT_polybuild_delete_at_cursor(struct wmOperatorType *ot)
void MESH_OT_face_set_extract(struct wmOperatorType *ot)
void MESH_OT_select_more(struct wmOperatorType *ot)
void MESH_OT_polybuild_face_at_cursor(struct wmOperatorType *ot)
void MESH_OT_point_normals(struct wmOperatorType *ot)
bool EDBM_view3d_poll(struct bContext *C)
void MESH_OT_edge_face_add(struct wmOperatorType *ot)
void MESH_OT_select_random(struct wmOperatorType *ot)
void MESH_OT_unsubdivide(struct wmOperatorType *ot)
void MESH_OT_select_mode(struct wmOperatorType *ot)
void MESH_OT_split(struct wmOperatorType *ot)
void MESH_OT_duplicate(struct wmOperatorType *ot)
void MESH_OT_select_linked_pick(struct wmOperatorType *ot)
void MESH_OT_vert_connect(struct wmOperatorType *ot)
void MESH_OT_decimate(struct wmOperatorType *ot)
void MESH_OT_colors_rotate(struct wmOperatorType *ot)
void MESH_OT_dissolve_verts(struct wmOperatorType *ot)
void MESH_OT_separate(struct wmOperatorType *ot)
void MESH_OT_shortest_path_pick(struct wmOperatorType *ot)
struct BMElem * EDBM_elem_from_index_any_multi(struct ViewLayer *view_layer, int object_index, int elem_index, struct Object **r_obedit)
int EDBM_elem_to_index_any_multi(struct ViewLayer *view_layer, struct BMEditMesh *em, struct BMElem *ele, int *r_object_index)
void MESH_OT_extrude_repeat(struct wmOperatorType *ot)
int EDBM_elem_to_index_any(struct BMEditMesh *em, struct BMElem *ele)
void MESH_OT_reveal(struct wmOperatorType *ot)
void MESH_OT_knife_cut(struct wmOperatorType *ot)
void MESH_OT_region_to_loop(struct wmOperatorType *ot)
void MESH_OT_edgering_select(struct wmOperatorType *ot)
void MESH_OT_select_axis(struct wmOperatorType *ot)
void MESH_OT_customdata_skin_add(struct wmOperatorType *ot)
Definition: mesh_data.c:894
void MESH_OT_extrude_verts_indiv(struct wmOperatorType *ot)
void MESH_OT_polybuild_split_at_cursor(struct wmOperatorType *ot)
void MESH_OT_select_less(struct wmOperatorType *ot)
void MESH_OT_dissolve_limited(struct wmOperatorType *ot)
void MESH_OT_knife_tool(struct wmOperatorType *ot)
void MESH_OT_primitive_cone_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:443
bool edbm_extrude_edges_indiv(struct BMEditMesh *em, struct wmOperator *op, const char hflag, const bool use_normal_flip)
void MESH_OT_shape_propagate_to_all(struct wmOperatorType *ot)
void MESH_OT_dupli_extrude_cursor(struct wmOperatorType *ot)
void MESH_OT_vert_connect_nonplanar(struct wmOperatorType *ot)
void MESH_OT_merge_normals(struct wmOperatorType *ot)
void MESH_OT_screw(struct wmOperatorType *ot)
void MESH_OT_sculpt_vertex_color_add(struct wmOperatorType *ot)
Definition: mesh_data.c:737
void EDBM_mesh_knife(struct bContext *C, struct LinkNode *polys, bool use_tag, bool cut_through)
void MESH_OT_primitive_cube_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:216
void MESH_OT_delete(struct wmOperatorType *ot)
void MESH_OT_merge(struct wmOperatorType *ot)
bool EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt,...)
void MESH_OT_inset(struct wmOperatorType *ot)
void MESH_OT_uvs_reverse(struct wmOperatorType *ot)
struct wmKeyMap * knifetool_modal_keymap(struct wmKeyConfig *keyconf)
void MESH_OT_loop_to_region(struct wmOperatorType *ot)
void MESH_OT_select_non_manifold(struct wmOperatorType *ot)
void MESH_OT_vertices_smooth_laplacian(struct wmOperatorType *ot)
void MESH_OT_vertices_smooth(struct wmOperatorType *ot)
void MESH_OT_primitive_ico_sphere_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:721
void MESH_OT_vertex_color_remove(struct wmOperatorType *ot)
Definition: mesh_data.c:708
struct BMElem * EDBM_elem_from_selectmode(struct BMEditMesh *em, struct BMVert *eve, struct BMEdge *eed, struct BMFace *efa)
void MESH_OT_select_nth(struct wmOperatorType *ot)
void MESH_OT_uv_texture_remove(struct wmOperatorType *ot)
Definition: mesh_data.c:652
void MESH_GGT_spin(struct wmGizmoGroupType *gzgt)
void MESH_OT_face_split_by_edges(struct wmOperatorType *ot)
void MESH_OT_select_interior_faces(struct wmOperatorType *ot)
void MESH_OT_colors_reverse(struct wmOperatorType *ot)
void MESH_OT_loopcut(struct wmOperatorType *ot)
void MESH_OT_tris_convert_to_quads(struct wmOperatorType *ot)
void MESH_OT_vert_connect_path(struct wmOperatorType *ot)
void MESH_OT_customdata_custom_splitnormals_clear(struct wmOperatorType *ot)
Definition: mesh_data.c:1021
void MESH_OT_mark_seam(struct wmOperatorType *ot)
void MESH_OT_symmetry_snap(struct wmOperatorType *ot)
void MESH_OT_rip(struct wmOperatorType *ot)
void MESH_GGT_spin_redo(struct wmGizmoGroupType *gzgt)
void MESH_OT_remove_doubles(struct wmOperatorType *ot)
void MESH_OT_beautify_fill(struct wmOperatorType *ot)
void MESH_OT_intersect(struct wmOperatorType *ot)
void MESH_OT_primitive_cube_add_gizmo(struct wmOperatorType *ot)
void EDBM_stats_update(struct BMEditMesh *em)
void MESH_OT_normals_make_consistent(struct wmOperatorType *ot)
void MESH_OT_extrude_faces_indiv(struct wmOperatorType *ot)
void MESH_OT_hide(struct wmOperatorType *ot)
void MESH_OT_subdivide(struct wmOperatorType *ot)
void MESH_OT_extrude_region(struct wmOperatorType *ot)
void MESH_OT_edge_collapse(struct wmOperatorType *ot)
void MESH_OT_face_make_planar(struct wmOperatorType *ot)
void MESH_OT_edge_rotate(struct wmOperatorType *ot)
void MESH_OT_normals_tools(struct wmOperatorType *ot)
void MESH_OT_dissolve_faces(struct wmOperatorType *ot)
void MESH_OT_mod_weighted_strength(struct wmOperatorType *ot)
struct wmKeyMap * bevel_modal_keymap(struct wmKeyConfig *keyconf)
void MESH_OT_smooth_normals(struct wmOperatorType *ot)
void MESH_OT_paint_mask_slice(struct wmOperatorType *ot)
void MESH_OT_flip_normals(struct wmOperatorType *ot)
struct wmKeyMap * point_normals_modal_keymap(wmKeyConfig *keyconf)
void MESH_OT_extrude_context(struct wmOperatorType *ot)
void MESH_OT_select_face_by_sides(struct wmOperatorType *ot)
void MESH_OT_bevel(struct wmOperatorType *ot)
void MESH_OT_symmetrize(struct wmOperatorType *ot)
void MESH_OT_polybuild_transform_at_cursor(struct wmOperatorType *ot)
void MESH_OT_primitive_uv_sphere_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:654
void MESH_OT_faces_select_linked_flat(struct wmOperatorType *ot)
void MESH_OT_wireframe(struct wmOperatorType *ot)
void MESH_OT_faces_shade_flat(struct wmOperatorType *ot)
void MESH_OT_solidify(struct wmOperatorType *ot)
struct EnumPropertyItem * corner_type_items
void MESH_OT_split_normals(struct wmOperatorType *ot)
void MESH_OT_set_normals_from_faces(struct wmOperatorType *ot)
void MESH_OT_vert_connect_concave(struct wmOperatorType *ot)
void MESH_OT_fill_grid(struct wmOperatorType *ot)
void MESH_OT_customdata_custom_splitnormals_add(struct wmOperatorType *ot)
Definition: mesh_data.c:992
void MESH_OT_vertex_color_add(struct wmOperatorType *ot)
Definition: mesh_data.c:681
struct BMElem * EDBM_elem_from_index_any(struct BMEditMesh *em, int index)
void MESH_OT_select_loose(struct wmOperatorType *ot)
void MESH_OT_primitive_grid_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:516
void MESH_OT_sort_elements(struct wmOperatorType *ot)
void MESH_OT_knife_project(struct wmOperatorType *ot)
void MESH_OT_offset_edge_loops(struct wmOperatorType *ot)
void MESH_OT_select_all(struct wmOperatorType *ot)
void MESH_OT_select_mirror(struct wmOperatorType *ot)
void MESH_OT_select_similar(struct wmOperatorType *ot)
void MESH_OT_primitive_monkey_add(struct wmOperatorType *ot)
Definition: editmesh_add.c:589
void MESH_OT_dissolve_mode(struct wmOperatorType *ot)
void MESH_OT_convex_hull(struct wmOperatorType *ot)
void MESH_OT_shortest_path_select(struct wmOperatorType *ot)
void MESH_OT_delete_edgeloop(struct wmOperatorType *ot)
void MESH_OT_average_normals(struct wmOperatorType *ot)
void MESH_OT_poke(struct wmOperatorType *ot)
wmOperatorType * ot
Definition: wm_files.c:3156