How to node with the render flag from a copnet?

   1737   4   1
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
Using Python, is there a way to select the node with the render flag set from a copnet?
User Avatar
Member
8527 posts
Joined: July 2007
Online
def getRenderNode(subnet):
    for node in subnet.children():
        if node.isRenderFlagSet():
            return node
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
tamte
def getRenderNode(subnet):
    for node in subnet.children():
        if node.isRenderFlagSet():
            return node
Drat. I was hoping there would be a method that wouldn't require iterating over all the nodes. Thanks for the code though.
User Avatar
Member
8527 posts
Joined: July 2007
Online
it's iterating only till it finds it, not sure if there is a shortcut like for sopnets
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
Not that I've been able to find. It seems like copnets are kind of the ugly stepchild when it comes to code. Lots of things either work very differently from everywhere else in Houdini or aren't implemented at all. Makes me wonder if a future overhaul is planned.
  • Quick Links