|
Dashboard_avatar
Chris West
Oct 25, 2011
Quote Reply
Post id: 309029 Report Item
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 FindSelectedBlendShapes() {
MSelectionList sel = MSelectionList();
MGlobal::getActiveSelectionList(sel);
MItSelectionList it(sel, MFn::kBlendShape);
while ( !it.isDone() )
{
MDagPath morphpath;
MObject morph;
it.getDagPath(morphpath, morph);
MFnBlendShapeDeformer morphFn(morph);
DbgView("morph %s", morphFn.name().asChar());
it.next();
}
}
But the list is always empty. 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
|
|
|