Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / SDK / Method for face centroid in MFnMesh?
  RSS 2.0 ATOM  

Method for face centroid in MFnMesh?
Rate this thread
 
57338
 
Permlink of this thread  
avatar
  • Total Posts: 2
  • Joined: 26 June 2011 05:04 AM

Can I get face centroid for a particular polygon from MFnMesh information?

MFnMesh meshFn(fMesh);
meshFn.getPolygonNormal(....) gives the normal for the particular polygon.

My question is how can I obtain the centroid for each polygon from MFnMesh data?



Replies: 1
/img/forum/dark/default_avatar.png

Hi,

Look instead at the class method: MItMeshPolygon.center()
This will require you to iterate through the polys on your mesh, but there is not method for getting the centre of a specific polygon.

I did write this a while back - it’s plain ol’ python, but it may help:

http://mayastation.typepad.com/m...-center-of-a-polygon.html

Owen

Author: owen burgess

Replied: 07 July 2011 09:53 PM  
avatar

Hi,

Try looking instead at MItMeshPolygon.center()
This iterates over your mesh and is not exactly what you want, but I don’t think there is a method for querying the centre of a specific face.

If you can live with plain ol’ python, I did write this a while back:

http://mayastation.typepad.com/m...-center-of-a-polygon.html

cheers,
Owen



Maya support specialist
Autodesk

Replies: 0