Hallo zusammen, ich möchte zwei Clips (zunächst) von rechts nach links "einfließen" lassen.
Dazu wird jeweils ein Stück vom Rechten Rand des ersten Clips und ein Stück vom linken Rand des zweiten Clips abgeschnitten und das Ganze dann wieder zusammengebaut.
Nur leider schaffe ich es nicht die Information zum "hoch zählen" aus der Funktion zu retten (step_mod2,span,frames).
Wie geht das ???
Hier das Script:
Code
# 25.06.2018 - 1.0 - Initial releas
function slideIn(clip "vid1", clip "vid2", String "side_in", int "frames", int "step")
{
vid1_width = vid1.width
vid1_height = vid1.height
vid2_width = vid1.width
vid2_height = vid1.height
### Error handling here
Assert(vid1_width == vid2_width, "'Clips need to have the same width'")
Assert(vid1_height == vid2_height, "'Clips need to have the same height'")
### Set Defaults
side_in = default(side_in, "right")
global span = (side_in == "right" || side_in == "left") ? vid1_width : vid1_height
global frames = default(frames, 30)
step = default(step, Round(span/frames))
global step_mod2 = step + (step % 2) # Needed for YV12
function slideIn_from_right(clip "vid1", clip "vid2", String "side_in", int "frames", int "step_mod2", int "span")
{
Assert(frames > 0 || span > 0)
vida = vid1.Crop(0,0,-step_mod2,0).SubTitle(string (step_mod2))
vidb = vid2.Crop(0,0,step_mod2,0)
step_mod2 = step_mod2 + step_mod2
span = span - step_mod2
frames = frames - 1
StackHorizontal(vida,vidb)
}
### Selcet side to slide in
out = (side_in == "right") ? slideIn_from_right(vid1,vid2,side_in,frames,step_mod2,span) : vid1.subtitle("org")
return(out)
}
Alles anzeigen