Search - User list
Full Version: Python command to list all nodes in houdini?
Root » Houdini Lounge » Python command to list all nodes in houdini?
abahena
Hi,
Im doing a server in python but I'm not familiar with python under Houdini. Can I get all nodes from houdini and its type.
Im doing a statistical report of houdini scenes.
thanks,
Alexis
graham
There is no command that just gives you all the nodes. You will have to recursively traverse the entire scene to find all nodes and their children. There is an example of doing just that in the help.
edward
There's also the “opstat” hscript command.
paul_winex
hou.node(“/”).allSubChildren()
Alex3dac
list = hou.node(“/obj/”).allSubChildren()
for i in list:
print i
bonsak
print i.type()
goldleaf
You can also list all of the node types from a version of Houdini with this command:

hython $HFS/houdini/python2.7libs/opnode_sum.py > all_nodes.txt

If you run that from two different versions of hython, you can diff the results. For example, this compares 16.5.323 and 16.5.473:


And if you need to, you can add this flag to get all of the parameters and values, and diff those too:

hython $HFS/houdini/python2.7libs/opnode_sum.py -p > all_nodes_and_parms.txt



The version of hython being run is was really matters; you'll need to run the hython in each version of Houdini you wish to print out the list for.

Hope that helps!
mjdynamic
Thanks goldleaf. This is what I was looking for so long.
Cicuta
Hi!

I am using a parser method that seems pretty neat in case you only want a more controlled search: https://www.sidefx.com/docs/houdini/hom/nodesearch.html [www.sidefx.com]

In terms of performance, to my understanding this looks faster than children() or allSubChildren() but perhaps someone can confirm that (?)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB