If you take a look at the source for selectConnectedNodes() (in nuke.overrides), you'll see that all it's doing is walking the DAG. :) For various reasons (efficiency, recursion, more functionality, generators), I ended up writing my own traversal functions. There really isn't another way to get a node's dependencies unless every node were keeping track of all of its dependencies at all times... which would completely defeat the purpose of building a DAG in the first place.

One thing to keep in mind is that selectConnectedNodes only operates on a single node, so to get accurate results, you'll need to call it once for each Write; you may be getting the results you're expecting by accident right now if all of your Writes branch from the same tree. Since it looks like you don't care care about isolating the dependencies for each leaf (Write) node, the code I posted can easily be adapted to find the common dependencies for an arbitrary set of initial leaf nodes (just populate the 'stack' with the union of all of their dependencies before starting the traversal).

Hope this helps.

-Nathan



-----Original Message----- From: Jep Hill
Sent: Thursday, January 30, 2014 8:39 PM
To: [email protected]
Subject: [Nuke-python] [nuke -t] oddness when opening scriptswitherrorsininteractive mode

Hey Nathan -- thanks for that perspective... I was thinking that scanning for writes that aren't disabled, then using the selectConnectedNodes method proves to be a very fast approach for isolating the nodes in play. Once that's done we don't necessarily need to walk the DAG since we already know the pertinent nodes, right? Do you think it's possible to leverage the speed of already knowing the nodes in play to accelerate the process even more?

let me know if you think we should roll this over to another thread...

Cheers,
Jep_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to