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;
51 // edge and face flag both
54 #define EM_FGON_DRAW 1
61 #define B_BEAUTY_SHORT 16
64 #define B_PERCENTSUBD 0x40
65 #define B_MESH_X_MIRROR 0x100
66 #define B_JOINTRIA_UV 0x200
67 #define B_JOINTRIA_VCOL 0X400
68 #define B_JOINTRIA_SHARP 0X800
69 #define B_JOINTRIA_MAT 0X1000
73 /*recalculate tesselations for ngons*/
74 void EDBM_Tesselate(struct EditMesh *em);
78 intptr_t mesh_octree_table(struct Object *ob, struct EditMesh *em, float *co, char mode);
79 struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, struct EditMesh *em, float *co);
80 int mesh_get_x_mirror_vert(struct Object *ob, int index);
81 int *mesh_get_x_mirror_faces(struct Object *ob, struct EditMesh *em);
84 void ED_operatortypes_mesh(void);
85 void ED_keymap_mesh(struct wmWindowManager *wm);
89 void ED_spacetypes_init(void);
90 void ED_keymap_mesh(struct wmWindowManager *wm);
92 void make_editMesh(struct Scene *scene, Object *ob);
93 void load_editMesh(struct Scene *scene, Object *ob);
94 void remake_editMesh(struct Scene *scene, Object *ob);
95 void free_editMesh(struct EditMesh *em);
97 void recalc_editnormals(struct EditMesh *em);
99 void EM_init_index_arrays(struct EditMesh *em, int forVert, int forEdge, int forFace);
100 void EM_free_index_arrays(void);
101 struct EditVert *EM_get_vert_for_index(int index);
102 struct EditEdge *EM_get_edge_for_index(int index);
103 struct EditFace *EM_get_face_for_index(int index);
104 int EM_texFaceCheck(struct EditMesh *em);
105 int EM_vertColorCheck(struct EditMesh *em);
107 void undo_push_mesh(struct bContext *C, char *name);
112 struct EditFace *EM_get_actFace(struct EditMesh *em, int sloppy);
113 void EM_set_actFace(struct EditMesh *em, struct EditFace *efa);
114 float EM_face_area(struct EditFace *efa);
115 void EM_add_data_layer(struct EditMesh *em, struct CustomData *data, int type);
117 void EM_select_edge(struct EditEdge *eed, int sel);
118 void EM_select_face(struct EditFace *efa, int sel);
119 void EM_select_face_fgon(struct EditMesh *em, struct EditFace *efa, int val);
120 void EM_select_swap(struct EditMesh *em);
121 void EM_toggle_select_all(struct EditMesh *em);
122 void EM_selectmode_flush(struct EditMesh *em);
123 void EM_deselect_flush(struct EditMesh *em);
124 void EM_selectmode_set(struct EditMesh *em);
125 void EM_select_flush(struct EditMesh *em);
126 void EM_convertsel(struct EditMesh *em, short oldmode, short selectmode);
127 void EM_validate_selections(struct EditMesh *em);
129 /* exported to transform */
130 int EM_get_actSelection(struct EditMesh *em, struct EditSelection *ese);
131 void EM_editselection_normal(float *normal, struct EditSelection *ese);
132 void EM_editselection_plane(float *plane, struct EditSelection *ese);
133 void EM_editselection_center(float *center, struct EditSelection *ese);
135 struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_face_idx_array, float *limit);
136 struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v);
137 void EM_free_uv_vert_map(struct UvVertMap *vmap);
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);
153 struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloppy);
155 /* editdeform.c XXX rename functions? */
157 #define WEIGHT_REPLACE 1
159 #define WEIGHT_SUBTRACT 3
161 void add_defgroup (Object *ob);
162 void create_dverts(struct ID *id);
163 float get_vert_defgroup (Object *ob, struct bDeformGroup *dg, int vertnum);
164 void remove_vert_defgroup (Object *ob, struct bDeformGroup *dg, int vertnum);
165 void remove_verts_defgroup (Object *obedit, int allverts);
166 void vertexgroup_select_by_name(Object *ob, char *name);
167 void add_vert_to_defgroup (Object *ob, struct bDeformGroup *dg, int vertnum,
168 float weight, int assignmode);
170 struct bDeformGroup *add_defgroup_name (Object *ob, char *name);
171 struct MDeformWeight *verify_defweight (struct MDeformVert *dv, int defgroup);
172 struct MDeformWeight *get_defweight (struct MDeformVert *dv, int defgroup);
175 #endif /* ED_MESH_H */