Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Connect two Objects with dotted line

  • Connect two Objects with dotted line

    Posted by Julia Hoerr on February 1, 2017 at 6:21 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.

    Blaise Douros replied 9 years, 3 months ago 5 Members · 10 Replies
  • 10 Replies
  • Greg Gesch

    February 1, 2017 at 8:03 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?

  • Emre Anil

    February 1, 2017 at 8:27 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..

  • Kevin Camp

    February 1, 2017 at 8:44 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

  • Kevin Camp

    February 1, 2017 at 9:10 pm

    much simpler method than my old method 🙂

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Blaise Douros

    February 2, 2017 at 11:52 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.

  • Blaise Douros

    February 2, 2017 at 11:57 pm

    For example:

    https://youtu.be/MKBO-H9EK24?t=23

    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.

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Kevin Camp

    February 3, 2017 at 9:03 pm

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

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Julia Hoerr

    February 4, 2017 at 9:10 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.

  • Julia Hoerr

    February 4, 2017 at 9:22 pm

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

  • Blaise Douros

    February 7, 2017 at 8:09 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 🙂

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy