Skip to content

Instantly share code, notes, and snippets.

@justintaylor-dev
Last active November 4, 2021 19:34
Show Gist options
  • Save justintaylor-dev/71c0c0004b11749e629ea059ad8ab9c4 to your computer and use it in GitHub Desktop.
Save justintaylor-dev/71c0c0004b11749e629ea059ad8ab9c4 to your computer and use it in GitHub Desktop.
Get Frame of Active Precomp Layer #code_aeft
const startIndex = thisLayer.index + 1;
const endIndex = thisComp.numLayers;
let activeLayer;
for(i=startIndex;i<endIndex+1;i++){
const l = thisComp.layer(i);
if(l.inPoint <= time && l.outPoint > time && l.source instanceof Comp){
activeLayer = l;
break;
}
}
let res = ''
if(activeLayer){
const srcStartTime = activeLayer.source.displayStartTime;
const srcOffset = activeLayer.inPoint;
const srcTime = (srcStartTime + time)-srcOffset;
res = timeToFrames(srcTime);
}
res;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment