Jump to content

Python Binary Tree decomposition with dependencies for farm submission


kleer001

Recommended Posts

[I think I'm probably more than a few days from understanding and being able to write the necessary recursive function, but I thought I'd tap the brains here to save time (or see if I'm on the wrong track and it's easier than I assume).]

I want to build a list of render nodes that include the nodes they depend on. (see image)

Something like: (node name, nodes it immediately depends on)

(r,as & b), (as, cs), (b, ds & es), (cs, 0), (ds, 0), (es, 0)

---

I know I can run hou.node("out/r").inputDependencies() to get the full list, but that doesn't give me the dependencies of each node in turn.

I figure, like I said above, that I'll probably need to write a recursive function to spit these out. Something that runs over each subsequent list of dependencies until there are none then return the list. Somehow.

But maybe not? I imagine there might be an internal to Houdini way to do this, no?

 

ROPnetwork.png

Link to comment
Share on other sites

  • 1 month later...

Thanks! Sorry I didn't update the thread. I eventually figured it out, but can't share the code as it's for work.

I'm using

 hou.Node.inputDependencies()

Which gives me all the nodes that that node depends on, the full tree, not just the next step. That was a little unintuitive, graphically, but it makes more sense for sending to the farm and programming wise. I just run that once for the final node, then once again for every node but the last in the list (that's the node in question). From there building up the list of dependencies is pretty easy.
 

Link to comment
Share on other sites

  • 3 weeks later...
On 05/07/2019 at 6:19 PM, kleer001 said:

Thanks! Sorry I didn't update the thread. I eventually figured it out, but can't share the code as it's for work.

I'm using


 hou.Node.inputDependencies()

Which gives me all the nodes that that node depends on, the full tree, not just the next step. That was a little unintuitive, graphically, but it makes more sense for sending to the farm and programming wise. I just run that once for the final node, then once again for every node but the last in the list (that's the node in question). From there building up the list of dependencies is pretty easy.
 

Great ! Thanks  for the informations. 

  • Like 1
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...