Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import nuke
- def showReads ():
- """
- This panel gives you the number of reads that are either selected or in the entire script.
- Additionally, it tells you the path of either selected nodes or all read nodes.
- """
- reads = []
- readfiles = []
- nodes = nuke.selectedNodes('Read')
- if len(nodes) < 1:
- nodes = nuke.allNodes('Read')
- for node in nodes:
- if nuke.filename(node) not in readfiles:
- reads.append ({'file':nuke.filename(node),'start':node['first'].value(),'end':node['last'].value()})
- readfiles.append (nuke.filename(node))
- read = ''
- output = ''
- x = 0
- for read in reads:
- x = x + 1
- output = '%s%s %d-%d\n' % (output, read['file'], int(read['start']), int(read['end']))
- p = nuke.Panel('Read Paths', setWidth=650)
- p.addSingleLineInput('Script Name:', nuke.root()['name'].value())
- p.addMultilineTextInput ('Paths:',output)
- p.addSingleLineInput ('Total Selected:', x)
- p.setWidth(1000)
- p.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement