Copy link to clipboard
Copied
Hi
I have a single cartoon version of a star. I would like to populate the background layer of the comp with a star field. And I don't want to have to place those stars all in by hand.
So I am looking for an expression (which I will control with a slider(s) ) that will give me the most flexibility.
1) Be able to "randomly" populate the background with the star image.
2) Adjust the size of the individual stars in some way (perhaps random -- but still have permaters in some way -- perhaps I will need to use different layers to do that.
3) The stars will be still, but I would like their rotation to be random, so that they are not all in the exact same position.
4) An additional feature would be the ability (if I upload a version that has a white color (instead of yellow) would be able to set colors for the various stars in some way. (Possibly I would need to do different colors on different layers, if this is not easily possible -- even with a random expression re color???)
Any thoughts on this. I am a newbie to expressions, but I think I get the concept.
Best
Rowby
You can draw a cartoon star like that very easily with the shape tools and then use repeaters and other shape tool functions to randomly position them around the scene. You can even have randomly jiggled strokes on each one so that they are all different.
You know what? It won't take very long. Gimme a second.
Copy link to clipboard
Copied
The clone stamp tool is perfect for this. Each clone gets its own Transformation parameter that can you keyframe in the timeline for your layer, for example: Effects -> Paint -> Clone 1 -> Transform: Clone 1. For the properties you want to be random you can include a random expression. Here are three for position, scale, and rotation. If you don't like the random value they select for any given property then change the first parameter to seedRandom from "1" to a different value.
For position:
seedRandom(1,true);
var randomX = random(0,1000);
var randomY = random(0,800);
[randomX, randomY];
For scale:
seedRandom(1,true);
var s = random(20,200);
[s,s];
For rotation:
seedRandom(1,true);
var r = random(0,360);
;
If you want to make these expressions configurable you can drop some Expression control sliders onto your layer (or a new null layer) and link the parameters to random() or seedRandom() to those sliders.
Copy link to clipboard
Copied
You can draw a cartoon star like that very easily with the shape tools and then use repeaters and other shape tool functions to randomly position them around the scene. You can even have randomly jiggled strokes on each one so that they are all different.
You know what? It won't take very long. Gimme a second.
Copy link to clipboard
Copied
This is done with one shape and a repeater Here's the project file
If you want to mess with the positions, rotations, etc., just mess with the relevant options under the "Wiggle Transform" property. There are all kinds of things you can do with this.
Now, you could also do something like this with expression and have a whole bunch of layers with their properties tied to expression control effects on a controller layer, but this way is much faster.
Copy link to clipboard
Copied
Update: now with random scale.
Copy link to clipboard
Copied
Hi everyone.
I've been away and just returned to this question. For whatever reason I couldn't get Horshack's expressions to work. I'm sure it's my inexperience in expressions. I'm going to try Szalam's project file
In any case, here's my attempt at Horshack's solution. For my own education perhaps Horshack can show me where I went wrong with the clone stamp. It did not affect my single star.
I'll report back soon!
Rowby
Copy link to clipboard
Copied
Hi Rowby,
The expressions I provided were meant to be applied on each clone stamp's Transform property group. You've applied them to the layer's transform property group. You can get to the first clone stamp's group by going to Effects -> Paint -> Clone 1 -> Transform: Clone 1
Copy link to clipboard
Copied
HI Horshack,
I figured I did not put it in the correct place. I'm relatively new to AE and very new to expressions.
Hee hee. I will revisit your solution -- however at this point I'm already pretty much committed to using Szalam's solution because it's working for what I need at this moment.
Rowby
Copy link to clipboard
Copied
You can get different colors a number of different ways. The easiest would be to just make four different star layers with the different fill colors you need and then just put a different random seed in each Wiggle Transform operator.
Copy link to clipboard
Copied
Hi Szalam
Like the random scale. Really helps with stars.
While you're at it... could you add random color. For example I would enter 4 different colors and that would be added to the overall random mix???
BTW for this project I am not going to use stroke colors. It will all be fills -- without strokes. So (for example) I can have red stars, blue stars, white stars, green stars)
If not easily done I can just use layers and give the star a different color -- using an alpha channel. Having the scaling really helps give me the randomness I need.
Rowby