Jump to content

Using hou.RopNode.render()?


JMR

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?

Link to comment
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. 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...