Last active
November 4, 2021 19:34
-
-
Save justintaylor-dev/71c0c0004b11749e629ea059ad8ab9c4 to your computer and use it in GitHub Desktop.
Get Frame of Active Precomp Layer #code_aeft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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