hdaModule calls from other nodes

   1773   1   1
User Avatar
Member
897 posts
Joined: July 2018
Offline
say this is the python code on a hdaModule:

def outTest():
thisNode = hou.pwd()
myParm = thisNode.parm('aParm')
return myParm


calling this from a string parameter on the node by
`pythonexprs(“hou.node('.').hdaModule().outTest()”)`
gives me the expected output:
<hou.Parm ele in /out/myHDA>
but when calling it from another nodes attribute or hdaModule in another directory I get “none”
If I want to output the value of “thisNode” it behaves as expected.

How do I fix this?

My guess is that thisNode is a relative path and can't find “myHDA” when it's under another parent but I haven't found a way to test this.
B.Henriksson, DICE
User Avatar
Member
897 posts
Joined: July 2018
Offline
I think I found the solution in an old post here, don't use relative paths, pass a node path to the function instead.

(just a note, it might be a good idea for all of the examples to stop using relative paths if they're a bad approach)
B.Henriksson, DICE
  • Quick Links