-
Expression doesn’t work
Before asking a question
We ask for your understanding in advance for the part where you are not proficient in English.
What I want to ask is this
Put a keyframe in the A effect and control the speed of the keyframe with the slider control
And this effect
I want to be able to turn it on and off with a checkbox
And when the check box is turned off, I want the keyframe position value set to remain unchanged.
So I wrote the following expression
The position value of the keyframe is
Keep moving
Oh it doesn’t move or it’s either
It would be appreciated if you let me know which expression to use
—————————————————————————-
//This is the first try
spd =effect(“Slider Control”)(“Slider”);
accum = 0;
cb = effect(“Checkbox Control”)(“Checkbox”);
for (i = timeToFrames(inPoint); i <= timeToFrames(time); i++) {
if (cb.valueAtTime(framesToTime(i))){
accum += spd.valueAtTime(framesToTime(i));
}
}
value + accum * thisComp.frameDuration;
——————————————————————————————–
//This is the second attempt
spd =effect(“slider control”)(“slider”);
accum = 0;
cb = effect(“checkbox control”)(“check”);
for (i = timeToFrames(inPoint); i <= timeToFrames(time); i++) {
if (cb.valueAtTime(framesToTime(i))==true){
accum += spd.valueAtTime(framesToTime(i));
}
}
value + accum *nearestKey(thisComp.frameDuration);
//This expression does not move, but it does not move when the check box is activated.
———————————————————————————–
//This is the third attempt
spd =effect(“Slider Control”)(“Slider”);
accum = 0;
cb = effect(“Checkbox Control”)(“Checkbox”);
for (i = timeToFrames(inPoint); i <= timeToFrames(time); i++) {
if (cb.valueAtTime(framesToTime(i))==true){
accum += spd.valueAtTime(framesToTime(i));
}
}
value + accum * thisComp.frameDuration;
//This also failed
—————————————————–
Sorry, there were no replies found.