How to node with the render flag from a copnet?
1734
4
1
NFX
Member
183 posts
Joined: Dec. 2011
Offline
May 10, 2017 12:20 p.m.
Using Python, is there a way to select the node with the render flag set from a copnet?
tamte
Member
8512 posts
Joined: July 2007
Offline
May 10, 2017 8:21 p.m.
def getRenderNode ( subnet ):
for node in subnet . children ():
if node . isRenderFlagSet ():
return node
Tomas Slancik FX Supervisor Method Studios, NY
NFX
Member
183 posts
Joined: Dec. 2011
Offline
May 10, 2017 8:25 p.m.
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.
tamte
Member
8512 posts
Joined: July 2007
Offline
May 10, 2017 8:26 p.m.
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
NFX
Member
183 posts
Joined: Dec. 2011
Offline
May 10, 2017 8:29 p.m.
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.