ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

making a text layer display the frame number where other layer is transparent

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
magali zadoff
making a text layer display the frame number where other layer is transparent
on Dec 1, 2018 at 2:03:01 pm
Last Edited By magali zadoff on Dec 1, 2018 at 2:55:26 pm

Hi,
I'm trying to write an expression to know where is the last frame with any image on a precomp. That precomp is a 3 to 6 minutes long layer that contains a video that will change once a day, and every time it has a different length.
So I need to find its last frame quickly (without going into the precomp to look because it doesn't have a visible end, but its last part is offline) .
So I think I can write this expression in a guide text layer that find the first empty frame (after I get the empty frame I'll change it to find offline bars frame) and display the frame number.

Up to now I have this, but it is returning "[object Group]".
Can anybody help me with this?

Thanks so much in advance!
--

Hey, I wanted to delete this post since I found the solution, but posts can't be deleted, so I'll paste the correct expression here so if someone needs the same thing this can be useful:
target = thisComp.layer("Sequence");
outP = target.outPoint;
outPF = timeToFrames(outP, 1.0 / thisComp.frameDuration, isDuration = false);
ppio = timeToFrames(target.inPoint, 1.0 / thisComp.frameDuration, false);

i = ppio;
while (i < outPF) {

FF = framesToTime(i, 1.0 / thisComp.frameDuration);
resultado = target.sampleImage(transform.position, [width, height]/2, true, FF);
if (resultado[3] == 0) {
break;
} else{
i++;
}
}
Ti = framesToTime(i, 1.0 / thisComp.frameDuration);
TC = timeToTimecode(Ti, timecodeBase = 30, isDuration = false)

TC


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]