I don't think this is directly possible in Nuke's Python... yet, but there
may a workaround for it, or a way to infer this information.

If it's just Switch Nodes you need to monitor, perhaps you could try
traversing up graph until you hit Node of type Switch, evaluate the
Switch:which knob and follow the Input its set to? Would that work?

Is there is a better way perhaps?

As an aside, because this is really talking about something I'm quite
interested in.... Graph topologies:

What Nathan's example, in your link, is doing is traversing the topology of
the Node-graph (easy), whereas what you're asking for is to traverse the
Op-graph that's been generated for a given context (not so easy). That is,
the DAG only shows a representation of the actual operations (Ops) the
Graph will generate. For your use-case there are just one Node-graph but
two (or N) entire op-graphs, one for each of the switch configurations.

This would be a very useful feature and I can think of a couple of uses for
allowing access to more topological information in Nuke, both Node
topologies and Op topologies. For example we already have an internal
structure we can query to find out things like

   - what types of Nodes are up- or down-stream of another Node
   - find the shortest path
   - get all paths between two Nodes

It's very cool and useful.

The problem is that Ops are very transient and we'd have to be /very/
careful how we exposed them to Python, and we probably never will, directly.

On 30 June 2015 at 16:23, John RA Benson <[email protected]> wrote:

> Hmm -
>
> Ok, I'm not having an issue finding dependencies (this does the job just
> fine, for example:
> http://community.thefoundry.co.uk/discussion/post.aspx?f=190&t=103381&p=894390
> ), but I discovered that I don't have a way to find my *currently needed*
> dependencies.
>
> Basically, let's say I have a write node and want to find nodes of a
> certain class in it's dependencies, let's call the class 'PreRender'
>
> I want to render those prerenders, but only those in the tree that are
> switched on.
>
> I have a switch for prerender1 and prerender2, because the tree above them
> branches with some differences specific to the prerender. I need to render
> two jobs at two separate times, manually switching them, but the output is
> to the same write node. The pipeline fills in the write path based on
> 'stuff', so I'm not actually overwriting anything when I re-render - except
> that, even though prerender2 isn't being seen in the first render because
> the switch is looking at prerender1, it's still part of the dependencies
> tree, and consequently, it's getting rendered.
>
> Is there a way for me to walk through the dependencies via python to
> eliminate the non-rendered part of the dependencies tree?
>
> thanks
> JRAB
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>



-- 
Frank Harrison
Senior Nuke Software Engineer
The Foundry
Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906
Web: www.thefoundry.co.uk
Email: [email protected]
_______________________________________________
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