davegreenwood
08-17-2009, 09:45 AM
Hi all,
from the api docs:
Per-polygon normals Polygonal objects store a normal for each polygon. These normals can be accessed via MItMeshPolygon::getNormal(normal) or MFnMesh::getPolygonNormal. So, a cube, which is comprised of 6 polygons would contain 6 such normals.
but the question is, how do you set per-polygon normals? There does not seem to be a MFnMesh::setPolygonNormal method... All the other set methods appear to be vertex normals, per-vertex or shared.
When I create my mesh the face normal depends on the direction I order my face vertices. I can set per vertex normals to produce correct shading, but the viewport displays face normals in the reverse direction (if the face is ordered so). It's not trivial for me to check the winding order for my mesh faces, and as I have to set normals anyway, it would be nice to do it in my plugin.
Of course creating meshes in the api is all quite new to me, so please don't assume I've considered the obvious... it probably isn't obvious to me:)
many thanks for any help
Dave.
from the api docs:
Per-polygon normals Polygonal objects store a normal for each polygon. These normals can be accessed via MItMeshPolygon::getNormal(normal) or MFnMesh::getPolygonNormal. So, a cube, which is comprised of 6 polygons would contain 6 such normals.
but the question is, how do you set per-polygon normals? There does not seem to be a MFnMesh::setPolygonNormal method... All the other set methods appear to be vertex normals, per-vertex or shared.
When I create my mesh the face normal depends on the direction I order my face vertices. I can set per vertex normals to produce correct shading, but the viewport displays face normals in the reverse direction (if the face is ordered so). It's not trivial for me to check the winding order for my mesh faces, and as I have to set normals anyway, it would be nice to do it in my plugin.
Of course creating meshes in the api is all quite new to me, so please don't assume I've considered the obvious... it probably isn't obvious to me:)
many thanks for any help
Dave.
