animknight Posted September 26, 2013 Share Posted September 26, 2013 Hey guys I get a KeyError when I triy to declare a variable and set it to kwargs['node'] in the Python module section in my Digital asset. Why is this happening ? Thanks -J Quote Link to comment Share on other sites More sharing options...
graham Posted September 26, 2013 Share Posted September 26, 2013 Python modules are tied to a node type, not an instance of a node. Depending on what you are trying to do, using hou.pwd() may work, though that is not guaranteed to return an instance of the node type. Usually you want to declare functions inside your Python Module and pass any nodes you want those functions to act on as parameters. Quote Link to comment Share on other sites More sharing options...
animknight Posted September 26, 2013 Author Share Posted September 26, 2013 Thanks Graham. I was trying to pass the node instance as an argument to the class and use that in all the functions inside the class. Is there a way I can do this ? I tried using hou.pwd() but if my DA is locked then it returns the root '/'. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.