Log in

View Full Version : Applyrange and Overlay issue


tomerb
17th May 2007, 16:34
Hey
I'm trying to overlay a video several times on a clip for several frames
I tried doing:

function func1(clip c1, clip c2)
{
Overlay(c1,c2, mode="blend", opacity=0.6, x=60, y=438)
}

clip1 = QTInput("c:\quick.mov",audio=true)
box = BlankClip(width=586,height=99).Blur(0,1)

ApplyRange(clip1,20,180,"overIt", clip1, box)


I keep getting "Script Error: invalid arguments to function "ApplyRange""

The manual says:
ApplyRange (clip, int start_frame, int end_frame, string filtername, args)
and I am doing: ApplyRange(clip1, 20, 180, "OverIt", clip1, box)
as I understand the arguments I pass are correct

btw,
the video file is 44 seconds long

Any help would be much appreciated

foxyshadis
17th May 2007, 16:56
The clip1 argument is automatically made the first argument to the function. So you only need box as an arg. (I assume that func1 and overIt are the same thing renamed.)

tomerb
17th May 2007, 16:59
Thanks, it worked.

overit and func1 are the same one, tried to rename it perhaps overIt() was reserved.
it works

tomerb
17th May 2007, 17:05
one problem:

I've added 2 more lines, duplicated the ApplyRange and changed in and out frames
when playing the video it looks like the last ApplyRange() was the one to work

ApplyRange(clip1, 20,50,"func1", box)
ApplyRange(clip1, 60,90,"func1", box)
shows only on frames 60-90

any way to fix this and make it execute all of the applyrange() ?

wonkey_monkey
17th May 2007, 17:37
clip1 isn't altered by the first line - because you haven't assigned the result to anything, it becomes the "default" of the script, and can be accessed with the variable "last". So, either:


ApplyRange(clip1, 20,50,"func1", box)
ApplyRange(last, 60,90,"func1", box)


or slightly more neatly:


clip1 # clip1 is now the "default"/"last" clip
ApplyRange(last, 20,50,"func1", box)
ApplyRange(last, 60,90,"func1", box)


David

stickboy
17th May 2007, 18:10
or slightly more neatly:
clip1 # clip1 is now the "default"/"last" clip
ApplyRange(last, 20,50,"func1", box)
ApplyRange(last, 60,90,"func1", box)Or just:
clip1 # clip1 is now the "default"/"last" clip
ApplyRange(20,50,"func1", box) # Omitting the first clip argument implicitly uses "last".
ApplyRange(60,90,"func1", box)

tomerb
17th May 2007, 19:05
Thanks
worked perfectly.

wonkey_monkey
17th May 2007, 19:43
Or just:

Doh! :stupid:

David