Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects bendable line with balls

  • bendable line with balls

  • Clinton Gorman

    February 6, 2023 at 2:45 pm

    How can I attach shapes to a line and bend the line without distorting the shapes?

    I’ve got a line that should have balls. When the line is bent, the balls should stay on the line and stay the same distance apart.

    Here’s an image of what I’m trying to accomplish.



  • Walter Soyka

    February 6, 2023 at 7:21 pm

    There’s a pointOnPath() expression that you can use to get, well, a point from a path. You pass a percentage as the input, and get back a point in the shape layer’s space.

    I put together a quick sample project that shows this in action. I’m here to teach, so let me know what questions you have after you look it over.

  • Clinton Gorman

    February 9, 2023 at 12:16 pm

    Hi Walter, thank you for this! I didn’t see a notification from creative cow from some reason even though I’ve enabled notifications.

    Anyways, I’m using ae 22.3, I can’t update because of problems I was having with older ae files for clients. Can you save for a previous version (22)?

    I appreciate your help!

  • Walter Soyka

    February 9, 2023 at 12:44 pm
  • Clinton Gorman

    February 9, 2023 at 1:27 pm

    Cool! But it looks like it lost it’s keyframes and parents. :/

    I hope this isn’t going to be too tough with different versions.

    Do you have a youtube channel? Maybe you can make a quick tutorial?

  • Walter Soyka

    February 9, 2023 at 2:08 pm

    There are no keyframes or parents — the balls follow the line via .pointOnPath() expressions. If you animate the Path on the “Line” layer, you’ll see the balls follow along. There are also a few controls for the rig you can modify on the “CONTROL” layer.

  • Clinton Gorman

    February 9, 2023 at 2:48 pm

    Ahhh, that’s exactly what I was looking for. Wow, so nice.

    I’m definitely going to have more questions, I’m learning AE on my own here using online tutorials.

    Thank you Walter!

  • Clinton Gorman

    February 9, 2023 at 4:11 pm

    I’ve duplicated the line with balls, created a new name for the line (Line2) and control layer (CONTROL 2). When I add balls, the balls stay on top of eachother. Do I only need to change the line layer name and control layer in the script for the ball? What am I missing?

    var thisBall =” “)[1];

    var numberOfBalls = thisComp.layer(“CONTROL 2”).effect(“Number of Balls”)(“Slider”);

    var insetAmount = thisComp.layer(“CONTROL 2”).effect(“Line Inset Squeeze Percentage”)(“Slider”)/100;

    var lineLayer = thisComp.layer(“Line2”);

    var linePath = lineLayer.content(“Shape 1”).content(“Path 1”).path;

    lineLayer.toComp(linePath.pointOnPath(linear(thisBall, 1, numberOfBalls, insetAmount, 1 – insetAmount)));

  • Walter Soyka

    February 10, 2023 at 5:09 pm

    Sorry, Clinton, I didn’t originally build the rig to support multiple layers in the same comp. I was using an expression to figure out what number the ball should be from the layer name.

    Here’s a second version of the project. This uses more obvious controls on each ball layer to select the line it should look at, and identify which number it should be. I’ve also moved the controls onto the line layer, so you can have different properties per line instead of globally.

    If you’re still kind of new to Ae, expressions can be pretty daunting, but if you have any questions on how they’re working, let me know and I’ll explain.

  • Filip Vandueren

    February 12, 2023 at 11:42 am

    Here’s a super simple version using Text on Path:

    View post on

Viewing 1 - 10 of 14 posts

Log in to reply.

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