/ Published in: Python
URL: stroobs.tumblr.com
Expand |
Embed | Plain Text
def pxEDLReader(): edlFileSearch = 'choose your EDL' footageBase = 'base dir for clips' boolean = True notepad = """This pxEDLReader will read any CMX3600 written by Final Cut Pro, or theorietically anything. Keep in mind: Export without audio (audio tracks break the edl read. Also: It does not have unique pathing, so make sure all of the clips are read from one dir By clicking 'OK' it will read the edl and provide all the clips and writes for them. Splaying an AppendClip to all of them should give you your exact edit""" p = nuke.Panel('pxEDL Reader') p.addFilenameSearch("EDL", edlFileSearch) p.addFilenameSearch("Clips", footageBase) p.addBooleanCheckBox("Writes", boolean) p.addNotepad('Notes',notepad) #p.addButton('Generate') p.show() edlPath = p.value("EDL") baseDir = p.value("Clips") edl = open(edlPath, 'r') r = edl.read().replace("\n","") edl.close() f = r.split("\r") o = r.split(" C ") for t in o[1:]: j = nuke.createNode('Read') timecodes = t.split()[0:4] clipIn = timecodes[0] ciStr = clipIn.split(":") ciFrm = int((int(ciStr[2])*24) + (int(ciStr[3])) +1) clipOut = timecodes[1] coStr = clipOut.split(":") coFrm = int((int(coStr[2])*24) + (int(coStr[3]))) editIn = timecodes[2] eiStr = editIn.split(":") eiFrm = str((int(eiStr[2])*24) + (int(eiStr[3]))) editOut = timecodes[3] eoStr = editOut.split(":") eoFrm = str((int(eoStr[2])*24) + (int(eoStr[3]))) outV = int(coFrm) - int(ciFrm) +1 names = t.split()[8] print names j['first'].setValue(ciFrm) j['last'].setValue(coFrm) dir = baseDir + names j['file'].setValue(dir) apls = [] apls.append(j) rt = nuke.createNode('Retime') apls.append(rt) rt['input.first_lock'].setValue(1) rt['input.first'].setValue(ciFrm) rt['input.last_lock'].setValue(1) rt['input.last'].setValue(coFrm) rt['output.first_lock'].setValue(1) rt['output.first'].setValue(1) rt['output.last_lock'].setValue(1) rt['output.last'].setValue(outV) ap = nuke.createNode('AppendClip') for a in apls: a.setSelected(True) nuke.Node.autoplace(a)
You need to login to post a comment.
