Advertisement
AzraelNewtype

timeranger helper functions

Oct 15th, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function DupFrame(clip c, int f) {
  2.         return c.Trim(f,f).assumefps("ntsc_video")
  3. }
  4.  
  5. function Zoom(clip c, int left, int top, int right, int bottom) {
  6.         return(c.spline36resize(c.width(),c.height(),left,top,right,bottom))
  7. }
  8.  
  9. #It's more convenient to start with select60 and edit to 24/30 than a trim,
  10. function Select60(clip in, int start, int end, int "a", int "b", int "c", int "d") {
  11.         return(in.trim(start,end))
  12. }
  13.  
  14. function Select30(clip c, int start, int end, int "w", int "x", int "y", int "z") {
  15.         return(c.trim(start,end).selecteven())
  16. }
  17.  
  18. function Select24(clip in, int start, int end, int a, int b, int c, int d, bool "show") {
  19.     show = default(show, false)
  20.     if (show == true) {
  21.         trimmed = in.trim(start,end)
  22.         return Show10(trimmed,a,b,c,d)
  23.     } else {
  24.         return in.trim(start,end).selectevery(10,a,b,c,d,d)
  25.     }
  26. }
  27.  
  28. function Show10(clip in, int "first", int "second", int "third", int "fourth") {
  29.     for (n = 0, 10) {
  30.         m = string(n)
  31.         w = round(in.width * 0.6)
  32.         h = round(in.height * 0.6)
  33.         dim = "(" + string(w) + "," + string(h) + ")"
  34.         eval("frame" + m + "=in.selectevery(10," + m + ")")
  35.         eval("frame" + m + "=frame" + m + ".pointresize" + dim)
  36.     }
  37.  
  38.     if (defined(first)) {
  39.         eval("frame" + string(first) + " = highlightEdge(frame" + string(first) + ")")
  40.     }
  41.     if (defined(second)) {
  42.         eval("frame" + string(second) + " = highlightEdge(frame" + string(second) + ")")
  43.     }
  44.     if (defined(third)) {
  45.         eval("frame" + string(third) + " = highlightEdge(frame" + string(third) + ")")
  46.     }
  47.     if (defined(fourth)) {
  48.         eval("frame" + string(fourth) + " = highlightEdge(frame" + string(fourth) + ")")
  49.     }
  50.  
  51.     t = stackhorizontal(frame0,frame1,frame2,frame3,frame4)
  52.     b = stackhorizontal(frame5,frame6,frame7,frame8,frame9)
  53.     return stackvertical(t,b)
  54. }
  55.  
  56.  
  57. function highlightEdge(clip in)
  58. {
  59.     return(in.crop(4,6,-4,-2).addborders(4,6,4,2,color=color_red))
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement