[Bf-blender-cvs] [ec72093d2e7] hair_object: New customdata types for base hair curve data.

Lukas Tönne noreply at git.blender.org
Sun Nov 25 10:51:22 CET 2018


Commit: ec72093d2e70fadf8aaa7dfd058a4ec989d3f527
Author: Lukas Tönne
Date:   Sun Nov 18 13:33:42 2018 +0000
Branches: hair_object
https://developer.blender.org/rBec72093d2e70fadf8aaa7dfd058a4ec989d3f527

New customdata types for base hair curve data.

===================================================================

M	source/blender/blenkernel/intern/customdata.c
M	source/blender/makesdna/DNA_customdata_types.h

===================================================================

diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 765c42b39b0..d92153af862 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -38,6 +38,7 @@
 
 #include "DNA_customdata_types.h"
 #include "DNA_meshdata_types.h"
+#include "DNA_hair_types.h"
 #include "DNA_ID.h"
 
 #include "BLI_utildefines.h"
@@ -1291,6 +1292,12 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
 	{sizeof(short[4][3]), "", 0, NULL, NULL, NULL, NULL, layerSwap_flnor, NULL},
 	/* 41: CD_CUSTOMLOOPNORMAL */
 	{sizeof(short[2]), "vec2s", 1, NULL, NULL, NULL, NULL, NULL, NULL},
+	/* 42: CD_HAIRVERT */
+	{sizeof(HairFiberVertex), "HairFiberVertex", 1, NULL, NULL, NULL, NULL, NULL, NULL},
+	/* 43: CD_HAIRCURVE */
+	{sizeof(HairFiberCurve), "HairFiberCurve", 1, NULL, NULL, NULL, NULL, NULL, NULL},
+	/* 44: CD_HAIRFOLLICLE */
+	{sizeof(HairFollicle), "HairFollicle", 1, NULL, NULL, NULL, NULL, NULL, NULL},
 };
 
 
@@ -1307,6 +1314,7 @@ static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
 	/* 35-36 */ "CDGridPaintMask", "CDMVertSkin",
 	/* 37-38 */ "CDFreestyleEdge", "CDFreestyleFace",
 	/* 39-41 */ "CDMLoopTangent", "CDTessLoopNormal", "CDCustomLoopNormal",
+	/* 42-44 */ "CDHairFiberVertex", "CDHairFiberCurve", "CDHairFollicle",
 };
 
 
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 0e0b1d669d9..a6b28b7ee25 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -63,10 +63,9 @@ typedef struct CustomDataExternal {
  * layers, each with a data type (e.g. MTFace, MDeformVert, etc.). */
 typedef struct CustomData {
 	CustomDataLayer *layers;      /* CustomDataLayers, ordered by type */
-	int typemap[42];              /* runtime only! - maps types to indices of first layer of that type,
+	int typemap[45];              /* runtime only! - maps types to indices of first layer of that type,
 	                               * MUST be >= CD_NUMTYPES, but we cant use a define here.
 	                               * Correct size is ensured in CustomData_update_typemap assert() */
-	int pad_i1;
 	int totlayer, maxlayer;       /* number of layers, size of layers array */
 	int totsize;                  /* in editmode, total size of all data layers */
 	struct BLI_mempool *pool;     /* (BMesh Only): Memory pool for allocation of blocks */
@@ -130,7 +129,11 @@ typedef enum CustomDataType {
 	CD_TESSLOOPNORMAL   = 40,
 	CD_CUSTOMLOOPNORMAL = 41,
 
-	CD_NUMTYPES         = 42
+	CD_HAIRVERT         = 42,
+	CD_HAIRCURVE        = 43,
+	CD_HAIRFOLLICLE     = 44,
+
+	CD_NUMTYPES         = 45
 } CustomDataType;
 
 /* Bits for CustomDataMask */



More information about the Bf-blender-cvs mailing list