Advertisement
Guest User

Untitled

a guest
Aug 12th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. var tree;
  2. var selection;
  3. var angles;
  4. var comp;
  5. var shotToFind;
  6. var shotItems;
  7. var shotItem;
  8. var shot;
  9. var item;
  10. var wide;
  11. var closeup;
  12. var comp;
  13. var shotOne;
  14. var shotTwo;
  15. var shotThree;
  16. var wideFile;
  17. var closeupFile;
  18. var textValue;
  19. var textLayer;
  20. var textDocument;
  21.  
  22. selection = app.project.selection;
  23.  
  24. {
  25.  
  26. for (var i = 0, il = selection.length; i <il; i++) {
  27. tree = selection[i].name.substring(1, 5);
  28. angles = ["A" + tree, "B" + tree];
  29. wide = angles[0] + ".MXF";
  30. closeup = angles[1] + ".MXF";
  31. wideFile = angleFileFinder(wide);
  32. closeupFile = angleFileFinder (closeup);
  33. sidebarsFile = sidebarsFileFinder ("Side_Bars");
  34. comp = app.project.items.addComp (tree, 1920, 1080, 1, 30 + closeupFile.duration, 25);
  35. var layers = comp.layers;
  36. shotOne = layers.add(wideFile);
  37. shotThree = layers.add(wideFile);
  38. layers.add(sidebarsFile);
  39. shotTwo = layers.add(closeupFile);
  40. textLayer = layers.addText("Tree " + tree);
  41. textDocument = textLayer.property("Source Text");
  42. textValue = textDocument.value;
  43. textValue.font = "Arial-BoldMT";
  44. textValue.fontSize = 80;
  45. textValue.fillColor = [1, 1, 1];
  46. textValue.strokeWidth = 3;
  47. textValue.justification = ParagraphJustification.CENTER_JUSTIFY;
  48. textDocument.setValue(textValue);
  49. textLayer.property('ADBE Transform Group').property('ADBE Position').setValue([
  50. comp.width/2,
  51. comp.height - 50
  52. ]);
  53.  
  54. shotOne.startTime = -5;
  55. shotOne.inPoint = 0;
  56. shotOne.outPoint = 15;
  57. shotTwo.startTime = 15;
  58. shotTwo.outPoint = 15 + closeupFile.duration;
  59. shotThree.startTime = closeupFile.duration;
  60. shotThree.inPoint = closeupFile.duration + 15;
  61. shotThree.outPoint = shotThree.inPoint + 15;
  62. comp.openInViewer();
  63. }
  64.  
  65.  
  66. function angleFileFinder (theName) {
  67. var fileIndex;
  68. for (var i = 1, il = app.project.numItems; i < il; i++) {
  69. fileIndex = app.project.item(i);
  70. if (fileIndex.name === theName) {
  71. return fileIndex;
  72. }
  73. }
  74. }
  75.  
  76.  
  77. function sidebarsFileFinder (theName) {
  78. var fileIndex;
  79. for (var i = 1, il = app.project.numItems; i < il; i++) {
  80. fileIndex = app.project.item(i);
  81. if (fileIndex.name === theName) {
  82. return fileIndex;
  83. }
  84. }
  85. }
  86.  
  87.  
  88.  
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement