I am working on a 16 video educational course that will have many bulleted lists. The issue is that the numbered bullets are a precomped animation that need to be positioned at the first line of the text. The number of text lines can vary(see attached images). Can anyone suggest a method where I can create my text list and automatically have the bullets line up correctly—either by expression or Essential Graphics template? This could potentially save me a lot of time if I don’t have to manually adjusting each number animation.
One option could be to pre-render the animated numbers and then use a script to place them at the top left corner of every text block when you run it. Use if statements to read in #2 if #1 already exists, etc so that you get incremental numbering.
Another possible trick – you can add a period at the start of each text block. Quickly align nulls with the periods, then alt-swap the nulls with your precomps. Note that the precomp size will need to be set up so that the anchor point is in the right place relative to the graphic for a seamless swap.
Take a look at the expression: text.sourceRectAtTime().top (I think that right, I’m not in front of my pc)
That would get you the top most position and then sourceRectAtTime().height which gives you the height of the text box. So I think you could then position your precomp based on the top position and the height of new lines.
The alternative would be to have separate text layer for each bullet point, controlled in the same way in essential graphics, but have the precomp’s opacity controlled by an if statement, something like :
I suggest to use expression control to describe position of first precomp layer and for the rest precomp layers write an expression where horizontal align is the same as first precomp , vertical offset is described using layer index (let say y position is 200 pixels * index + textSize). You can add more slider controls to manage position of first precomp layer, distance between all precomp layers and so on.
I hope the usage is clear. It’s just a proof of concept. Basically any number of precomp-layers can ask the text-layer where the hidden bullet-points are by asking for the sourceRect at a negative time. sourceRectAtTime(-3) gives you the sourceRect of the 3rd bullet.
of course: caveat: this is just a hack, very slow (for my standards), and maybe not useful for you in production, but it was fun to build.
Ideally this would be combined with a script that disables all the expressions once the correct positions are calculated.
Equivalent to “convert expression to keyframes”, but only operates on exisiting keyframes. Because a simple expression like “value/2” doesn’t need to create 1 keyframe per frame for the entire comp.
FV expr 2 KF @ time.jsx
Only applies the current outcome value of the expression to “now” (possibly creating a keyframe), then disables then expression. -> Ideal for this case where the calculation of the positions is always the same value, but is an expensive calculation