Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
pass a layer to freeze it where the time indicator currently is. Pass a specific time (in seconds) to freeze somewhere else.
function freezeLayerAtCurrentTime(layer, specificTime) {
if (!layer) {
// no layer
return false
layer.timeRemapEnabled = true;
var timeRemapProp = layer("ADBE Time Remapping");
var container = layer.containingComp || null;
if (!container) {
//container comp not found
return false
var time = (specificTime && !isNaN(specificTime)) ? specificTime : container.time;
timeRemapProp.setValueAtTime(time ,timeRemapProp.valueAtTime(time, false) );
// remove first and last keys
var keysAmount = timeRemapProp.numKeys;
if (keysAmount == 3) {
// Freeze Seems Successful
return true;
// something went wrong, you could print or alert the error
return false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment