* \ingroup DNA
*/
-#ifndef DNA_MESHDATA_TYPES_H
-#define DNA_MESHDATA_TYPES_H
+#ifndef __DNA_MESHDATA_TYPES_H__
+#define __DNA_MESHDATA_TYPES_H__
#include "DNA_customdata_types.h"
#include "DNA_listBase.h"
struct Bone;
struct Image;
-/*tesselation face, see MLoop/MPoly for the real face data*/
+/*tessellation face, see MLoop/MPoly for the real face data*/
typedef struct MFace {
unsigned int v1, v2, v3, v4;
short mat_nr;
char flag, bweight;
} MVert;
-/* tesselation vertex color data.
+/* tessellation vertex color data.
* at the moment alpha is abused for vertex painting
* and not used for transparency, note that red and blue are swapped */
typedef struct MCol {
char a, r, g, b;
} MCol;
-/*new face structure, replaces MFace, which is now
- only used for storing tesselations.*/
+/* new face structure, replaces MFace, which is now
+ * only used for storing tessellations.*/
typedef struct MPoly {
/* offset into loop array and number of loops in the face */
int loopstart;
char flag, pad;
} MPoly;
-/*the e here is because we want to move away from
- relying on edge hashes.*/
+/* the e here is because we want to move away from
+ * relying on edge hashes.*/
typedef struct MLoop {
unsigned int v; /*vertex index*/
unsigned int e; /*edge index*/
typedef struct MTexPoly {
struct Image *tpage;
char flag, transp;
- short mode,tile,unwrap;
+ short mode, tile, unwrap;
} MTexPoly;
+/* can copy from/to MTexPoly/MTFace */
+#define ME_MTEXFACE_CPY(dst, src) \
+{ \
+ (dst)->tpage = (src)->tpage; \
+ (dst)->flag = (src)->flag; \
+ (dst)->transp = (src)->transp; \
+ (dst)->mode = (src)->mode; \
+ (dst)->tile = (src)->tile; \
+ (dst)->unwrap = (src)->unwrap; \
+}
+
typedef struct MLoopUV {
float uv[2];
int flag;
/* at the moment alpha is abused for vertex painting
* and not used for transparency, note that red and blue are swapped */
typedef struct MLoopCol {
- char a, r, g, b;
+ char r, g, b, a;
} MLoopCol;
+#define MESH_MLOOPCOL_FROM_MCOL(_mloopcol, _mcol) \
+{ \
+ MLoopCol *mloopcol__tmp = _mloopcol; \
+ const MCol *mcol__tmp = _mcol; \
+ mloopcol__tmp->r = mcol__tmp->b; \
+ mloopcol__tmp->g = mcol__tmp->g; \
+ mloopcol__tmp->b = mcol__tmp->r; \
+ mloopcol__tmp->a = mcol__tmp->a; \
+} (void)0
+
+
+#define MESH_MLOOPCOL_TO_MCOL(_mloopcol, _mcol) \
+{ \
+ const MLoopCol *mloopcol__tmp = _mloopcol; \
+ MCol *mcol__tmp = _mcol; \
+ mcol__tmp->b = mloopcol__tmp->r; \
+ mcol__tmp->g = mloopcol__tmp->g; \
+ mcol__tmp->r = mloopcol__tmp->b; \
+ mcol__tmp->a = mloopcol__tmp->a; \
+} (void)0
+
typedef struct MSticky {
float co[2];
} MSticky;
int type; /* EDITVERT/EDITEDGE/EDITFACE */
} MSelect;
-/*tesselation uv face data*/
+/*tessellation uv face data*/
typedef struct MTFace {
float uv[4][2];
struct Image *tpage;
float uv[4][2];
} OrigSpaceFace;
+typedef struct OrigSpaceLoop {
+ float uv[2];
+} OrigSpaceLoop;
+
typedef struct MDisps {
/* Strange bug in SDNA: if disps pointer comes first, it fails to see totdisp */
int totdisp;
- char pad[4];
+ int level;
float (*disps)[3];
+
+ /* Used for hiding parts of a multires mesh. Essentially the multires
+ * equivalent of MVert.flag's ME_HIDE bit.
+ *
+ * This is a bitmap, keep in sync with type used in BLI_bitmap.h */
+ unsigned int *hidden;
} MDisps;
/** Multires structs kept for compatibility with old files **/
int i;
} MRecast;
+typedef struct GridPaintMask {
+ /* The data array contains gridsize*gridsize elements */
+ float *data;
+
+ /* The maximum multires level associated with this grid */
+ unsigned int level;
+
+ int pad;
+} GridPaintMask;
+
+typedef enum MVertSkinFlag {
+ /* Marks a vertex as the edge-graph root, used for calculating
+ rotations for all connected edges (recursively.) Also used to
+ choose a root when generating an armature. */
+ MVERT_SKIN_ROOT = 1,
+
+ /* Marks a branch vertex (vertex with more than two connected
+ edges) so that it's neighbors are directly hulled together,
+ rather than the default of generating intermediate frames. */
+ MVERT_SKIN_LOOSE = 2
+} MVertSkinFlag;
+
+typedef struct MVertSkin {
+ /* Radii of the skin, define how big the generated frames
+ are. Currently only the first two elements are used. */
+ float radius[3];
+
+ /* MVertSkinFlag */
+ int flag;
+} MVertSkin;
+
/* mvert->flag (1=SELECT) */
#define ME_SPHERETEST 2
#define ME_VERT_TMP_TAG 4
/* medge->flag (1=SELECT)*/
#define ME_EDGEDRAW (1<<1)
#define ME_SEAM (1<<2)
-#define ME_FGON (1<<3)
+#define ME_FGON (1<<3) /* no longer used (now we have ngons), only defined so we can clear it */
/* reserve 16 for ME_HIDE */
#define ME_EDGERENDER (1<<5)
#define ME_LOOSEEDGE (1<<7)
/* #define ME_SEAM_LAST (1<<8) */ /* UNUSED */
#define ME_SHARP (1<<9) /* only reason this flag remains a 'short' */
+#define ME_FREESTYLE_EDGE (1<<10)
/* puno = vertexnormal (mface) */
#define ME_PROJXY 16
/* flag (mface) */
#define ME_SMOOTH 1
#define ME_FACE_SEL 2
+#define ME_FREESTYLE_FACE 4
/* flag ME_HIDE==16 is used here too */
#define ME_POLY_LOOP_PREV(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)])