View Single Post
Old 9th March 2008, 17:05   #15  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by mikeytown2 View Post
I think i have it fixed now.
Almost, but I think you've still got one of the boundary conditions wrong.
Since the last frame of a clip is actually framecount-1, this value (rather than framecount) should be the max allowed for end (and mapped internally to 0).

Also, it might be clearer to replace:
Code:
#Funkey Conditions
start = (start == 0) ? -1 : start
start = (start == 1) ? 0 : start

#Perform Cut
return start == -1 ? 
\Eval(transition + "(d, c.trim(" + string(end+1) + ", 0), " + string(duration) + opts + ")"):
\end == 0 ?
\Eval(transition + "(c.trim(0, " + string(start-1) + "), d, " + string(duration) + opts + ")"):
\Eval(transition + "(c.trim(0, " + string(start-1) + "), c.trim(" + string(end+1) + ", 0), " + string(duration) + opts + ")")
by
Code:
# Select uncut frames (or blanks) as transition components:
clip1 = (start == 0) ? d : c.trim(0, -start)
clip2 = (end == 0) ? d : c.trim(end+1, 0)

# Perform transition:
Eval(transition + "(clip1, clip2," + string(duration) + opts + ")")
The effect is the same, but this way it seems clearer what the special cases are and how they are handled. (And by always using the negative Trim argument to select the first start frames, start=1 is no longer a special case)

Gavino
Gavino is offline   Reply With Quote