ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Connect two Objects with dotted line

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Julia Hoerr
Connect two Objects with dotted line
on Feb 1, 2017 at 6:21:41 pm

Hi,

I know this topic has been discussed a few times before, but I couldn't find the right solution for my project. So maybe someone can help me with new ideas.

I have two objects and I want them to be connected by a line of dots. And here's what makes it difficult for me. The line should consist of a specific number of dots. And when the objects move, the spacing between the dots should automatically adjust. Like they are fixed to an invisible rubber band. I've seen something like that on the intro of "Lie to me".

I've tried to use the beam effect but it didn't work out. I wonder if I could use shape layers for the dots. Then use some expression to connect the first dot with object A and the last dot with object B. And then I would need another expression to tell the rest of the dots what to do. The problem is I'm not really good at writing expressions. Mostly I look for them on the internet and adjust them for my purposes.
So if anyone has an idea how this could work I would be really thankful. I tried to make it work for days and now I don't know what to do anymore.


Return to posts index

Dave LaRonde
Re: Connect two Objects with dotted line
on Feb 1, 2017 at 7:15:16 pm

How are you currently doing it?

I've never seen "Lie to Me", so I have no clue what they did.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Greg Gesch
Re: Connect two Objects with dotted line
on Feb 1, 2017 at 8:03:14 pm

Hi Julia, you might consider using text full-stops/periods as the dots then add a Tracking Animator to expand/contract them. You would need to keyframe the starting Position to your your object A, then keyframe rotation - could be worth experimenting with?


Return to posts index


Emre Anil
Re: Connect two Objects with dotted line
on Feb 1, 2017 at 8:27:40 pm
Last Edited By Emre Anil on Feb 1, 2017 at 8:31:43 pm

Create 2 Null objects and a Shape layer
Add an ellipse or rectangle for the dotted line
Connect the Shape Layer's position to the first Null Object's position
Add a Slider Effect to the Shape layer for amount of dot's you need and add the following expression to the Slider value:


Math.round(effect("Slider Control")("Slider"))


Add a Repeater to the Shape Layer and add the following expression to the Repeater's position property:


(thisComp.layer("Null 2").transform.position - thisComp.layer("Null 1").transform.position) / (content("Repeater 1").copies - 1)


Adjust the slider for the amount of dot's you need..


Return to posts index

Kevin Camp
Re: Connect two Objects with dotted line
on Feb 1, 2017 at 9:10:26 pm

much simpler method than my old method :)

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Julia Hoerr
Re: Connect two Objects with dotted line
on Feb 4, 2017 at 9:10:34 pm

Thanks a lot for your help. I tried your way and it works fantastic. You really saved my project.

When I have a little more time I will try the other suggestions as well to see what I can learn from it.
You guys in this forum are great.


Return to posts index


Kevin Camp
Re: Connect two Objects with dotted line
on Feb 1, 2017 at 8:44:39 pm

you can distribute layers between 2 layers with expressions. the initial set up is a little complicated, and you'll have a layer for each dot, which makes the comp a little messy if you have a lot of dots...

but here's the method i would try:

first, you'll need the layers that are tracking your points (likely 2 nulls) so make sure those are in your comp.

next, create a null and name it 'Dot Control' (really you can name it anything, but then you'd also need to change that in the expression), and add a slider control from effects>expression controls. set the number of dots that you need in the slider (you can change this later if needed).

then create your first dot layer and make sure the ancho point is in the middle of the dot.

for the expression to work properly, the dot layers will always need to be just bellow the dot control null in the layer stack, so drag this dot layer bellow the dot control null. then add this expression to the dot's position property:
ctrl = thisComp.layer("Dot Control");
nTot = ctrl.effect("Slider Control")("Slider") - 1;
n = index - ctrl.index - 1;
target1 = thisComp.layer("Null 1"); // set this to one of your tracking layers.
target2 = thisComp.layer("Null 2"); // set this to the other tracking layer
p1 = target1.position;
p2 = target2.position;
linear( n / nTot, p1, p2 )

update the "Null 1" and "Null 2" (for target1 and target2) to be the 2 tracking layers' names.

now you can simply duplicate the dot layer until you have the number that you set earlier in the slider control. as the target layers move, the dots should follow and distribute to create a dotted line..

if needed, you can adjust that value and duplicate or delete dots as needed.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Blaise Douros
Re: Connect two Objects with dotted line
on Feb 2, 2017 at 11:52:50 pm

Good lord. You guys are WAY overcomplicating it!

Use the Generate > Audio Waveform plugin on an adjustment layer or solid, and set Display Options to Analog Dots. Set the Displayed Samples to the number of dots you want. Parent the Start Point and End Point to your two track points. Adjust the color and size of the dots to taste.

Boom. You're done. I've done this a million times, with the Lie To Me opener as the inspiration.

You can't make the path curve, it's always a straight line, but that's the only drawback to using this method. And no expressions are required, except the parenting expressions that you can do just by dragging the pickwhip from the Start and End points to your track points.


Return to posts index

Blaise Douros
Re: Connect two Objects with dotted line
on Feb 2, 2017 at 11:57:38 pm

For example:







At 23 seconds.

PS, this is a hunting video, so don't watch to the end if you're squeamish about hunting. No blood but some people get really bent out of shape by this stuff.


Return to posts index

Kevin Camp
Re: Connect two Objects with dotted line
on Feb 3, 2017 at 9:03:33 pm

nice. i've never found a use for audio spectrum until now

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Blaise Douros
Re: Connect two Objects with dotted line
on Feb 7, 2017 at 8:09:07 pm

I know, right? I don't do music videos, sci-fi VFX, or anything like that, so this is the only application I've ever found for that effect :)


Return to posts index

Julia Hoerr
Re: Connect two Objects with dotted line
on Feb 4, 2017 at 9:22:36 pm

Now I tried the audio waveform method. This really must be the easiest way. So cool
Thank you for this tip.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]