Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-01-11 14:31:44 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-01-11 14:51:19 +0400
commit8952f58375385a6e8a636aa1e86763e88fc68fc0 (patch)
treee0f82a77ed1e969b155517dd427505776dc6f2c1 /source/blender/blenkernel/intern/customdata.c
parent274b2590fb0eedaadbd5e588f629df7cb69ba0d8 (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/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 441a2b410ad..39b1a946720 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1168,7 +1168,9 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
/* 37: CD_FREESTYLE_EDGE */
{sizeof(FreestyleEdge), "FreestyleEdge", 1, NULL, NULL, NULL, NULL, NULL, NULL},
/* 38: CD_FREESTYLE_FACE */
- {sizeof(FreestyleFace), "FreestyleFace", 1, NULL, NULL, NULL, NULL, NULL, NULL}
+ {sizeof(FreestyleFace), "FreestyleFace", 1, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* 39: CD_MLOOPTANGENT */
+ {sizeof(float[4]), "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
};
/* note, numbers are from trunk and need updating for bmesh */
@@ -1184,7 +1186,7 @@ static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
/* 25-29 */ "CDMPoly", "CDMLoop", "CDShapeKeyIndex", "CDShapeKey", "CDBevelWeight",
/* 30-34 */ "CDSubSurfCrease", "CDOrigSpaceLoop", "CDPreviewLoopCol", "CDBMElemPyPtr", "CDPaintMask",
/* 35-36 */ "CDGridPaintMask", "CDMVertSkin",
- /* 37-38 */ "CDFreestyleEdge", "CDFreestyleFace"
+ /* 37-38 */ "CDFreestyleEdge", "CDFreestyleFace", "CDMLoopTangent",
};