View Full Version : Maya API programming question. please help.

10 October 2003, 09:08 PM
Hello. I'm trying to make my first plugin for maya.And I have a question:
I'm getting all selected objects (polys) and then, trying to iterate over all faces of them. I don't understand one little thing:
How can I take MObject poiter to objects that I'm interating over.

Please look here:

MItSelectionList iter (selection, MFn::kMesh);
for (; !iter.isDone();
MItMeshPolygon faceIter (mesh, &stat);
for (;!faceIter.isDone();

I should fed MObject mesh to MItMeshPolygon, but i have only "iter". From where I have to take MObject pointer?

Should I use MDagPath::node method?

Sorry, if it's hard to read, but i'm from moscow and it's hard for me to explain things that i don't understand in another language.
Thank you.

10 October 2003, 11:20 PM
use MitSelectionList::getDagPath(MDagPath, MObject) to get your dagpath and object for the current iteration.

Look at the redoit code in convertEdgesToFaces.cpp in the devkit/plug-ins directory for example code.

10 October 2003, 11:35 PM
cool. sbp, thank you very much!
i think that i'll have other problems in future, can I ask you further? I'm going to fight alone, but sometimes i just can't jump over some walls.


CGTalk Moderation
01 January 2006, 08:00 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.