One more thing - you should probably check to make sure the selected node
is not None!
if selectedNode != None:
# do the rest
On Thu, Apr 26, 2012 at 7:15 PM, Christopher Horvath
<[email protected]>wrote:
> try this:
> #############################
> # Get selected node
> selectedNode = nuke.selectedNode()
>
> # If you want to de-select this guy...
> selectedNode.setSelected( False )
>
> # Loop! Don't grab the dependent nodes each time, just do it once.
> depNodes = selectedNode.dependencies()
> for depNode in depNodes:
> depNode.setSelected( True )
>
> # All done!
> #######################
>
> On Thu, Apr 26, 2012 at 7:08 PM, invisfx <
> [email protected]> wrote:
>
>> **
>> what I am trying to do is write a script that finds all the read nodes
>> above a selected node in the graph.
>> so what I figure I have to do is
>> get the dependencies of a node and loop through testing if they are a
>> read node and continue recursively
>>
>> for a in nuke.selectedNode().dependencies():
>> name = a.name()
>> for n in name:
>> select n:
>> if n.Class() == ?Read?:
>>
>> but I don't know how to select a node from its name
>> can someone please help? I will accept any suggestions on how to make
>> this easier as well!
>> Thanks
>>
>> _______________________________________________
>> Nuke-python mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>
>>
>
>
> --
> I think this situation absolutely requires that a really futile and stupid
> gesture be done on somebody's part. And we're just the guys to do it.
>
--
I think this situation absolutely requires that a really futile and stupid
gesture be done on somebody's part. And we're just the guys to do it.
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python