LEFT | RIGHT |
1 /* | 1 /* |
2 * ***** BEGIN GPL LICENSE BLOCK ***** | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or | 4 * This program is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU General Public License | 5 * modify it under the terms of the GNU General Public License |
6 * as published by the Free Software Foundation; either version 2 | 6 * as published by the Free Software Foundation; either version 2 |
7 * of the License, or (at your option) any later version.· | 7 * of the License, or (at your option) any later version.· |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 10 matching lines...) Expand all Loading... |
21 *· | 21 *· |
22 * Contributor(s): Blender Foundation | 22 * Contributor(s): Blender Foundation |
23 * | 23 * |
24 * ***** END GPL LICENSE BLOCK ***** | 24 * ***** END GPL LICENSE BLOCK ***** |
25 */ | 25 */ |
26 | 26 |
27 /** \file ED_mesh.h | 27 /** \file ED_mesh.h |
28 * \ingroup editors | 28 * \ingroup editors |
29 */ | 29 */ |
30 | 30 |
31 #ifndef ED_MESH_H | 31 #ifndef __ED_MESH_H__ |
32 #define ED_MESH_H | 32 #define __ED_MESH_H__ |
33 | 33 |
34 #ifdef __cplusplus | 34 #ifdef __cplusplus |
35 extern "C" { | 35 extern "C" { |
36 #endif | 36 #endif |
37 | 37 |
38 struct ID; | 38 struct ID; |
39 struct View3D; | 39 struct View3D; |
40 struct ARegion; | 40 struct ARegion; |
41 struct EditMesh; | |
42 struct EditVert; | |
43 struct EditEdge; | |
44 struct EditFace; | |
45 struct bContext; | 41 struct bContext; |
46 struct wmOperator; | 42 struct wmOperator; |
47 struct wmWindowManager; | 43 struct wmWindowManager; |
48 struct wmKeyConfig; | 44 struct wmKeyConfig; |
49 struct ReportList; | 45 struct ReportList; |
50 struct EditSelection; | 46 struct EditSelection; |
51 struct ViewContext; | 47 struct ViewContext; |
52 struct bDeformGroup; | 48 struct bDeformGroup; |
53 struct MDeformWeight; | 49 struct MDeformWeight; |
54 struct MDeformVert; | 50 struct MDeformVert; |
55 struct Scene; | 51 struct Scene; |
56 struct Mesh; | 52 struct Mesh; |
57 struct MFace; | 53 struct MFace; |
58 struct MEdge; | 54 struct MEdge; |
59 struct MVert; | 55 struct MVert; |
60 struct MCol; | 56 struct MCol; |
61 struct UvVertMap; | 57 struct UvVertMap; |
62 struct UvMapVert; | 58 struct UvMapVert; |
63 struct CustomData; | 59 struct CustomData; |
| 60 struct BMEditMesh; |
| 61 struct BMEditSelection; |
| 62 struct BMesh; |
| 63 struct BMVert; |
| 64 struct MLoopCol; |
| 65 struct BMEdge; |
| 66 struct BMFace; |
| 67 struct UvVertMap; |
| 68 struct UvMapVert; |
| 69 struct ToolSettings; |
64 struct Material; | 70 struct Material; |
65 struct Object; | 71 struct Object; |
66 struct rcti; | 72 struct rcti; |
67 | 73 |
68 #define EM_FGON_DRAW» 1 // face flag | 74 intptr_t mesh_octree_table(struct Object *ob, struct BMEditMesh *em, const fl
oat co[3], char mode); |
69 #define EM_FGON»» » 2 // edge and face flag both | 75 int mesh_mirrtopo_table(struct Object *ob, char mode); |
70 | 76 |
71 /* editbutflag */ | 77 /* editmesh_utils.c */ |
72 #define B_CLOCKWISE» » » 1 | |
73 #define B_KEEPORIG» » » 2 | |
74 #define B_BEAUTY» » » 4 | |
75 #define B_SMOOTH» » » 8 | |
76 #define B_BEAUTY_SHORT » 0x10 | |
77 #define B_AUTOFGON» » » 0x20 | |
78 #define B_KNIFE»» » » 0x80 | |
79 #define B_PERCENTSUBD» » 0x40 | |
80 //#define B_MESH_X_MIRROR» » 0x100 // deprecated, use mesh | |
81 #define B_JOINTRIA_UV» » 0x200 | |
82 #define B_JOINTRIA_VCOL»» 0X400 | |
83 #define B_JOINTRIA_SHARP» 0X800 | |
84 #define B_JOINTRIA_MAT» » 0X1000 | |
85 #define B_FRACTAL» » » 0x2000 | |
86 #define B_SPHERE» » » 0x4000 | |
87 | 78 |
88 /* meshtools.c */ | 79 /* retrieves mirrored cache vert, or NULL if there isn't one. |
| 80 * note: calling this without ensuring the mirror cache state |
| 81 * is bad.*/ |
| 82 void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const short
use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */ |
| 83 void EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from
, const int sel_to); |
| 84 struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v); |
| 85 void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVer
t *v); |
| 86 void EDBM_verts_mirror_cache_end(struct BMEditMesh *em); |
89 | 87 |
90 intptr_t» mesh_octree_table(struct Object *ob, struct EditMesh *em, float
*co, char mode); | 88 void EDBM_mesh_normals_update(struct BMEditMesh *em); |
91 long» » mesh_mirrtopo_table(struct Object *ob, char mode); | |
92 | 89 |
93 struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, struct EditMesh
*em, struct EditVert *eve, float *co, int index); | 90 void EDBM_mesh_make(struct ToolSettings *ts, struct Scene *scene, struct Object
*ob); |
94 int» » » mesh_get_x_mirror_vert(struct Object *ob, int index); | 91 void EDBM_mesh_free(struct BMEditMesh *tm); |
95 int» » » *mesh_get_x_mirror_faces(struct Object *ob, struct EditM
esh *em); | 92 void EDBM_mesh_load(struct Object *ob); |
96 | 93 |
97 int» » » join_mesh_exec(struct bContext *C, struct wmOperator *op
); | 94 void EDBM_index_arrays_init(struct BMEditMesh *em, int forvert, int fo
redge, int forface); |
98 int» » » join_mesh_shapes_exec(struct bContext *C, struct wmOpera
tor *op); | 95 void EDBM_index_arrays_free(struct BMEditMesh *em); |
| 96 struct BMVert *EDBM_vert_at_index(struct BMEditMesh *em, int index); |
| 97 struct BMEdge *EDBM_edge_at_index(struct BMEditMesh *em, int index); |
| 98 struct BMFace *EDBM_face_at_index(struct BMEditMesh *em, int index); |
99 | 99 |
100 /* mesh_ops.c */ | 100 /* flushes based on the current select mode. if in vertex select mode, |
101 void» » ED_operatortypes_mesh(void); | 101 * verts select/deselect edges and faces, if in edge select mode, |
102 void» » ED_operatormacros_mesh(void); | 102 * edges select/deselect faces and vertices, and in face select mode faces selec
t/deselect |
103 void» » ED_keymap_mesh(struct wmKeyConfig *keyconf); | 103 * edges and vertices.*/ |
| 104 void EDBM_select_more(struct BMEditMesh *em); |
| 105 void EDBM_select_less(struct BMEditMesh *em); |
| 106 |
| 107 void EDBM_selectmode_flush_ex(struct BMEditMesh *em, int selectmode); |
| 108 void EDBM_selectmode_flush(struct BMEditMesh *em); |
| 109 |
| 110 void EDBM_deselect_flush(struct BMEditMesh *em); |
| 111 void EDBM_select_flush(struct BMEditMesh *em); |
| 112 |
| 113 void EDBM_selectmode_set(struct BMEditMesh *em); |
| 114 void EDBM_selectmode_convert(struct BMEditMesh *em, short oldmode, short selectm
ode); |
| 115 void undo_push_mesh(struct bContext *C, const char *name); |
| 116 |
| 117 int EDBM_vert_color_check(struct BMEditMesh *em); |
104 | 118 |
105 | 119 |
106 /* editmesh.c */ | 120 void EDBM_mesh_hide(struct BMEditMesh *em, int swap); |
107 void» » make_editMesh(struct Scene *scene, struct Object *ob); | 121 void EDBM_mesh_reveal(struct BMEditMesh *em); |
108 void» » load_editMesh(struct Scene *scene, struct Object *ob); | |
109 void» » remake_editMesh(struct Scene *scene, struct Object *ob); | |
110 void» » free_editMesh(struct EditMesh *em); | |
111 | 122 |
112 void» » recalc_editnormals(struct EditMesh *em); | 123 void EDBM_update_generic(struct bContext *C, struct BMEditMesh *em, const short
do_tessface); |
113 | 124 |
114 void» » EM_init_index_arrays(struct EditMesh *em, int forVert, int forEd
ge, int forFace); | 125 int EDBM_backbuf_check(unsigned int index); |
115 void» » EM_free_index_arrays(void); | 126 int EDBM_backbuf_border_mask_init(struct ViewContext *vc, int mcords[][2], short
tot, |
116 struct EditVert»*EM_get_vert_for_index(int index); | 127 short xmin, short ymin, short xmax, short ymax
); |
117 struct EditEdge»*EM_get_edge_for_index(int index); | 128 void EDBM_backbuf_free(void); |
118 struct EditFace»*EM_get_face_for_index(int index); | 129 int EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, sh
ort xmax, short ymax); |
119 int» » » EM_texFaceCheck(struct EditMesh *em); | 130 int EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short
rads); |
120 int» » » EM_vertColorCheck(struct EditMesh *em); | |
121 | 131 |
122 void» » undo_push_mesh(struct bContext *C, const char *name); | 132 void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const s
hort select); |
123 | 133 |
124 void» » paintvert_flush_flags(struct Object *ob); | 134 struct UvElementMap *EDBM_uv_element_map_create(struct BMEditMesh *em, int selec
ted, int doIslands); |
125 void» » paintvert_deselect_all_visible(struct Object *ob, int action, sh
ort flush_flags); | 135 void EDBM_uv_element_map_free(struct UvElementMap *vmap); |
126 | 136 |
127 /* editmesh_lib.c */ | 137 int EDBM_mtexpoly_check(struct BMEditMesh *em); |
| 138 struct MTexPoly *EDBM_mtexpoly_active_get(struct BMEditMesh *em, struct BMFace *
*r_act_efa, int sloppy); |
128 | 139 |
129 struct EditFace»*EM_get_actFace(struct EditMesh *em, int sloppy); | 140 void EDBM_uv_vert_map_free(struct UvVertMap *vmap); |
130 void EM_set_actFace(struct EditMesh *em, struct EditFace *efa); | 141 struct UvMapVert *EDBM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int
v); |
131 float EM_face_area(struct EditFace *efa); | 142 struct UvVertMap *EDBM_uv_vert_map_create(struct BMEditMesh *em, int selected, i
nt do_face_idx_array, const float limit[2]); |
132 | 143 |
133 void» » EM_select_edge(struct EditEdge *eed, int sel); | 144 void EDBM_data_layer_add(struct BMEditMesh *em, struct CustomData *data, int typ
e, const char *name); |
134 void» » EM_select_face(struct EditFace *efa, int sel); | 145 void EDBM_data_layer_free(struct BMEditMesh *em, struct CustomData *data, int ty
pe); |
135 void» » EM_select_face_fgon(struct EditMesh *em, struct EditFace *efa, i
nt val); | |
136 void» » EM_select_swap(struct EditMesh *em); | |
137 void» » EM_toggle_select_all(struct EditMesh *em); | |
138 void» » EM_select_all(struct EditMesh *em); | |
139 void» » EM_deselect_all(struct EditMesh *em); | |
140 void» » EM_selectmode_flush(struct EditMesh *em); | |
141 void» » EM_deselect_flush(struct EditMesh *em); | |
142 void» » EM_selectmode_set(struct EditMesh *em); | |
143 void» » EM_select_flush(struct EditMesh *em); | |
144 void» » EM_convertsel(struct EditMesh *em, short oldmode, short selectmo
de); | |
145 void» » EM_validate_selections(struct EditMesh *em); | |
146 void» » EM_selectmode_to_scene(struct Scene *scene, struct Object *obedi
t); | |
147 | 146 |
148 » » » /* exported to transform */ | 147 void EDBM_select_toggle_all(struct BMEditMesh *em); |
149 int» » » EM_get_actSelection(struct EditMesh *em, struct EditSele
ction *ese); | 148 void EDBM_select_swap(struct BMEditMesh *em); /* exported for UV */ |
150 void» » EM_editselection_normal(float *normal, struct EditSelection *ese
); | 149 int EDBM_select_interior_faces(struct BMEditMesh *em); |
151 void» » EM_editselection_plane(float *plane, struct EditSelection *ese); | 150 |
152 void» » EM_editselection_center(float *center, struct EditSelection *ese
);» » »······· | 151 void EDBM_flag_enable_all(struct BMEditMesh *em, const char hflag); |
| 152 void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag); |
153 | 153 |
154 struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_
face_idx_array, float *limit); | 154 struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_
face_idx_array, float *limit); |
155 struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v); | 155 struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v); |
156 void» » EM_free_uv_vert_map(struct UvVertMap *vmap); | 156 void EM_free_uv_vert_map(struct UvVertMap *vmap); |
157 | |
158 struct UvElementMap *EM_make_uv_element_map(struct EditMesh *em, int selected, i
nt doIslands); | |
159 void» » EM_free_uv_element_map(struct UvElementMap *vmap); | |
160 | 157 |
161 void EM_add_data_layer(struct EditMesh *em, struct CustomData *data,
int type, const char *name); | 158 void EM_add_data_layer(struct EditMesh *em, struct CustomData *data,
int type, const char *name); |
162 void EM_free_data_layer(struct EditMesh *em, struct CustomData *data,
int type); | 159 void EM_free_data_layer(struct EditMesh *em, struct CustomData *data,
int type); |
163 | 160 |
164 void EM_make_hq_normals(struct EditMesh *em); | |
165 void EM_solidify(struct EditMesh *em, float dist); | |
166 | |
167 int EM_deselect_nth(struct EditMesh *em, int nth); | |
168 | |
169 void EM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct Object
*obedit, struct EditMesh *em); | |
170 | |
171 /* editmesh_mods.c */ | |
172 extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs; | |
173 | |
174 void EM_cache_x_mirror_vert(struct Object *ob, struct EditMesh *em); | |
175 int mouse_mesh(struct bContext *C, const int mval[2], short
extend); | |
176 int EM_check_backbuf(unsigned int index); | |
177 int EM_mask_init_backbuf_border(struct ViewContext *vc, int
mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax); | |
178 void EM_free_backbuf(void); | |
179 int EM_init_backbuf_border(struct ViewContext *vc, short xmi
n, short ymin, short xmax, short ymax); | |
180 int EM_init_backbuf_circle(struct ViewContext *vc, short xs,
short ys, short rads); | |
181 | |
182 void EM_hide_mesh(struct EditMesh *em, int swap); | |
183 void EM_reveal_mesh(struct EditMesh *em); | |
184 | |
185 void EM_select_by_material(struct EditMesh *em, int index); | |
186 void EM_deselect_by_material(struct EditMesh *em, int index);· | |
187 | |
188 void EM_automerge(struct Scene *scene, struct Object *obedit, int upd
ate); | |
189 | |
190 /* editface.c */ | |
191 void paintface_flush_flags(struct Object *ob); | |
192 struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act
_efa, struct MCol **mcol, int sloppy); | |
193 int paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval
[2], int extend); | |
194 int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int selec
t, int extend); | |
195 void paintface_deselect_all_visible(struct Object *ob, int action, short flush_f
lags); | |
196 void paintface_select_linked(struct bContext *C, struct Object *ob, int mval[2],
int mode); | |
197 int paintface_minmax(struct Object *ob, float *min, float *max); | |
198 | |
199 void paintface_hide(struct Object *ob, const int unselected); | |
200 void paintface_reveal(struct Object *ob); | |
201 | |
202 /* object_vgroup.c */ | |
203 | |
204 #define WEIGHT_REPLACE 1 | |
205 #define WEIGHT_ADD 2 | |
206 #define WEIGHT_SUBTRACT 3 | |
207 | |
208 struct bDeformGroup *ED_vgroup_add(struct Object *ob); | |
209 struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, const cha
r *name); | |
210 void ED_vgroup_delete(struct Object *ob, stru
ct bDeformGroup *defgroup); | |
211 void ED_vgroup_select_by_name(struct Object *
ob, const char *name); | |
212 int ED_vgroup_data_create(struct ID
*id); | |
213 int ED_vgroup_give_array(struct ID *
id, struct MDeformVert **dvert_arr, int *dvert_tot); | |
214 int ED_vgroup_copy_array(struct Obje
ct *ob, struct Object *ob_from); | |
215 void ED_vgroup_mirror(struct Object *ob, cons
t short mirror_weights, const short flip_vgroups); | |
216 | |
217 int ED_vgroup_object_is_edit_mode(st
ruct Object *ob); | |
218 | |
219 void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, i
nt vertnum, float weight, int assignmode); | |
220 void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg
, int vertnum); | |
221 float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg
, int vertnum); | |
222 | |
223 /*needed by edge slide*/ | |
224 struct EditVert *editedge_getOtherVert(struct EditEdge *eed, struct EditVert *ev
e); | |
225 struct EditVert *editedge_getSharedVert(struct EditEdge *eed, struct EditEdge *e
ed2); | |
226 int editedge_containsVert(struct EditEdge *eed, struct EditVert *eve); | |
227 int editface_containsVert(struct EditFace *efa, struct EditVert *eve); | |
228 int editface_containsEdge(struct EditFace *efa, struct EditEdge *eed); | |
229 short sharesFace(struct EditMesh *em, struct EditEdge *e1, struct EditEdge *e2); | |
230 | |
231 /* mesh_data.c */ | |
232 // void ED_mesh_geometry_add(struct Mesh *mesh, struct ReportList *reports, int
verts, int edges, int faces); | |
233 void ED_mesh_faces_add(struct Mesh *mesh, struct ReportList *reports, int count)
; | |
234 void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count)
; | |
235 void ED_mesh_vertices_add(struct Mesh *mesh, struct ReportList *reports, int cou
nt); | |
236 | |
237 void ED_mesh_transform(struct Mesh *me, float *mat); | |
238 void ED_mesh_calc_normals(struct Mesh *me); | |
239 void ED_mesh_material_link(struct Mesh *me, struct Material *ma); | |
240 void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges); | |
241 | |
242 int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me, const char *name
, int active_set); | |
243 int ED_mesh_uv_texture_remove(struct bContext *C, struct Object *ob, struct Mesh
*me); | |
244 int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob
, struct Mesh *me, const char *name, int active_set); | |
245 int ED_mesh_color_remove(struct bContext *C, struct Object *ob, struct Mesh *me)
; | |
246 | |
247 #ifdef __cplusplus | |
248 } | |
249 #endif | |
250 | |
251 #endif /* ED_MESH_H */ | |
252 | |
LEFT | RIGHT |