I'm trying to print back my nurbsSurface selection. But the following code only returns the last one. Not all. What am I doing wrong?
MFnDependencyNode depFn;
MString name;
MSelectionList list;
MGlobal::getActiveSelectionList( list );
MItSelectionList nurbsList( list, MFn::kNurbsSurface );
for ( ; !nurbsList.isDone(); nurbsList.next() )
{
MDagPath nurbs;
MObject node;
MObject component;
nurbsList.getDependNode( node );
depFn.setObject( node );
name = depFn.name();
MString fullPath;
nurbsList.getDagPath( nurbs, component );
fullPath = nurbs.fullPathName();
cout << "Name: " << name.asChar() << endl;
cout << "Path: " << fullPath.asChar() << endl;
}

Hey, why did it post like that? It makes it very difficult to read.
I tried my best to make this legible. I don’t know why there’s a colored section.
Hi Manny, check out the formatting help here: http://www.vfxoverflow.com/editing-help The markdown for a block of code is 4 indents. So indent all your code at least 4 spaces to get syntax hilighting