Also, be careful, it seems like this script will not return a read node if it's not actually named "Read...". Also it would return other nodes if they were named with Read in it. (Ex: Grade_Reader would be a match). Might be safer to check the class of the node. On 13 Oct 2014 00:18, "Doruk Saglam" <doruksag...@gmail.com> wrote:
> Cheers John! I'll give it a try. > > On Fri, Oct 10, 2014 at 8:45 PM, John RA Benson <j...@illum-mg.fr> wrote: > >> lots of ways - >> >> simple one is to take advantage of the fact that nuke.allNodes already >> delivers specific node types in a list, so: >> >> nuke.allNodes(‘Read’) will give a list of Read nodes >> >> use a little list stuff and sorted() to sort it out: >> >> alphabetically_sorted_paths = sorted( [n[‘file’].value() for n in >> nuke.allNodes(‘Read’)] ) >> use: >> alphabetically_sorted_paths[number] >> to pick out whichever number the path you want corresponds to. >> >> JRAB >> >> On Oct 10, 2014, at 2:26 PM, Doruk Saglam <doruksag...@gmail.com> wrote: >> >> > Hello fellas, >> > >> > I'm using an easy script in Nuke to view a list of the read node values >> in Script Editor. I found the script somewhere on the internet, most >> probably on nukepedia... I've been using this script alot. But sometimes >> when the node tree gets huge it becomes harder to read the output of the >> script because it's not sorted. >> > >> > The script is this. >> > >> > def getReadValues(): >> > for a in nuke.allNodes(): >> > if 'Read' in a['name'].value(): >> > print a['file'].value() >> > >> > I'm want to upgrade this script so that it sorts out the output >> alphabetically and numerically. I couldn't find a solution because I'm a >> python noob. Is there a way? >> > Thanks in advance. >> > >> > Doruk >> > >> > -- >> > >> > Doruk Sağlam >> > Digital Compositor >> > CherryCherry VFX >> > _______________________________________________ >> > Nuke-python mailing list >> > Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ >> > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >> >> _______________________________________________ >> Nuke-python mailing list >> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ >> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >> > > > > -- > Doruk Sağlam > > http://tr.linkedin.com/in/doruksaglam > > _______________________________________________ > Nuke-python mailing list > Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > >
_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python