Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

[MAYA API] MItDependencyGraph won't iterate properly

$
0
0
I have a function that takes in an MObject and is supposed to iterate its children and print any nodes it comes across using MItDependencyGraph: void QueueChildrenTransforms(MObject& node) { MItDependencyGraph it ( node, MFn::kInvalid, MItDependencyGraph::kDownstream, MItDependencyGraph::kBreadthFirst, MItDependencyGraph::kNodeLevel ); MString s = "Found: "; for (; !it.isDone(); it.next()) { MFnDagNode child(it.currentItem()); s += child.name(); s += " "; } MGlobal::displayInfo(s); } When it is called, it only outputs the name of the node passed in to it. (If i use kInvalid as filter, which should iterate all nodes) It doesn't seem to make a difference changing the direction or traversal priority. I've tried different filteres as well such as kTransform and kMesh (these are the ones I want in the end, but using these filter seem to not output even the node passed in) I'm not sure if im using the correct type of iterator for this but this is the only one I've found that lets you define the root node of the search, which I need to do. So what am I missing here? End goal is to pass in a transform node, and iterate through its children in order to queue any transforms found for export.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>