View Full Version : Getting tangent space from mesh node

02 February 2008, 11:08 AM
I need to find a way to get tangent vector on each vertex of a ploy mesh. I looked up the nodes, and found out that under mesh node, there is an attribute called tangentSpace. However I dont know in what way to get this value returned as per vertex, or can it be done in MEL?

I am almost 100% positive maya has this vector, because if i turn on tangent display (displayTangent), it shows tangent (and also binormal) vectors on each vertex. Maybe I am not using the correct syntax?

02 February 2008, 06:33 PM
Hi, the tangentSpace attribute is simply an enum that determines how to the tangent and binormals are calculated. It is not going to tell you what you want to know. Look up the node reference under "mesh" for a more detailed explaination.
Your best bet for accessing these values per vertex is via the api, MFnMesh has getTangents() and getBinormals() methods.
It is also useful to note that the tangents and binormals are dependant on the meshes UVs.

02 February 2008, 02:59 AM
It is more for interest...but, the procedure maya uses is listed in the maya this string.

Appendix A: Tangent and binormal vectors

CGTalk Moderation
02 February 2008, 02:59 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.