Hello all!
I’m beginning my adventure into Python for Maya so I can dig into the Maya API. I am currently trying translate some API code I found on the net as a learning device. This code is:
/// \brief this function simply selects all nodes in the scene of the specified type
/// \param type - the maya type of the nodes to select
///
void SelectItems(MFn::Type type) {
// iterate over all nodes of the specified type
MItDependencyNodes it(type);
while(!it.isDone())
{
// get the object the iterator is referencing
MObject obj = it.item();
// select the node
MGlobal::select( obj, MGlobal::kAddToList );
// move to next item
it.next();
}
}
The place where I’m getting stuck right now, is at the MItDependencyNodes call, as it requires two arguments, the second being a pointer. Can anyone tell me the proper formatting for this type of call? Also, if we are using the MScriptUtil to change it to a pointer, how are you determining which pointer to convert it to based on the documents?
Sorry if these seem like silly questions. Diving into the API docs and fully understanding them has been a slow process.
-csa