Jump to content

set value for all parms in a node


teapot

Recommended Posts

Hello,

I want to create button to set all my parameters to some value [for example 1].

I did something like this:


x = hou.node('/obj/geo')
x.parmTuple(str(p.name() for p in x.parmTuples()).set(1,1,1)

[/CODE]

AttributeError: 'NoneType' object has no attribute 'set'

I suppose it is ultra simple [to set value for all parms] but I can't figue out how to deal with it.

Edited by teapot
Link to comment
Share on other sites

maybe something like this?


x = hou.node('/obj/geo1')
for p in x.parms():
if type(p.eval()).__name__ == "str":
p.set( "1" )
else:
p.set( 1 )

[/CODE]

[size=4]and if you are sure that all your parms are float and ints then you don't have to check for strings[/size]

Edited by anim
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...