-
If/Else Statement – Triggering Animation on First Marker and on Last Keyframe
This is a 2 parter.
Ive got a subtitle text layer (.SRT) that I’ve imported using the pt_ImportSubtitles script. It imports a single text layer with key frames animating the text along with the voice over. It also puts a layer marker at each key frame.I’ve been tasked with a branded subtitle graphic template where by the client can import an srt file and the textbox around the text will automatically resize to the text as it animates (by animating I mean jumps from text line to text line via hold keyframes). There is a text box and a circle in the top left corner of it.
Here’s what I’d like to do:
1) The circle – It’s precomped and a scale up and down animation is inside it. I get the approach of triggering on a marker with a comment but I can’t take that approach here because as a template the comment will never be the same. So I’d like to trigger the In animation on the first marker on the text layer without having to reference its comment. The out animation I’d like to trigger on the last key frame on the text layer. I can’t use the last marker because the importsubtitles script doesn’t create a marker on the last key frame. I’d rather not have to ask the client to set a marker every time they use the template. I’m familiar with using basic if/else statements but I have no idea how to access the first marker with no comment and the last keyframe or how to combine that into one if/else statement. Or if that’s even the right approach.
2) The text box – no animation on this. I just want the opacity for the box at 0% when there is no text and 100% when there is. Currently, If there is no text, for example before the VO starts, the box stays on screen like this:
and I’d rather not have it visible.
Any help on this code would be extremely helpful.
Thank you!


