Milan Posted November 3, 2014 Share Posted November 3, 2014 (edited) Hey guys. For a script I'm working on (Python), I need to get the last bone in the chain (I'm expecting it doesn't branch out) from based on a given node. The whole thing runs as a callback on a node. So the point is, that I select the node (which triggers appearance changed callback) parse kwargs into my python module and in there I need to find the last descendant of this node (in chain terms, not node hierarchy terms). Ideally I'd like to get the first null after this node, but for now last node would be enough. Example: chain_root1 (null) | chain_bone1 (bone) | chain_bone2 (bone) | chain_bone3 (bone) | chain_end (null) I run callback from chain_bone1 and need chain_end chain-end as output. So far I didn't find a way to do it. All output functions in hou.Node seem to only give me 1 level of descendants. Any ideas? edit: another way to put it. I need the opposite of hou.Node.inputAncestors() Edited November 3, 2014 by Milan Quote Link to comment Share on other sites More sharing options...
holycause Posted November 3, 2014 Share Posted November 3, 2014 I would check the ouputs in a loop and once the outputs returns an empty tuple, you have you last node http://www.sidefx.com/docs/houdini13.0/hom/hou/Node#outputs Quote Link to comment Share on other sites More sharing options...
Shinjipierre Posted November 4, 2014 Share Posted November 4, 2014 Yup, recursion is your friend Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.