Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


NameError: name 'hou' is not defined

Can any Python experts tell me why I get


  File "hou.session", line 9, in <module>
NameError: name 'hou' is not defined

with the following script entered in the Python Source Editor?

def set_opencl(parent_node, parm_value):
    for node in parent_node.allSubChildren():
        for p in node.parms():
            if p.name()=='opencl':
                except hou.PermissionError: #this handles the case that the parm is inside of a locked .otl

Houdini 16.0.597 Indie in Linux

Edited by art3mis

Share this post

Link to post
Share on other sites

The last line shouldn't go into the session module.  You should type it into a python shell to use that function from the session module.

It also shouldn't have a semicolon at the end.

Share this post

Link to post
Share on other sites

 That is a long-standing "bug", if you didn't put import hou  in hou.session module, it will work until first error (any python exception), once you get an error, hou module gets lost for some reason. So, just always do import hou.


Edited by Stalkerx777

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now