Copy link to clipboard
Copied
Hi all,
I have a shape layer made out of the digits 2 and 0, filled with smaller letters and numbers.
The entire shape layer consists of over 1000 groups (each with path and fills) and the smaller numbers/letters need to make up the the bigger numbers randomly.
So, it should work as follows:
1. Transparent BG
2. first few small numbers/letters appear with increasing transparency
3. more numbers/letters appear
4. the rest of the numbers/letters appear to finally fill out the entire shape
See rough mockup of the resulting shape:
My problem is that I don't know how to randomly select groups within a shape layer and then address each of their opacity to go from 0 to 100.
I am okish in After Effects but have hardly any experience with using expressions so any pointers would be greatly appreciated!
Thanks a lot,
Juliet
Copy link to clipboard
Copied
Each shape will need its own expression (an expression can't control anything except the value of the property hosting the expression). You should be able to use something like this:
tTotal = 3;
seedRandom(index,true);
myTime = random(tTotal);
(time < myTime) ? 0 : 100
Dan
Copy link to clipboard
Copied
Hi Dan
Thanks for your help!
So I will have to split out each shape/letter/digit into its own shape layer?
Would you be able to explain that expression to me?
So, I set my time to 3 seconds, then randomise with seedRandom (why do I need the index if I have to apply it to each shape individually anyway?) and then I set to the time for each to be random within the 3 seconds and if the time is under my time of 3 seconds it goes to a value of 100.
Did I get that right?
Thanks a lot,
Juliet
Copy link to clipboard
Copied
(why do I need the index if I have to apply it to each shape individually anyway?)
The default behavior of any random function is to generate a new seed for each evaluation. You need to "put a pin in it" with something that uses a fixed value to get a consistent result.
Mylenium
Copy link to clipboard
Copied
>So I will have to split out each shape/letter/digit into its own shape layer?
You shouldn't have to do that.
>why do I need the index if I have to apply it to each shape individually anyway?
It doesn't need to be the index. It could be just about anything. You just need to set the seed (with the second parameter = true) so that random value will persist from fame to frame.
It sounds like you pretty much figured out how it works.
Dan
Copy link to clipboard
Copied
Hi
Thanks again for the explanation. I have added the above expression to my opacity property of the overall shape layer (60, see screenshot). This results in the full 60 shape with all it's underlying smaller shapes suddenly appearing at a random time.
Any ideas what I'm doing wrong?
Thanks
Juliet
Copy link to clipboard
Copied
What happens is exactly what should be, if you apply this expression to the global opacity, as you did.
As a second thought:
Why don't you use just text ("lorem ipsum ...") and add one of the text-animation-presets to it (there is a random-preset, which gives you letters and numbers)? You can easily add an opacity animation to it, too.
Then, you take another text, 2 and 0, as a mask for your text-fill.
Or:
create the final shape in AI (use small text-objects, and pay attention to put everyone of them to a single layer), import this as a comp, animate opacity with keyframes, copy-paste keyframes to all layers and use a script (I use "keyboard", but there are free scripts for sure) to randomize those keyframes.
*Martin
Copy link to clipboard
Copied
You'd have to apply the expression to the opacity of each shape, not the overall layer.
Dan
Copy link to clipboard
Copied
Thank you both for your help, I will try these suggestions once this project is finished, I'm sure there is much to be learned from those!
In the meantime, I've done a workaround and split the single shape layers into roughly 20 layers and then animated opacity manually, which seems to do the trick, at least for the first version.
Thanks,
Juliet
Copy link to clipboard
Copied
Hi Martin
Thanks, after a bit more thought I do get how the expression leads to that exact outcome, I was just wondering as Dan has said I shouldn't have to split up each shape group into its own layer.
The random preset for letters and numbers would work but unfortunately the client needs that exact sequence of numbers and letters.
I think I won't be able to get around re-creating it in Illustrator and putting each number/letter sequence onto its own layer.
Thanks for your help.
Juliet
Copy link to clipboard
Copied
Hi Juliet,
if you apply Dan's expression you need to put it in your shape-groups -> form -> fill and contour. You can use QuickExp-Script to insert the expression on multiply properties at once, but you will most likely to select each of them before (and if you have 1000 groups with fill and contour, this is a selection of 2000 items and a lot! of clicking).
https://lesterbanks.com/2018/10/expressions-quickexp-script/
You can still go the text-layer way, but instead of animation random letters, you just add an animator for opacity. The advantage in this way is, that you can put the whole string into one text layer and use the start and end property of the animator to change the opacity for some letters only. You can try to use random() expression on start and end, too:
for start:
seedRandom(index,true);
start = random (something);
for end:
seedRandom(index,true);
end = start + random (somethingelse); // prevent from going backwards
Then, you duplicate this text-layer a lot of times and in each layer, another part of letters got the opacity change. The result should be near to what you want, but you don't need to re-create everything in AI and you don't need to put apart the artwork in hundreds of layers.
Maybe there is another way, but my recommendation is to have a look into the text-animator options. This is truly an animators playground!
*Martin
Find more inspiration, events, and resources on the new Adobe Community
Explore Now