2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
27 #ifndef DNA_MESH_TYPES_H
28 #define DNA_MESH_TYPES_H
30 /** \file DNA_mesh_types.h
35 #include "DNA_listBase.h"
37 #include "DNA_customdata_types.h"
61 struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
65 struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
67 struct Material **mat;
69 /*new face structures*/
71 struct MTexPoly *mtpoly;
73 struct MLoopUV *mloopuv;
74 struct MLoopCol *mloopcol;
76 /*mface stores the tesselation (triangulation) of the mesh,
77 real faces are now stored in nface.*/
78 struct MFace *mface; /* array of mesh object mode faces for tesselation */
79 struct MTFace *mtface; /* store tesselation face UV's and texture here */
80 struct TFace *tface; /* depecrated, use mtface */
81 struct MVert *mvert; /* array of verts */
82 struct MEdge *medge; /* array of edges */
83 struct MDeformVert *dvert; /* deformgroup vertices */
85 /* array of colors for the tesselated faces, must be number of tesselated
86 faces * 4 in length */
88 struct MSticky *msticky;
89 struct Mesh *texcomesh;
90 struct MSelect *mselect;
92 struct BMEditMesh *edit_btmesh; /* not saved in file! */
94 struct CustomData vdata, edata, fdata, pdata, ldata;
96 int totvert, totedge, totface, totpoly, totloop, totselect;
98 /* the last selected vertex/edge/face are used for the active face however
99 * this means the active face must always be selected, this is to keep track
100 * of the last selected face and is similar to the old active face flag where
101 * the face does not need to be selected, -1 is inactive */
104 /* texture space, copied as one block in editobject.c */
109 short texflag, drawflag;
110 short smoothresh, flag;
112 short subdiv DNA_DEPRECATED, subdivr DNA_DEPRECATED;
113 char subsurftype DNA_DEPRECATED; /* only kept for backwards compat, not used anymore */
118 struct Multires *mr DNA_DEPRECATED; /* deprecated multiresolution modeling data, only keep for loading old files */
121 /* deprecated by MTFace, only here for file reading */
122 typedef struct TFace {
123 void *tpage; /* the faces image for the active UVLayer */
127 short mode, tile, unwrap;
130 /* **************** MESH ********************* */
136 #define ME_EDIT_MIRROR_X (1 << 0)
137 #define ME_EDIT_MIRROR_Y (1 << 1) // unused so far
138 #define ME_EDIT_MIRROR_Z (1 << 2) // unused so far
140 #define ME_EDIT_PAINT_MASK (1 << 3)
141 #define ME_EDIT_MIRROR_TOPO (1 << 4)
142 #define ME_EDIT_VERT_SEL (1 << 5)
144 /* we cant have both flags enabled at once,
145 * flags defined in DNA_scene_types.h */
146 #define ME_EDIT_PAINT_SEL_MODE(_me) ( \
147 (_me->editflag & ME_EDIT_PAINT_MASK) ? SCE_SELECT_FACE : \
148 (_me->editflag & ME_EDIT_VERT_SEL) ? SCE_SELECT_VERTEX : \
153 /* #define ME_ISDONE 1 */
154 #define ME_DEPRECATED 2
155 #define ME_TWOSIDED 4
156 #define ME_UVEFFECT 8
157 #define ME_VCOLEFFECT 16
158 #define ME_AUTOSMOOTH 32
160 #define ME_SUBSURF 128
161 #define ME_OPT_EDGES 256
162 #define ME_DS_EXPAND 512
164 /* me->drawflag, short */
165 #define ME_DRAWEDGES (1 << 0)
166 #define ME_DRAWFACES (1 << 1)
167 #define ME_DRAWNORMALS (1 << 2)
168 #define ME_DRAW_VNORMALS (1 << 3)
170 #define ME_ALLEDGES (1 << 4)
171 #define ME_HIDDENEDGES (1 << 5)
173 #define ME_DRAWCREASES (1 << 6)
174 #define ME_DRAWSEAMS (1 << 7)
175 #define ME_DRAWSHARP (1 << 8)
176 #define ME_DRAWBWEIGHTS (1 << 9)
178 #define ME_DRAWEXTRA_EDGELEN (1 << 10)
179 #define ME_DRAWEXTRA_FACEAREA (1 << 11)
180 #define ME_DRAWEXTRA_FACEANG (1 << 12)
182 /* debug only option */
183 #define ME_DRAWEXTRA_INDICES (1 << 13)
186 #define G_DRAWEDGES (1 << 18)
187 #define G_DRAWFACES (1 << 7)
188 #define G_DRAWNORMALS (1 << 6)
189 #define G_DRAW_VNORMALS (1 << 14)
191 #define G_ALLEDGES (1 << 11)
192 #define G_HIDDENEDGES (1 << 21)
194 #define G_DRAWCREASES (1 << 19)
195 #define G_DRAWSEAMS (1 << 20)
196 #define G_DRAWSHARP (1 << 28)
197 #define G_DRAWBWEIGHTS (1 << 31)
199 #define G_DRAW_EDGELEN (1 << 22)
200 #define G_DRAW_FACEAREA (1 << 23)
201 #define G_DRAW_EDGEANG (1 << 24)
207 #define ME_CC_SUBSURF 0
208 #define ME_SIMPLE_SUBSURF 1
210 #define MESH_MAX_VERTS 2000000000L
212 /* this is so we can save bmesh files that load in trunk, ignoring NGons
213 * will eventually be removed */
215 #define USE_MESH_FORWARDS_COMAT