Added SkinNode DNA and customdata.
authorNicholas Bishop <nicholasbishop@gmail.com>
Sun, 31 Jul 2011 02:03:21 +0000 (02:03 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sun, 31 Jul 2011 02:03:21 +0000 (02:03 +0000)
source/blender/blenkernel/intern/customdata.c
source/blender/makesdna/DNA_customdata_types.h
source/blender/makesdna/DNA_meshdata_types.h

index 8d19322..1f18c78 100644 (file)
@@ -805,7 +805,15 @@ static void layerDefault_mcol(void *data, int count)
                mcol[i] = default_mcol;
 }
 
-
+static void layerDefault_skin(void *data, int count)
+{
+       SkinNode *n = data;
+       int i;
+       
+       for(i = 0; i < count; i++) {
+               n[i].radius = 1;
+       }
+}
 
 static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
        {sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL},
@@ -843,7 +851,8 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
         layerSwap_mcol, layerDefault_mcol},
         {sizeof(MCol)*4, "MCol", 4, "TexturedCol", NULL, NULL, layerInterp_mcol,
         layerSwap_mcol, layerDefault_mcol},
-       {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}
+       {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
+       {sizeof(SkinNode), "SkinNode", 1, "Skin", NULL, NULL, NULL, NULL, layerDefault_skin}
 };
 
 static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
@@ -851,7 +860,7 @@ static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
        /*   5-9 */ "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags",
        /* 10-14 */ "CDMFloatProperty", "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco",
        /* 15-19 */ "CDMTexPoly", "CDMLoopUV", "CDMloopCol", "CDTangent", "CDMDisps",
-       /* 20-23 */"CDWeightMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco"
+       /* 20-24 */ "CDWeightMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco", "CDSkinNode"
 };
 
 const CustomDataMask CD_MASK_BAREMESH =
@@ -859,10 +868,12 @@ const CustomDataMask CD_MASK_BAREMESH =
 const CustomDataMask CD_MASK_MESH =
        CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE |
        CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE | CD_MASK_MCOL |
-       CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR | CD_MASK_MDISPS;
+       CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR | CD_MASK_MDISPS |
+       CD_MASK_SKIN_NODE;
 const CustomDataMask CD_MASK_EDITMESH =
        CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE |
-       CD_MASK_MCOL|CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR | CD_MASK_MDISPS;
+       CD_MASK_MCOL|CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR | CD_MASK_MDISPS |
+       CD_MASK_SKIN_NODE;
 const CustomDataMask CD_MASK_DERIVEDMESH =
        CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE |
        CD_MASK_MCOL | CD_MASK_ORIGINDEX | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_CLOTH_ORCO |
index cdfcf46..061e946 100644 (file)
@@ -92,7 +92,8 @@ typedef struct CustomData {
 #define CD_ID_MCOL             21
 #define CD_TEXTURE_MCOL        22
 #define CD_CLOTH_ORCO  23
-#define CD_NUMTYPES            24
+#define CD_SKIN_NODE           24
+#define CD_NUMTYPES            25
 
 /* Bits for CustomDataMask */
 #define CD_MASK_MVERT          (1 << CD_MVERT)
@@ -117,6 +118,7 @@ typedef struct CustomData {
 #define CD_MASK_MDISPS         (1 << CD_MDISPS)
 #define CD_MASK_WEIGHT_MCOL    (1 << CD_WEIGHT_MCOL)
 #define CD_MASK_CLOTH_ORCO     (1 << CD_CLOTH_ORCO)
+#define CD_MASK_SKIN_NODE      (1 << CD_SKIN_NODE)
 
 /* CustomData.flag */
 
index e3510b3..a71c497 100644 (file)
@@ -184,6 +184,11 @@ typedef struct PartialVisibility {
        unsigned int totface, totedge, totvert, pad;
 } PartialVisibility;
 
+typedef struct SkinNode {
+       float radius;
+       int pad;
+} SkinNode;
+
 /* mvert->flag (1=SELECT) */
 #define ME_SPHERETEST          2
 #define ME_VERT_TMP_TAG                4