global frameoffset=0 global inTrick = false function frameToTime(int frame) { seconds = (1/29.97)*frame hundreths = seconds - float(int(seconds)) seconds = int(seconds-hundreths) minutes = seconds/60 seconds = seconds%60 hundreths = round(hundreths*100) minutes = (minutes>=1) ? int(minutes) : 0 minutes = (minutes<10) ? "0"+string(minutes) : string(minutes) seconds = (seconds<10) ? "0"+string(seconds) : string(seconds) hundreths = (hundreths<10) ? "0"+string(hundreths) : string(hundreths) return "0:"+minutes+":"+seconds+"."+hundreths } function addSection(int thisSec) { (inTrick) ? doneTrick() : nop() global section = thisSec secText = string(thisSec) color = $ffffff length = 120 overlap = 30 thisClip = BlankClip(bigclip, length, color=color) filetext = "{\pos(360,240)}{\fad(1000,1000)}{\be1}Section "+secText addSub(thisClip, "Title", filetext) thisSec = string(section) eval("global s"+thisSec+" = thisClip") } function addType(int thisType) { (inTrick) ? doneTrick() : nop() global type = thisType global counter = 0 secText = select(thisType-1, "Mounts", "Dismounts", "Tricks")+" "+string(section)+"."+string(thisType) color = select(thisType-1, $228B22, $38B0DE, $B22222) length = 120 overlap = 30 thisClip = BlankClip(bigclip, length, color=color) thisSec = string(section) filetext = "{\pos(360,240)}{\fad(1000,1000)}{\be1}"+secText addSub(thisClip, "Title", filetext) eval("global s"+thisSec+" = dissolve(s"+thisSec+",thisClip,overlap)") } function addTrick() { (inTrick) ? doneTrick() : nop() global counter = counter+1 global inTrick = true global inTrickLength = 0 global inTrickNum = 0 length=60 color=$000000 overlap=30 thisClip = BlankClip(bigclip, length, color=color) thisSec = string(section) filetext = "newtrick" addSub(thisClip, "Blank", filetext) eval("global s"+thisSec+" = dissolve(s"+thisSec+",thisClip,overlap)") } function doneTrick() { global inTrick = false base = blankclip(bigclip, length=inTrickLength) filetext = "{\fad(1000,1000)}"+string(section)+"."+string(type)+"."+string(counter) addSub(base, "Trick", filetext) } function addClip(clip base, int "in", int "out", bool "slowmo") { # Show the entire clip unless otherwise specified. in = default(in,0) out = default(out,0) overlap = 30 base = Trim(base,in,out) # De-interlace and maybe do slowmo. Currently using bob for # faster preview of non-slowmo. #base = slowmo ? LeakKernelBob(base, 0, threshold=0) : LeakKernelDeint(base, 0, threshold=0) base = slowmo ? Bob(base) : selecteven(bob(base)) base = assumefps(base, 29.97) thisSec = string(section) tempLength = inTrickLength+framecount(base) global inTrickLength = (inTrickNum>=1) ? tempLength-30 : tempLength global inTrickNum=inTrickNum+1 eval("global s"+thisSec+" = dissolve(s"+thisSec+",base,overlap)") } function dubToLength(clip inputvid, clip inputaud) { vidlength = inputvid.framecount outputvid = AudioDub(inputvid, inputaud).Trim(0, vidlength-1) return outputvid }