Activity › Forums › Adobe After Effects › Set a keyframe on every frame between 2 keyframes
-
Set a keyframe on every frame between 2 keyframes
-
Isa Dimpfl
January 24, 2023 at 8:16 amhi,
i made a curved animation path which a shape should follow. but when i am exporting it as an svg animation via bodymovin (lottie) the shape moves on a straight line.
i assume that i can fix this problem by generating keyframes between those two keyframes, so the shape has a specific position on each frame.
is there an easy solution to set a keyframe on every frame between 2 keyframes?
thanks in advance!
isa
-
Dan Ebberts
January 24, 2023 at 8:32 amYou could run a little script like this:
var comp = app.project.activeItem;
var layer = comp.selectedLayers[0];
var props = layer.selectedProperties;
for (var i = 0; i < props.length; i++){
if (props[i].canVaryOverTime && props[i].numKeys >= 2){
var t1 = props[i].keyTime(1) + comp.frameDuration;
var t2 = props[i].keyTime(2) - comp.frameDuration/2;
var t = t1;
while (t < t2){
props[i].addKey(t);
t+= comp.frameDuration;
}
}
} -
Isa Dimpfl
January 24, 2023 at 9:13 amthank you so much, i will give it a try.
its surprising that there is not a built-in option in AE which does this for you – i don`t think that this is such an exotic demand..
Reply to this Discussion! Login or Sign Up
Log in to reply.