Posted By

donaldstrubler on 12/30/10


Tagged

final cut pro nuke EDL


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ecker00


pxEDLReader


 / Published in: Python
 

URL: stroobs.tumblr.com

  1. def pxEDLReader():
  2. edlFileSearch = 'choose your EDL'
  3. footageBase = 'base dir for clips'
  4. boolean = True
  5. notepad = """This pxEDLReader will read any CMX3600 written by Final Cut Pro, or theorietically anything.
  6. Keep in mind: Export without audio (audio tracks break the edl read.
  7. Also: It does not have unique pathing, so make sure all of the clips are read from one dir
  8. 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"""
  9. p = nuke.Panel('pxEDL Reader')
  10.  
  11. p.addFilenameSearch("EDL", edlFileSearch)
  12. p.addFilenameSearch("Clips", footageBase)
  13. p.addBooleanCheckBox("Writes", boolean)
  14. p.addNotepad('Notes',notepad)
  15.  
  16. #p.addButton('Generate')
  17.  
  18.  
  19.  
  20. p.show()
  21. edlPath = p.value("EDL")
  22. baseDir = p.value("Clips")
  23.  
  24. edl = open(edlPath, 'r')
  25.  
  26.  
  27.  
  28.  
  29. r = edl.read().replace("\n","")
  30. edl.close()
  31.  
  32. f = r.split("\r")
  33.  
  34. o = r.split(" C ")
  35.  
  36. for t in o[1:]:
  37. j = nuke.createNode('Read')
  38. timecodes = t.split()[0:4]
  39.  
  40. clipIn = timecodes[0]
  41. ciStr = clipIn.split(":")
  42. ciFrm = int((int(ciStr[2])*24) + (int(ciStr[3])) +1)
  43.  
  44. clipOut = timecodes[1]
  45. coStr = clipOut.split(":")
  46. coFrm = int((int(coStr[2])*24) + (int(coStr[3])))
  47.  
  48. editIn = timecodes[2]
  49. eiStr = editIn.split(":")
  50. eiFrm = str((int(eiStr[2])*24) + (int(eiStr[3])))
  51.  
  52. editOut = timecodes[3]
  53. eoStr = editOut.split(":")
  54. eoFrm = str((int(eoStr[2])*24) + (int(eoStr[3])))
  55.  
  56.  
  57.  
  58.  
  59. outV = int(coFrm) - int(ciFrm) +1
  60. names = t.split()[8]
  61. print names
  62. j['first'].setValue(ciFrm)
  63. j['last'].setValue(coFrm)
  64. dir = baseDir + names
  65. j['file'].setValue(dir)
  66. apls = []
  67. apls.append(j)
  68. rt = nuke.createNode('Retime')
  69. apls.append(rt)
  70. rt['input.first_lock'].setValue(1)
  71. rt['input.first'].setValue(ciFrm)
  72. rt['input.last_lock'].setValue(1)
  73. rt['input.last'].setValue(coFrm)
  74. rt['output.first_lock'].setValue(1)
  75. rt['output.first'].setValue(1)
  76. rt['output.last_lock'].setValue(1)
  77. rt['output.last'].setValue(outV)
  78.  
  79.  
  80. ap = nuke.createNode('AppendClip')
  81.  
  82.  
  83.  
  84. for a in apls:
  85. a.setSelected(True)
  86. nuke.Node.autoplace(a)

Report this snippet  

You need to login to post a comment.