PDA

View Full Version : visitenodes equivalent



ernpchan
10-09-2014, 05:20 PM
Has anyone made the equivalent of visitnodes for python?

visitnodes(<objectagent>,<processUDF>)
This function attempts to simplify the process of iterating down through object parenting hierarchies.The function requires two arguments. The first argument is an Object Agent reference for an object type capable of containing children--Mesh, Light, Camera or Bone.

The second argument is a character string that identifies a UDF in the script that will be called by LScript for each child object found in the hierarchy. The UDF must accept two arguments, the parent Object Agent and the child Object Agent. Be aware that multiple calls may be made with the same parent identity if that parent manages more than one child.


generic
{
visitnodes(Mesh("MasterObject"),"process_node");
}

process_node: parent, child
{
info(parent.name," -> ",child.name);
}

ernpchan
10-10-2014, 10:33 AM
Need to recursively call a function that crawls through the tree.
http://forums.newtek.com/showthread.php?143984-nextChild