Log in

View Full Version : Recursive scripting


MrTVideo
17th March 2004, 08:33
I am stuck! I would like to have an incremental recursive input to the x and y values is this possible within a script. I tried a
for(b=0,b++,b>Framecount(clip1)) with a syntax error

---------------------------Script-----------------------------------
int w=240

int h=180
int c
int b


clip1 = AviSource("D:\Vid 1.avi").Flipvertical
clip2 = AviSource("D:\Vid 2.avi").Flipvertical.BilinearResize(w,h)

# I am trying to put a recursive function between "HERE"

Overlay(clip1, clip2, x=b,y=100,Mode="blend")

# And "HERE" incrementing val b to framecount(clip1)
I cannot find any syntax allowing this

#ConditionalReader("opacity.txt", "ol_opacity_offset", false)
#ConditionalReader("Xoffset.txt","ol_x_offset", false)
--------------------------------------------------------------------
:confused:

Any help would be fantastic

MrTVideo
17th March 2004, 09:12
Apologies
I just found this:-

Function loop(string s, int stop)
{
return (stop == 0) ? s : string(stop) + " " + loop(s,stop-1)
}

return messageclip(loop("", 3))

I will try and use this form :)

stickboy
17th March 2004, 09:39
It's probably better not to name it "loop", since that's the name of a totally different built-in function.

Exactly what is it you want to accomplish?

Wilbert
17th March 2004, 11:11
It should work with animate. Try something like

clip1.Animate(0,framecount(clip1)-1, clip2,0,100,Mode="blend", clip2,framecount(clip1)-1,100,Mode="blend")

MrTVideo
18th March 2004, 07:11
In reply to you stickboy I am just putting together some video editing tools I and others like me cannot achieve with Studio 8 unless we have the HFX tools. I have the still picture in picture and moving picture in picture working with ConditionReader but that means scripting two files depending on the variables. It would be tidier to do it straight in an AVS file. By the way the captured avi mjpeg has to be flipped otherwise its upside down. Must be simular to jpeg images.

To you Wilbert I have noted you surgestion and will put it in action.
I will post where the final tool can be downloaded from. So far it only handles mirror and reverse (Neither are available in Studio).

I will possibly add some noise Filtering option too.

Just for interest the way my GUI works is: Mediator 5 which was a free give away is used to create the display with buttons and user input controls depending on the options chosen, when activated a program written in rapidq writes the various scripts and feeds the avs script to Virtualdubmod which functions as the preview and workhorse. On exiting Virtualdubmod control returns to the main GUI.

Messy maybe but the user does'ent have to worry about what to run next, that is taken care of. Anyway as I designed it primarily for my use. As I am offering it free to use the complaint que can stack out.

Anyway to both of you, Thanks for your interest :cool: Love the smilies

Terry