Using hou.RopNode.render?

   1526   5   1
User Avatar
Member
3 posts
Joined: Nov. 2018
Offline
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?
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
The node classes don't have constructors. You need to get an instance from a node directly.

something like this:
myrop = hou.node("/out/mantra1")
myrop.render()
User Avatar
Member
3 posts
Joined: Nov. 2018
Offline
That gives me “AttributeError: ‘NoneType’ object has no attribute ‘render’”.
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
JMR
That gives me “AttributeError: ‘NoneType’ object has no attribute ‘render’”.

Then the path given to hou.node() doesn't exist. node() takes a path to a node. Try dragging the node you want to render to the console. The dropped item will contain the actual path.
User Avatar
Staff
5156 posts
Joined: July 2005
Offline
That means the node the path references doesn't exist, or it's not a ROP node. Make sure the path to your ROP is correct.
User Avatar
Member
3 posts
Joined: Nov. 2018
Offline
Progress. Now the message I get is:
<bound method RopNode.render of <hou.RopNode of type ifd at /out/mantra1>>

I am using Houdini NC on a Mac, if that makes a difference.

Thanks!
  • Quick Links