Jump to content

python getting node parms


nahee

Recommended Posts

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

as for seeing popup help i find if you want to see the functions for the tx parameter on /obj/box01 you could type

&gt;&gt;&gt; hou.node('/obj/box01').parm('tx').

wait then hope for a popup to show you some options that wont come... or

&gt;&gt;&gt; testParm = hou.node('/obj/box01').parm('tx')
&gt;&gt;&gt; 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

Link to comment
Share on other sites

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.

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...