tamagochy Posted September 4, 2019 Share Posted September 4, 2019 Hey, I have subnet in obj with few geometry nodes inside. I need iterate all geo nodes and find all nulls inside each geo node. How can I make this with python? All I have been trying gave me all null nodes in obj context , but I need only from this subnet. Thanks! Quote Link to comment Share on other sites More sharing options...
animknight Posted September 5, 2019 Share Posted September 5, 2019 Hi, There are many ways to achieve what you're looking for. Here's one subnet = hou.node("/obj/my_subnet") null_nodes = [] for child in subnet.children(): if child.type().name() == 'geo': for sub_child in child.children(): if sub_child.type().name() == 'null': null_nodes.append(sub_child) Hope it helps -J Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted September 5, 2019 Share Posted September 5, 2019 import toolutils toolutils.findAllChildNodesOfType(hou.node('/obj/geo1'), "null", dorecurse=True) 1 Quote Link to comment Share on other sites More sharing options...
tamagochy Posted September 5, 2019 Author Share Posted September 5, 2019 (edited) Wow toolutils cool.Thanks. I found solution with generator null = [y for y in g.children() if y.type().name() == 'null'] but good to know there is function for this Edited September 5, 2019 by tamagochy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.