PDA

View Full Version : Cant get BlendShape info


spookycat
10-25-2011, 09:18 PM
Hi There
I am very new to the Maya API and I am trying to do a very simple exporter of blendshapes for a selected object but I can not for the life of me get it to work. The simple function I have is:
void NewWay()
{
MSelectionList selection;
selection.clear();
MGlobal::getActiveSelectionList(selection);
MItSelectionList iter(selection);

MDagPath meshDagPath;
MObject obj;
iter.setFilter(MFn::kBlendShape);

for ( iter.reset(); !iter.isDone(); iter.next() )
{
iter.getDagPath(meshDagPath, obj);
iter.getDependNode(obj);
}
}
But the list is always empty if I want MFn::kBlendShapes, for everything else I get the expected list, the return status is always success, is there something special about getting BlendShapes that I am missing. Can anyone suggest what I am doing wrong? Oddly if I just do a simple iterate over the scene with:
void Works()
{
MItDependencyNodes it(MFn::kBlendShape);

while(!it.isDone())
{
MFnBlendShapeDeformer fn(it.item());

it.next();
}
}
Then I get all the blendshapes, but I need to only get the blendshapes for selected objects. Can anyone help?
Thanks
Chris

CGTalk Moderation
10-25-2011, 09:18 PM
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.