4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2008 Blender Foundation.
21 * All rights reserved.
24 * Contributor(s): Blender Foundation
26 * ***** END GPL LICENSE BLOCK *****
39 struct wmWindowManager;
52 // edge and face flag both
55 #define EM_FGON_DRAW 1
62 #define B_BEAUTY_SHORT 16
65 #define B_PERCENTSUBD 0x40
66 #define B_MESH_X_MIRROR 0x100
67 #define B_JOINTRIA_UV 0x200
68 #define B_JOINTRIA_VCOL 0X400
69 #define B_JOINTRIA_SHARP 0X800
70 #define B_JOINTRIA_MAT 0X1000
75 intptr_t mesh_octree_table(struct Object *ob, struct EditMesh *em, float *co, char mode);
76 struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, struct EditMesh *em, float *co);
77 int mesh_get_x_mirror_vert(struct Object *ob, int index);
78 int *mesh_get_x_mirror_faces(struct Object *ob, struct EditMesh *em);
81 void ED_operatortypes_mesh(void);
82 void ED_keymap_mesh(struct wmWindowManager *wm);
87 void ED_spacetypes_init(void);
88 void ED_keymap_mesh(struct wmWindowManager *wm);
90 void make_editMesh(struct Scene *scene, Object *ob);
91 void load_editMesh(struct Scene *scene, Object *ob);
92 void remake_editMesh(struct Scene *scene, Object *ob);
93 void free_editMesh(struct EditMesh *em);
95 void recalc_editnormals(struct EditMesh *em);
97 void EM_init_index_arrays(struct EditMesh *em, int forVert, int forEdge, int forFace);
98 void EM_free_index_arrays(void);
99 struct EditVert *EM_get_vert_for_index(int index);
100 struct EditEdge *EM_get_edge_for_index(int index);
101 struct EditFace *EM_get_face_for_index(int index);
102 int EM_texFaceCheck(struct EditMesh *em);
103 int EM_vertColorCheck(struct EditMesh *em);
105 void undo_push_mesh(struct bContext *C, char *name);
110 struct EditFace *EM_get_actFace(struct EditMesh *em, int sloppy);
111 void EM_set_actFace(struct EditMesh *em, struct EditFace *efa);
112 float EM_face_area(struct EditFace *efa);
114 void EM_select_edge(struct EditEdge *eed, int sel);
115 void EM_select_face(struct EditFace *efa, int sel);
116 void EM_select_face_fgon(struct EditMesh *em, struct EditFace *efa, int val);
117 void EM_select_swap(struct EditMesh *em);
118 void EM_toggle_select_all(struct EditMesh *em);
119 void EM_selectmode_flush(struct EditMesh *em);
120 void EM_deselect_flush(struct EditMesh *em);
121 void EM_selectmode_set(struct EditMesh *em);
122 void EM_select_flush(struct EditMesh *em);
123 void EM_convertsel(struct EditMesh *em, short oldmode, short selectmode);
124 void EM_validate_selections(struct EditMesh *em);
126 /* exported to transform */
127 int EM_get_actSelection(struct EditMesh *em, struct EditSelection *ese);
128 void EM_editselection_normal(float *normal, struct EditSelection *ese);
129 void EM_editselection_plane(float *plane, struct EditSelection *ese);
130 void EM_editselection_center(float *center, struct EditSelection *ese);
132 struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_face_idx_array, float *limit);
133 struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v);
134 void EM_free_uv_vert_map(struct UvVertMap *vmap);
136 void EM_add_data_layer(struct EditMesh *em, struct CustomData *data, int type);
137 void EM_free_data_layer(struct EditMesh *em, struct CustomData *data, int type);
139 /* editmesh_mods.c */
140 extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs;
142 void mouse_mesh(struct bContext *C, short mval[2], short extend);
143 int EM_check_backbuf(unsigned int index);
144 int EM_mask_init_backbuf_border(struct ViewContext *vc, short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax);
145 void EM_free_backbuf(void);
146 int EM_init_backbuf_border(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
147 int EM_init_backbuf_circle(struct ViewContext *vc, short xs, short ys, short rads);
149 void EM_hide_mesh(struct EditMesh *em, int swap);
150 void EM_reveal_mesh(struct EditMesh *em);
152 void EM_select_by_material(struct EditMesh *em, int index);
153 void EM_deselect_by_material(struct EditMesh *em, int index);
156 struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloppy);
158 /* editdeform.c XXX rename functions? */
160 #define WEIGHT_REPLACE 1
162 #define WEIGHT_SUBTRACT 3
164 void add_defgroup (Object *ob);
165 void create_dverts(struct ID *id);
166 float get_vert_defgroup (Object *ob, struct bDeformGroup *dg, int vertnum);
167 void remove_vert_defgroup (Object *ob, struct bDeformGroup *dg, int vertnum);
168 void remove_verts_defgroup (Object *obedit, int allverts);
169 void vertexgroup_select_by_name(Object *ob, char *name);
170 void add_vert_to_defgroup (Object *ob, struct bDeformGroup *dg, int vertnum,
171 float weight, int assignmode);
173 struct bDeformGroup *add_defgroup_name (Object *ob, char *name);
174 struct MDeformWeight *verify_defweight (struct MDeformVert *dv, int defgroup);
175 struct MDeformWeight *get_defweight (struct MDeformVert *dv, int defgroup);
178 #endif /* ED_MESH_H */