diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-01-11 14:31:44 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-01-11 14:51:19 +0400 |
commit | 8952f58375385a6e8a636aa1e86763e88fc68fc0 (patch) | |
tree | e0f82a77ed1e969b155517dd427505776dc6f2c1 /source/blender/makesdna/DNA_customdata_types.h | |
parent | 274b2590fb0eedaadbd5e588f629df7cb69ba0d8 (diff) |
Add tangent space computation/access from RNA (i.e. python).
This simply mimics code used for loopnormals, to enable py scripts to generate and access (temporary)
a tangent 3D vector and bitangent sign for each loop. Together with the split normals, this allow
to recreate a complete tangent space for normal mapping (bitangent = bitangent_sign * cross(normal, tangent)).
Expects all faces to be tri or quads.
Reviewed By: Brecht, campbellbarton
Differential Revision: https://developer.blender.org/D185
Diffstat (limited to 'source/blender/makesdna/DNA_customdata_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_customdata_types.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index f6516492b8f..325c2a8df54 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -63,9 +63,10 @@ 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[39]; /* runtime only! - maps types to indices of first layer of that type, + int typemap[40]; /* 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[1]; int totlayer, maxlayer; /* number of layers, size of layers array */ int totsize; /* in editmode, total size of all data layers */ void *pool; /* Bmesh: Memory pool for allocation of blocks */ @@ -117,7 +118,8 @@ enum { CD_MVERT_SKIN = 36, CD_FREESTYLE_EDGE = 37, CD_FREESTYLE_FACE = 38, - CD_NUMTYPES = 39, + CD_MLOOPTANGENT = 39, + CD_NUMTYPES = 40, }; /* Bits for CustomDataMask */ @@ -162,6 +164,7 @@ enum { #define CD_MASK_MVERT_SKIN (1LL << CD_MVERT_SKIN) #define CD_MASK_FREESTYLE_EDGE (1LL << CD_FREESTYLE_EDGE) #define CD_MASK_FREESTYLE_FACE (1LL << CD_FREESTYLE_FACE) +#define CD_MASK_MLOOPTANGENT (1LL << CD_MLOOPTANGENT) /* CustomData.flag */ enum { |