- May 5, 2021 at 9:19 pm
Hi, I’m working on a an effect where a line of multicolor dots moves through a scene. I can make a path in 3D space and make the dots with no problem…what I can’t figure out is the multicolor aspect.
I want the dots to be randomly colored in 3 different colors. See the attached mockup. I have tried using the gradient effect on the stroke itself and then clamped it down, but as the dots move (via keyframed offset) you end up seeing those transitions. I would like each dot to be a single color all the way along the path through the scene.
So far my best idea is to make 3 different paths, each in the different colors and then mask the dots. That is going to be very time-consuming to roto each scene, so I’m reaching out here to see if anyone knows a more procedural way to do it. Thanks so much for any input!
- May 5, 2021 at 10:20 pm
I’d use 3D text on a motion path derived from a 3D mask path. For text, just use periods with sets of your colors. Auto orientate towards camera. I’ve uploaded a quick example.
- May 5, 2021 at 10:21 pm
I would make the circles separate layers…
To get them to all move along the same path, I’d animate a null in 3D space to follow the line you have. Note that changing the position keyframes to ‘roving’ should help smooth the animation.
Then I’d create the first circle (smallish layer and add a circular mask, or make a circular shape layer).
To make it follow the null’s motion, I’d use an expression on the circle’s position property, something like this:
target = thisComp.layer("Null 1"); // change "Null 1" to your null or layer to follow
n = .5 ; // change this value to change the spacing between dots
target.position.valueAtTime(time - index * n)
You should be able to scrub through the time line and see that circle follow the null, but be offset in time just a little.
Now if you duplicate the circle a few times you should start to see a trail of circles. Adjust the ‘n = .5’ value in the expression to get the spacing you want. Once you have that set, delete the circles that don’d have that value and then duplicate the circles(s) that do and they should all have consistent spacing.
For colorizing, you could do each manually, or you could us another expression. I would try the Fill effect if you use the layer and mask method, or you can use an expression on the Fill property of the shape layers. Either way, the next steps are the same.
First create a keyframe for each color that you want to randomly select from. Then try this expression:
seedRandom(index, timeless = true) ;
r = Math.ceil( random( numKeys ) ) ;
As you duplicate out the circles, each should be random color from the colors you stored as keyframe values.
If needed, you can also set the circles to always face the camera by selecting all of them and choosing Layer>Transform>Auto-Orient and then choose ‘Towards Camera’
- May 5, 2021 at 10:47 pm
Reiner’s solution is nice. Definitely an easier set up than may ‘follow the leader’ expression.
- May 5, 2021 at 11:03 pm
Thank you to Team Kevin for a couple great ideas! I’m playing around with both right now.
One issue I’m having is recreating the path. I tried to copy the path data from my original shape layer and apply that to a null or a new mask to try your ideas, but when I do that the path shape is correct but it’s not in the right place in 3D space. I tried messing around with position and anchor points to try and eyeball it, but I’m just screwing things up more. Is there a better way to copy a path and apply it to another layer in 3D? I’ve done it in the past with no issues on 2D layers but not sure what I’m doing wrong now. I know I can just start over and make a new one, but when I come across a situation like this I’d like to learn what I’m doing wrong so I can get better at this stuff next time!
This client is pretty particular in what they want so I’m trying to make this process as easy to edit as possible if they want to change the path or colors, etc.
Here’s a screenshot to illustrate what happens when I copy/paste the path info to a null. THANKS AGAIN!
- May 6, 2021 at 5:05 pm
When you paste the mask path as a motion path, it will not be 3D anymore (the mask path is really just a 2D element on a 3D plane). I would just animate the null manually to follow the existing path/string of dots that you had previously.
Remember to move the null in 3D space (ie, animate the z-pos) too. I don’t think it will take too many keyframes to make that path, probably 5 or 6. Also remember to convert the keyframes roving, it will help smooth the movement.
Once you have the string of dots, you’ll be able to make adjustments to the null’s motion path (changing keyframes or bezier curves of the path) and the dots will reposition automatically, so you should be able to make changes fairly easily.
Log in to reply.