kleer001 Posted May 8, 2019 Share Posted May 8, 2019 [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? Quote Link to comment Share on other sites More sharing options...
Mox Posted July 5, 2019 Share Posted July 5, 2019 Hey ! have you try to get the inputAncestors of each node ? hou.Node.inputAncestors() Quote Link to comment Share on other sites More sharing options...
kleer001 Posted July 5, 2019 Author Share Posted July 5, 2019 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. Quote Link to comment Share on other sites More sharing options...
Mox Posted July 25, 2019 Share Posted July 25, 2019 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. 1 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.