You are right. That doesn’t quite work sorry about that. Okay this one should though.
Build a placeholder slider and paste the expression:
t=timeToFrames(time);
f=framesToTime(t-1);
effect(“Your effect name here”)(“Slider”).valueAtTime(f)
Then on your effect paste the expression:
rand= Math.round(random(5,10));
s1=effect(“Placeholder 1”)(“Slider”);
if (rand != s1){
rand;
} else if ((rand+1) <= 10){
rand+1;
} else if ((rand-1) >= 5){
rand-1;
}
Keep in mind that the placeholder slider has to be placed above the effect because after effects calculates effect on top first.
So doing this worked for me and I tested much more frames than I did the first time. Sorry again about that. The only problem is that it only makes sure it is not equal to the last frame, not that it is not equal to two frames ago. This can’t be solved by adding a duplicate placeholder that subtract 2 frames and adding the code:
s2=effect(“Placeholder 2”)(“Slider”);
if (rand != s1 && rand != s2 ){
because you may still get the value of “s2” when you add or subtract 1 to “rand.” I have not figured out how to fix this yet but if I come up with something I will let you know
Doyle Lewis, Assistant Videographer
thinkck.com