I apologize for this "divide by zero" error, I should have check this.
But this point me to an other problem that the solution found by Kwag introduces :
round(YDifferenceToNext()+1) always gives values >= 1
So round(1/nf) and round(3/nf) will produce only TWO values : 0 or 1.
I'm sorry, I didn't saw that before
I think that the better solution (for speed and accuracy) is :
Code:
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften(4, round(1/nf) , round(3/nf) ,0, 2) ")
(until Kwag give us its advice on temporalcleaner
)