Blender  V2.59
DNA_customdata_types.h
Go to the documentation of this file.
00001 /*
00002  * $Id: DNA_customdata_types.h 38866 2011-07-31 02:24:06Z nicholasbishop $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00034 #ifndef DNA_CUSTOMDATA_TYPES_H
00035 #define DNA_CUSTOMDATA_TYPES_H
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00042 typedef struct CustomDataLayer {
00043         int type;       /* type of data in layer */
00044         int offset;     /* in editmode, offset of layer in block */
00045         int flag;       /* general purpose flag */
00046         int active;     /* number of the active layer of this type */
00047         int active_rnd; /* number of the layer to render*/
00048         int active_clone; /* number of the layer to render*/
00049         int active_mask; /* number of the layer to render*/
00050         char pad[4];
00051         char name[32];  /* layer name */
00052         void *data;     /* layer data */
00053 } CustomDataLayer;
00054 
00055 typedef struct CustomDataExternal {
00056         char filename[240]; /* FILE_MAX */
00057 } CustomDataExternal;
00058 
00062 typedef struct CustomData {
00063         CustomDataLayer *layers;      /* CustomDataLayers, ordered by type */
00064         int totlayer, maxlayer;       /* number of layers, size of layers array */
00065         int totsize, pad;             /* in editmode, total size of all data layers */
00066         void *pool;                   /* Bmesh: Memory pool for allocation of blocks */
00067         CustomDataExternal *external; /* external file storing customdata layers */
00068 } CustomData;
00069 
00070 /* CustomData.type */
00071 #define CD_MVERT                0
00072 #define CD_MSTICKY              1
00073 #define CD_MDEFORMVERT  2
00074 #define CD_MEDGE                3
00075 #define CD_MFACE                4
00076 #define CD_MTFACE               5
00077 #define CD_MCOL                 6
00078 #define CD_ORIGINDEX    7
00079 #define CD_NORMAL               8
00080 #define CD_FLAGS                9
00081 #define CD_PROP_FLT             10
00082 #define CD_PROP_INT             11
00083 #define CD_PROP_STR             12
00084 #define CD_ORIGSPACE    13 /* for modifier stack face location mapping */
00085 #define CD_ORCO                 14
00086 #define CD_MTEXPOLY             15
00087 #define CD_MLOOPUV              16
00088 #define CD_MLOOPCOL             17
00089 #define CD_TANGENT              18
00090 #define CD_MDISPS               19
00091 #define CD_WEIGHT_MCOL  20 /* for displaying weightpaint colors */
00092 #define CD_ID_MCOL              21
00093 #define CD_TEXTURE_MCOL 22
00094 #define CD_CLOTH_ORCO   23
00095 #define CD_NUMTYPES             24
00096 
00097 /* Bits for CustomDataMask */
00098 #define CD_MASK_MVERT           (1 << CD_MVERT)
00099 #define CD_MASK_MSTICKY         (1 << CD_MSTICKY)
00100 #define CD_MASK_MDEFORMVERT     (1 << CD_MDEFORMVERT)
00101 #define CD_MASK_MEDGE           (1 << CD_MEDGE)
00102 #define CD_MASK_MFACE           (1 << CD_MFACE)
00103 #define CD_MASK_MTFACE          (1 << CD_MTFACE)
00104 #define CD_MASK_MCOL            (1 << CD_MCOL)
00105 #define CD_MASK_ORIGINDEX       (1 << CD_ORIGINDEX)
00106 #define CD_MASK_NORMAL          (1 << CD_NORMAL)
00107 #define CD_MASK_FLAGS           (1 << CD_FLAGS)
00108 #define CD_MASK_PROP_FLT        (1 << CD_PROP_FLT)
00109 #define CD_MASK_PROP_INT        (1 << CD_PROP_INT)
00110 #define CD_MASK_PROP_STR        (1 << CD_PROP_STR)
00111 #define CD_MASK_ORIGSPACE       (1 << CD_ORIGSPACE)
00112 #define CD_MASK_ORCO            (1 << CD_ORCO)
00113 #define CD_MASK_MTEXPOLY        (1 << CD_MTEXPOLY)
00114 #define CD_MASK_MLOOPUV         (1 << CD_MLOOPUV)
00115 #define CD_MASK_MLOOPCOL        (1 << CD_MLOOPCOL)
00116 #define CD_MASK_TANGENT         (1 << CD_TANGENT)
00117 #define CD_MASK_MDISPS          (1 << CD_MDISPS)
00118 #define CD_MASK_WEIGHT_MCOL     (1 << CD_WEIGHT_MCOL)
00119 #define CD_MASK_CLOTH_ORCO      (1 << CD_CLOTH_ORCO)
00120 
00121 /* CustomData.flag */
00122 
00123 /* indicates layer should not be copied by CustomData_from_template or
00124  * CustomData_copy_data */
00125 #define CD_FLAG_NOCOPY    (1<<0)
00126 /* indicates layer should not be freed (for layers backed by external data) */
00127 #define CD_FLAG_NOFREE    (1<<1)
00128 /* indicates the layer is only temporary, also implies no copy */
00129 #define CD_FLAG_TEMPORARY ((1<<2)|CD_FLAG_NOCOPY)
00130 /* indicates the layer is stored in an external file */
00131 #define CD_FLAG_EXTERNAL  (1<<3)
00132 /* indicates external data is read into memory */
00133 #define CD_FLAG_IN_MEMORY (1<<4)
00134 
00135 /* Limits */
00136 #define MAX_MTFACE 8
00137 #define MAX_MCOL   8
00138 
00139 #ifdef __cplusplus
00140 }
00141 #endif
00142 
00143 #endif