Reference string input in python

   1591   3   1
User Avatar
Member
20 posts
Joined: April 2015
Offline
Hello,
i have issues when referencing the content of an input string inside python.
Can anybody give me a hint, thanks alot!
C.

Attachments:
reference_input.JPG (46.2 KB)

User Avatar
Member
53 posts
Joined: Feb. 2017
Offline
If you want to get the content of the parameter you should probably use hou.node(".").parm("CONTROLLER_NAME").eval() or hou.node(".").parm("CONTROLLER_NAME").rawValue() depending on what you need. Remember that the name and the label of a parameter are two different things. Reference the name, not the label (CONTROLLER_NAME in your screenshot is the label and might be the name too, but I cannot see that in the screenshot). Hope this helps, Cheers!
Technical VFX artist @ Housemarque / Sony Interactive Entertainment
User Avatar
Member
20 posts
Joined: April 2015
Offline
Thanks Robber for the quick reply.
If i print hou.node(".").parm("CONTROLLER_NAME").rawValue() i get the right string wich is obj/controller.
But if i use it to read an attribute from it it give me error.

Attachments:
reference_input2.JPG (49.5 KB)

User Avatar
Member
20 posts
Joined: April 2015
Offline
I finally got it working using:
controller = hou.node(cont)
Thanks alot for your help, much appreciated!
C
  • Quick Links