Python command to list all nodes in houdini?

   7463   6   1
User Avatar
Member
33 posts
Joined: Feb. 2009
Offline
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
User Avatar
Member
1540 posts
Joined: Nov. 2006
Offline
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.
Graham Thompson, Pipeline Supervisor @ Digital Domain
User Avatar
Member
6715 posts
Joined: July 2005
Offline
There's also the “opstat” hscript command.
User Avatar
Member
1 posts
Joined: Sept. 2012
Offline
hou.node(“/”).allSubChildren()
User Avatar
Member
1 posts
Joined: April 2014
Offline
list = hou.node(“/obj/”).allSubChildren()
for i in list:
print i
User Avatar
Member
372 posts
Joined: Oct. 2011
Offline
print i.type()
http://www.racecar.no [racecar.no]
User Avatar
Member
2808 posts
Joined: Sept. 2007
Offline
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!
Edited by goldleaf - July 14, 2018 23:48:33

Attachments:
screenshot-window-2018-07-14-202402.png (85.0 KB)
screenshot-window-2018-07-14-202410.png (98.2 KB)

I'm o.d.d.
  • Quick Links