Jump to content
JMR

Using hou.RopNode.render()?

Recommended Posts

I'm learning command-line rendering through Python, but I can't get RopNode to work. When I use hou.RopNode.render() I get "unbound method render() must be called with RopNode instance as first argument (got nothing instead)". When I try to add "mantra1" in the parentheses (the file I want to render is the one open) I get the same error except "got str instance instead" in the parentheses. For all my Googling I haven't found any examples of how to successfully use this. What am I missing?

Share this post


Link to post
Share on other sites

HOM, like Python, is strongly object oriented, thus most methods live and operate on objects. hou.RopNode.render() is a prototype of a class method, and similarly to most cases, you can't call it directly. It's meant to be used as follows:

ropnode = hou.node("/out/mantra1")
ropnode.render()
#btw:
print(type(ropnode))
<class 'hou.RopNode'>

render() is the same method you saw in hou.RopNode, but it's now bounded to the instance of a node of type hou.RopNode

 

ps There are some methods free standing in hou module which don't belong to any objects, but that's different story. 

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

×