Using hou.pwd() from hda embedded in another hda

   1893   0   1
User Avatar
Member
119 posts
Joined:
Offline
Hi Folks,

when I have two HDA's with buttons using callbacks that rely on hou.pwd() there is a problem when one is embedded in the other since hou.pwd() will resolve first to the hda that held the button I clicked.
The solution I'm using at the moment is to hou.setPwd(node) before calling anything defined in the embedded hdas hdaModule().
This works fine and all, but I'm thinking that there must be a better way to find out where I'm calling from rather than hou.pwd() and avoid the need to set my pwd. Because if someone decides to use these and doesn't know to do this then the only error they'll get is that object with a type ‘None’ doesn't contain a method X, etc. Or something very similar to that anyway. And it will point the error at the embedded hda and not the script they are working on.

cheers
_chip
  • Quick Links