View Full Version : pop, a filter to get values from variables that may not yet be initialized


tsp
6th October 2004, 16:56
pop, a filter to get values from variables that may not yet be initialized.

usages:

to be used within conditionalfilter, frameevaluate or scriptclip

syntax:

pop(default,string varname)

default = value to return if the variable doesn't exist yet

varname = name of the variable to get the value of. surround the name with " (and remember to use """ when writing the function)

example:

Below is a script that can be used to create a logfile for trimmaker using pop

global s=AVISource("c:\clip.avi").converttoyv12()
global mask = DEdgeMask(s,thY1=79,thY2=79,thC1=140,thC2=140,matrix="-2 1 -2 0 6 0 -2 1 -2" )
global log = "c:\log.txt"
writefileif(s,log,"bf","current_frame",append = false)
frameevaluate("""global bf=((pop(true,"bf")||UDifferencefromPrevious(s)>2)&&AverageLuma(mask)>1)""")

Get it here (http://www.tsp.person.dk/pop.zip)

Mug Funky
6th October 2004, 17:20
ta

that's a pretty good idea there. i'll have to test it when i revisit conditionalfilter et al