Jump to content
kleer001

Python Binary Tree decomposition with dependencies for farm submission

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

Share this post


Link to post
Share on other sites

Hey  ! 

have  you try to get the  inputAncestors of each  node ? 

hou.Node.inputAncestors() 

Share this post


Link to post
Share on other sites

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.
 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×