How to node with the render flag from a copnet?

   771   4   1
User Avatar
Member
180 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
4551 posts
Joined: July 2007
Offline
def getRenderNode(subnet):
    for node in subnet.children():
        if node.isRenderFlagSet():
            return node
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
180 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
4551 posts
Joined: July 2007
Offline
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
180 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