Jump to content

Get last node in chain


Milan

Recommended Posts

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 by Milan
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...