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/blenkernel/BKE_mesh.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/blenkernel/BKE_mesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 500b3d8cab5..e82689ec339 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -58,6 +58,7 @@ struct UvVertMap; struct UvMapVert; struct UvElementMap; struct UvElement; +struct ReportList; #ifdef __cplusplus extern "C" { @@ -172,6 +173,12 @@ void BKE_mesh_normals_loop_split( struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, float (*r_loopnors)[3], const int numLoops, struct MPoly *mpolys, float (*polynors)[3], const int numPolys, float split_angle); +void BKE_mesh_loop_tangents_ex( + struct MVert *mverts, const int numVerts, struct MLoop *mloops, float (*r_looptangent)[4], float (*loopnors)[3], + struct MLoopUV *loopuv, const int numLoops, struct MPoly *mpolys, const int numPolys, + struct ReportList *reports); +void BKE_mesh_loop_tangents( + struct Mesh *mesh, const char *uvmap, float (*r_looptangents)[4], struct ReportList *reports); void BKE_mesh_calc_poly_normal( struct MPoly *mpoly, struct MLoop *loopstart, |