Activity › Forums › Adobe After Effects Expressions › Expression or Essential Graphics template advice
-
Expression or Essential Graphics template advice
Posted by John Cuevas on September 8, 2020 at 1:56 pmI 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.
Graham Quince replied 4 years, 2 months ago 5 Members · 7 Replies -
7 Replies
-
Brendon Murphy
September 8, 2020 at 2:55 pmOne 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.
-
Graham Quince
September 8, 2020 at 4:16 pmTake 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 :
if ( pickwhip-to-source-text == ‘’ ) { 0 } else { 100 }
-
Ernestas Cepulionis
September 8, 2020 at 7:06 pmI 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.
-
Filip Vandueren
September 8, 2020 at 10:41 pmAs a challenge I hacked something together using text-animators.
here’s a quick screengrab of me playing around with it:
https://www.dropbox.com/s/k0ro3n3pv9zyxy7/Screen%20Recording%202020-09-09%20at%2000.22.05.mov?dl=0
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.
project-file: https://we.tl/t-R9FDYORftO
-
John Cuevas
September 9, 2020 at 12:52 pmThanks Flip—as my co-worker just said “He is the MVP”.
And thanks to everyone else, given me a few different tacks to take at this, that I hadn’t thought of—favorite thing about the COW, the different approaches people come up with to problems.
Now if you all can give me just an extra 20 hours this week, I’ll be all set.
-
Filip Vandueren
September 9, 2020 at 1:57 pmI talked about a script to “freeze” the expression to speed things up after you’ve duplicated the layers
here are three of my scripts I us very often:
FV expr 2 KF @ KFs.jsx
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 calculationenable all expressions.js
speaks for itself
-
Graham Quince
September 9, 2020 at 2:11 pmOh that’s brilliant. Thanks for sharing this @filipvandueren
Reply to this Discussion! Login or Sign Up