SoonUDie
15th December 2003, 09:54
Hey all!
My problem is this: I would like to use one of the stated functions above to store a non-clip value in a global variable. I've read everything I could find on this at Avisynth.org and here through searching, but for some reason I just can't get what I'm doing to work.
Here's an example of one way I tried to go about it with ConditionalFilter:
In psuedo-code:
function Main()
{
ConditionalFilter(vid1, vid1, vid1, "myFunction(luma(vid1) == luma(vid2))", "equals", "true")
return myVar
}
function myFunction(bool "test")\
{
global myVar = test
return test
}
The result of this script is that I get an avisynth error saying "I don't know what myVar means". But if I define myVar before the conditional filter, it just returns that instead of what myVar should be after the ConditionalFilter.
I also tried tying a function in to one of the returned sources, like
ConditionalFilter(vid1, myFunction2(), vid1...)
where myFunction2 sets a variable and returns a clip. Unfortunately, it seems that ConditionalFilter evaluates both results before the condition is checked, meaning that myFunction2() is activated even when the conditional is false.
I think this kind of thing should be easy to do in ScriptClip or FrameEvaluate, but I have no idea how to do it. This is kind of driving me nuts here. Please help me!
Thank you :)
My problem is this: I would like to use one of the stated functions above to store a non-clip value in a global variable. I've read everything I could find on this at Avisynth.org and here through searching, but for some reason I just can't get what I'm doing to work.
Here's an example of one way I tried to go about it with ConditionalFilter:
In psuedo-code:
function Main()
{
ConditionalFilter(vid1, vid1, vid1, "myFunction(luma(vid1) == luma(vid2))", "equals", "true")
return myVar
}
function myFunction(bool "test")\
{
global myVar = test
return test
}
The result of this script is that I get an avisynth error saying "I don't know what myVar means". But if I define myVar before the conditional filter, it just returns that instead of what myVar should be after the ConditionalFilter.
I also tried tying a function in to one of the returned sources, like
ConditionalFilter(vid1, myFunction2(), vid1...)
where myFunction2 sets a variable and returns a clip. Unfortunately, it seems that ConditionalFilter evaluates both results before the condition is checked, meaning that myFunction2() is activated even when the conditional is false.
I think this kind of thing should be easy to do in ScriptClip or FrameEvaluate, but I have no idea how to do it. This is kind of driving me nuts here. Please help me!
Thank you :)