/ Published in: Python
Right click menu to send Nuke trackers to Syntheyes.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import nuke def TrackerToSyntheyes(): filenameSearch = 'choose your path' singleLine1 = '1920' singleLine2 = '1080' rangeLine = '1,100' prefix = 'nuke_' p = nuke.Panel('Tracker to Syntheyes') p.addFilenameSearch(" Filename:", filenameSearch) p.addSingleLineInput("Width", singleLine1) p.addSingleLineInput("Height", singleLine2) p.addSingleLineInput("Range", rangeLine) p.addSingleLineInput("Prefix", prefix) result = p.show() filenameVal= p.value(" Filename:") width = float(p.value("Width")) height = float(p.value("Height")) rangeVal = p.value("Range") rangeValFirst = int(rangeVal.split(',')[0]) rangeValLast = int(rangeVal.split(',')[1]) prefix2 = p.value("Prefix") print filenameVal tracker = nuke.selectedNode()['name'].value() + ' ' f = open(filenameVal, 'w') f.write for j in nuke.selectedNodes(): tracker = j['name'].value() + ' ' for i in range(rangeValFirst,rangeValLast): i = i+1 nuke.frame(i) x = str(((nuke.selectedNode()['track1'].getValueAt(i)[0]/width)*2)-1) + ' ' y = str(((((nuke.selectedNode()['track1'].getValueAt(i)[1]/height)*2)-1)*(-1))) + ' ' #tr = nuke.selectedNode()['track1'].getValueAt(i) ls = [] sent = prefix + tracker + str(i) + ' ' + x + y + '7' + '\n' f.write(sent) print sent f.close() #TrackerToSyntheyes() #menu #m = nuke.menu('Animation') #m.addCommand('File/Export to Syntheyes', "pxTrackerToSyntheyes.TrackerToSyntheyes()")
URL: donaldstrubler.com