This is a very crude script, but would possibly achieve what you want (or at least a starter for 10). The script as it stands assumes that the layer you want to work on is at the top (layer 1). This should probably be changed to loop through all selected layers, I’ll leave that to you. The key part is the script looping through the length of your comp and dropping a keyframe every 3 keyframes. Note that the script as it stands will take account of any running expression when determining the value.
Hope this helps
// Set Keyframe Spacing here
var keyFrameSpacing=3;
app.beginUndoGroup("Bake Every Third Frame");
// Looks at activeComp
var comp=app.project.activeItem;
// Must be Layer 1 (at the top) - Change this to suit or loop through select layers.
var layer=comp.layer(1);
for (i=0;i<comp.duration;i=i+(keyFrameSpacing/comp.frameRate)) {
// Grab Current Value POST Expression (set to true if you want the value before any expressions)
bakeValue=layer.position.valueAtTime(i,false);
// Set New Value
layer.position.setValueAtTime(i,bakeValue);
}
app.endUndoGroup();
Declan Smith
https://www.madpanic.tv
After Effects CS5.5/ FCS3 / Canon 7D / Canon XL2 / Reason / Cubase
“it’s either binary or it’s not”