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 / Trying to exported selected objects blendshape data!
  RSS 2.0 ATOM  

Trying to exported selected objects blendshape data!
Rate this thread
 
61342
 
Permlink of this thread  
avatar
  • Total Posts: 4
  • Joined: 15 September 2006 05:32 PM

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(selMFn::kBlendShape);

    while ( !
it.isDone() )
    
{
        MDagPath morphpath
;
        
MObject morph;
        
it.getDagPath(morphpathmorph);

        
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



Replies: 0