Accessing Locator Nodes [MEL]



 

 

Finding all Locators in a Scene

When retrieving locator nodes, it is important to understand that a locator node is nothing but a positional marker. You won't get anything directly useful from the locator node itself other than the parent transform which will give you it's location and orientation in space.

 

 

 

 

 


#include<maya/MFnDagNode.h>
#include<maya/MItDependencyNodes.h>

// create an iterator to go through all meshes
MItDependencyNodes it(MFn::kLocator);

while(!it.isDone())
{
 

// attach the function set to the object
MFnDagNode
fn(it.item());

// print mesh name
cout
<<"Locator "<< fn.name().asChar() <<endl;

// attach a function set to the first parent
MFnDagNode fnParent( fn.parent(0) );

// print name of parent transform
cout
<<"parent "<< fnParent.name().asChar() <<endl;

// get next locator
it.next();

}




 

 

What Next?

Transform Data

Animation Data

Animation Curves

index

Rob Bateman [2004]


[HOME] [MEL] [API]