nahee Posted September 12, 2009 Share Posted September 12, 2009 (edited) Hi guys, How would one get every parameter of a node using Python? What I do for now is do a hou.parm("/obj/geo1/box1/ and then wait for the popup help to get a list of parameters but I can't use this in a script. So, I need a command to get a list of all parameters of a node. Thanks EDIT: nvm I found it its hou.node('/obj/box1').parms() the returned list is formated with <parmname in /path/to/node> though I wonder if one could get a simple list of parms and their values such as doing opparm -d /obj/geo1/box1 in python? Edited September 12, 2009 by nahee Quote Link to comment Share on other sites More sharing options...
symek Posted September 12, 2009 Share Posted September 12, 2009 Maybe like: [(parm.name(),parm.eval()) for parm in my_node.parms()] ? Quote Link to comment Share on other sites More sharing options...
nahee Posted September 12, 2009 Author Share Posted September 12, 2009 Maybe like: [(parm.name(),parm.eval()) for parm in my_node.parms()] ? works a charm! cheers Quote Link to comment Share on other sites More sharing options...
meshsmooth Posted September 15, 2009 Share Posted September 15, 2009 as for seeing popup help i find if you want to see the functions for the tx parameter on /obj/box01 you could type >>> hou.node('/obj/box01').parm('tx'). wait then hope for a popup to show you some options that wont come... or >>> testParm = hou.node('/obj/box01').parm('tx') >>> testParm. then wait for the popup help that will come. Now the Python terminal knows what kind of object testParm is and it can show you the functions for it. you can type in some letters to narrow down the choices. Hope this helps. Robert kelly Quote Link to comment Share on other sites More sharing options...
nahee Posted September 17, 2009 Author Share Posted September 17, 2009 Thanks Robert, I've figured it out. I was actually looking for parm.name() and parm.eval() which SYmek was kind enough to enlighten me with. As for the popup, the docs state that: For example, you will get popup help for n = hou.node('/obj'); n.parm( …but you won’t get it for… hou.node('/obj').parm( The reason is that the latter needs to evaluate hou.node('/obj') to determine what type of object it is, and that evaluation could have unintended side effects. For example, automatically evaluating file('~/.bashrc', 'w'). to list possible completions for the file object could have unintended effects. Hope that clears some voodoo out of the Houdini python popups. 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.