foxyshadis
15th December 2005, 16:03
I'm trying to use a conditional function in a script and breaking everything. First the script:
x=blankclip(length=10000, pixel_type="YV12").showframenumber()
s1=x.trim(0,346)
s2=x.trim(347,2053).FixBlendIVTC()
s3=x.trim(2054,2481)
s4=x.trim(2482,4918).FixBlendIVTC()
s5=x.trim(4919,8372)
s6=x.trim(8373,9282).FixBlendIVTC()
s7=x.trim(9283,0)
y=s1+s2+s3+s4+s5+s6+s7
return s2 # x # y
If you want fixblendivtc for testing or whatever, you can get it from my thread (http://forum.doom9.org/showthread.php?t=101477), but it's not unique in this respect.
Problem is, s6 overwrites s2 and s4, because fixblendivtc uses global variables to communicate with the conditional, and apparently the last set value overrides, so s6 repeats each time the others are supposed to show. It's not a bug, just the way global variables work, but if I need to use it this way is there any way around?
I came up with using a conditionalreader with on/off ranges as a workaround, though I haven't actually tried it yet. Are there any ways to make the above code work, though, without importing 3 versions of the filter, with different variable names?
x=blankclip(length=10000, pixel_type="YV12").showframenumber()
s1=x.trim(0,346)
s2=x.trim(347,2053).FixBlendIVTC()
s3=x.trim(2054,2481)
s4=x.trim(2482,4918).FixBlendIVTC()
s5=x.trim(4919,8372)
s6=x.trim(8373,9282).FixBlendIVTC()
s7=x.trim(9283,0)
y=s1+s2+s3+s4+s5+s6+s7
return s2 # x # y
If you want fixblendivtc for testing or whatever, you can get it from my thread (http://forum.doom9.org/showthread.php?t=101477), but it's not unique in this respect.
Problem is, s6 overwrites s2 and s4, because fixblendivtc uses global variables to communicate with the conditional, and apparently the last set value overrides, so s6 repeats each time the others are supposed to show. It's not a bug, just the way global variables work, but if I need to use it this way is there any way around?
I came up with using a conditionalreader with on/off ranges as a workaround, though I haven't actually tried it yet. Are there any ways to make the above code work, though, without importing 3 versions of the filter, with different variable names?