'ObjNode' object has no attribute 'setParm'

   3270   9   1
User Avatar
Member
5 posts
Joined: Oct. 2016
Offline
Hello,

I try to start writening a script to speed up work in Houdini and I struggle with it at the very begingn. As it is shown on my screenshot, for start I wanted to reset values ​​of my parameters to value of 0. But i get error shown on seceond screenshot.
My goal is to write few scripts that will help me to reset parameters of specific parts of the body.

I will be grateful for your help



Attachments:
Screenshot 2020-03-23 at 17.15.02.png (1011.9 KB)
Screenshot 2020-03-23 at 17.30.34.png (39.9 KB)

User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
Is this what you were trying to do:

https://www.sidefx.com/docs/houdini/hom/hou/Node.html#setParms [www.sidefx.com]
User Avatar
Member
5 posts
Joined: Oct. 2016
Offline
Yes, this is it.
I tried to modify it and now I get no error but nothing happens when I use the script. I attach screenshot below.
Edited by maxsniezek - March 25, 2020 06:17:34

Attachments:
Screenshot 2020-03-25 at 11.14.26.png (32.8 KB)

User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
What are you trying to do?

The result of your comparison “node == 0” might be True or False, but you are not doing anything with that information - so what do you expect it to do?
What you ARE doing is: you are reading out a value from the node's parameter “spine_squat_front”. Then you are comparing that read out value to 0, done. There is no “functionality” in your function.

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
5 posts
Joined: Oct. 2016
Offline
Thanks for Yur reply. I see my mistake with ( == ) changed it to ( = ) still doesn't work. What i want to do is to read out value of parameter in this case “spine_squat_front” and change it (reset) to value of 0. The goal is to write scripts that can reset many(specific) parameters at once.

Max
Edited by maxsniezek - March 25, 2020 10:58:04
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
My apologies - that's not how Python or Houdini work. If you assign a value to a variable from an external source, changing the value in that variable does not change the setting in the source …

What you want to do is change the value AT THE SOURCE (the node in this case), e.g. by
hou.node("/obj/tiger_rig_anim").setParms({"spine_squat_front":0})
… no need to read out the value before setting it.


Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
8525 posts
Joined: July 2007
Offline
or if it's just a single parameter you can use .set() directly
hou.node("/obj/tiger_rig_anim").parm("spine_squat_front").set(0)
or
hou.parm("/obj/tiger_rig_anim/spine_squat_front").set(0)
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
5 posts
Joined: Oct. 2016
Offline
Okay I got it. So changed the code tried both solutions and I got errors shown below. I tried to google that error and it seems that i try to work with instance that has type None or doesn't exist ?

Attachments:
Screenshot 2020-03-25 at 17.53.17.png (80.7 KB)
Screenshot 2020-03-25 at 17.53.07.png (80.6 KB)

User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
In your screenshot at the top of this thread, the node is called “tiger_rig_anim1”. Have you tried that?

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
5 posts
Joined: Oct. 2016
Offline
My oversight. Thank You very much for Your help, now working just fine
  • Quick Links