Toby Waskowitz
Forum Replies Created
-
That’s just awesome! hehe… I was also thinking the same way, I did apply the overshoot to the slider, but it didn’t work without that new line, but now it’s working flawlessly. I really want to thank you very much for helping me with this.
-
Here is the final version (there are two keyframes in the scale slider):
N = thisComp.layer(“Controls”).effect(“Scale”)(1)
sampleSize = [1,1];
L = thisComp.layer(“Alpha Scale”);
P = L.fromComp(toComp(anchorPoint));
lum = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time))[2];
t = 0;
t1 = N.key(1).time;
t2 = N.key(N.numKeys).time;
if (lum == 1){
t = thisComp.frameDuration
while ((t < t2 – t1) && t <= time){
lTemp = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time-t))[2];
if (lTemp < 1){
t -= thisComp.frameDuration;
break;
}
t += thisComp.frameDuration;
}
}
v = N.valueAtTime(t1 + t)
value + [v,v,v] -
Toby Waskowitz
June 19, 2022 at 10:01 am in reply to: Trigger Two Keyframes With Alpha – not workingJust one more thing… if I may to ask.
I just found your Bounce and Overshoot expression:
amp = .1;
freq = 1.5;
decay = 4.0;n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n–;
}
}
if (n == 0){
t = 0;
}else{
t = time – key(n).time;
}if (n > 0){
v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}so… is it too much to ask to integrate it into my expression with 2 keyframes?
If that’s too much work, I understand… Thanks for everything! 🙂
-
Dan, you were right before. Everything works with the first expression, I was making some changes and didn’t know that “numKeys” also needs to have a FULL PATH if I use another layer’s keys. So, if anyone has the same problem, just to make it clear:
N = thisComp.layer(“Null”).transform.position
THIS IS WRONG:
N.key(numKeys).time
(it’s taking the numKeys from the layer where the expression is)
THIS IS CORRECT:
N.key(N.numKeys).time
Dan, thanks again for your help, and have a nice day! 🙂
-
I don’t know how, that’s why I said only sometimes, really don’t understand. But, thank you very much, you have helped me a lot!
All the best!
-
Everything is perfect, only sometimes it returns this error:
“this property has no keyframe number 0”
So, if I change:
“t2 = key(numKeys).time”
to
“t2 = key(2).time”
then it’s ok, I don’t know why, and I’ve tried to fix it, but still no luck. Later I will use more than two keyframes, so it would be easier not to count keyframes every time. Could you please see if it can be resolved if it’s not taking you too much time.
Thanks again!
-
That’s exactly it… thank you very much, you’ve saved my day! Thanks again!
All the best!
-
Yes Dan, you are correct, I am struggling with the time. Luminosity is animated, it can be 0 or 1. If it’s 1 then it’s TIME to trigger the animation. How can I calculate the time of “lum” when it goes from 0 to 1? Is this even possible? Please help me, and thanks for the reply! 🙂