Jump to content

Iterate in subnet python


tamagochy

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...