Hello,
I have a bone rig. I would like to get the list of all the bones, selecting only the master (null).
I can't see how to do it with Python.
Thanks for your help.
Vincent
Python : get all the nodes of a hierarchie
5358 4 2- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
- GuillaumeJ
- Member
- 23 posts
- Joined: Sept. 2015
- Offline
Hi,
You can recursively call hou.node(“path/to_your/node”).outputs() for that
outputs() returns all output nodes found for the given node.
You can recursively call hou.node(“path/to_your/node”).outputs() for that
outputs() returns all output nodes found for the given node.
http://cgtoolbox.com/ [cgtoolbox.com] Houdini tools and scripts for free ! :)
- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
- GuillaumeJ
- Member
- 23 posts
- Joined: Sept. 2015
- Offline
Here is a small example if that can help you
def findOutputs(node, result):
outputs = node.outputs()
if outputs:
result += outputs
for n in outputs:
findOutputs(n, result)
startNode = hou.selectedNodes()
result =
findOutputs(startNode, result)
all the output nodes will be stored in the result list
def findOutputs(node, result):
outputs = node.outputs()
if outputs:
result += outputs
for n in outputs:
findOutputs(n, result)
startNode = hou.selectedNodes()
result =
findOutputs(startNode, result)
all the output nodes will be stored in the result list
http://cgtoolbox.com/ [cgtoolbox.com] Houdini tools and scripts for free ! :)
- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
-
- Quick Links