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) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
30 #ifndef DNA_CUSTOMDATA_TYPES_H
31 #define DNA_CUSTOMDATA_TYPES_H
33 /* descriptor and storage for a custom data layer */
34 typedef struct CustomDataLayer {
35 int type; /* type of data in layer */
36 int offset; /* in editmode, offset of layer in block */
37 int flag; /* general purpose flag */
38 int active; /* number of the active layer of this type */
39 int active_rnd; /* number of the layer to render*/
41 char name[32]; /* layer name */
42 void *data; /* layer data */
45 /* structure which stores custom element data associated with mesh elements
46 * (vertices, edges or faces). The custom data is organised into a series of
47 * layers, each with a data type (e.g. MTFace, MDeformVert, etc.). */
48 typedef struct CustomData {
49 CustomDataLayer *layers; /* CustomDataLayers, ordered by type */
50 int totlayer, maxlayer; /* number of layers, size of layers array */
51 int totsize, pad; /* in editmode, total size of all data layers */
52 void *pool; /* for Bmesh: Memory pool for allocation of blocks*/
58 #define CD_MDEFORMVERT 2
63 #define CD_ORIGINDEX 7
66 #define CD_PROP_FLT 10
67 #define CD_PROP_INT 11
68 #define CD_PROP_STR 12
69 #define CD_ORIGSPACE 13 /* for modifier stack face location mapping */
71 #define CD_MTEXPOLY 15
73 #define CD_MLOOPCOL 17
74 #define CD_NUMTYPES 18
76 /* Bits for CustomDataMask */
77 #define CD_MASK_MVERT (1 << CD_MVERT)
78 #define CD_MASK_MSTICKY (1 << CD_MSTICKY)
79 #define CD_MASK_MDEFORMVERT (1 << CD_MDEFORMVERT)
80 #define CD_MASK_MEDGE (1 << CD_MEDGE)
81 #define CD_MASK_MFACE (1 << CD_MFACE)
82 #define CD_MASK_MTFACE (1 << CD_MTFACE)
83 #define CD_MASK_MCOL (1 << CD_MCOL)
84 #define CD_MASK_ORIGINDEX (1 << CD_ORIGINDEX)
85 #define CD_MASK_NORMAL (1 << CD_NORMAL)
86 #define CD_MASK_FLAGS (1 << CD_FLAGS)
87 #define CD_MASK_PROP_FLT (1 << CD_PROP_FLT)
88 #define CD_MASK_PROP_INT (1 << CD_PROP_INT)
89 #define CD_MASK_PROP_STR (1 << CD_PROP_STR)
90 #define CD_MASK_ORIGSPACE (1 << CD_ORIGSPACE)
91 #define CD_MASK_ORCO (1 << CD_ORCO)
92 #define CD_MASK_MTEXPOLY (1 << CD_MTEXPOLY)
93 #define CD_MASK_MLOOPUV (1 << CD_MLOOPUV)
94 #define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL)
99 /* indicates layer should not be copied by CustomData_from_template or
100 * CustomData_copy_data */
101 #define CD_FLAG_NOCOPY (1<<0)
102 /* indicates layer should not be freed (for layers backed by external data) */
103 #define CD_FLAG_NOFREE (1<<1)
104 /* indicates the layer is only temporary, also implies no copy */
105 #define CD_FLAG_TEMPORARY ((1<<2)|CD_FLAG_NOCOPY)