Day 1 - Place Objects Along A Path | After Effects Incredible Expressions Challenge

Sdílet
Vložit
  • čas přidán 5. 09. 2024
  • 13 Days of Incredible Expressions Challenges
    So cool, it's like free plugins!
    Project download: aescripts.com/...
    View full playlist: • After Effects Incredib...
    Want to learn more? Get The Power of Expression Book
    aescripts.com/...
    Check us out on Instagram / aescripts
    #aescripts #aftereffects #aftereffectsexpressions #thepowerofexpression

Komentáře • 94

  • @Eikonic_
    @Eikonic_ Před 2 lety +15

    very helpful! a tip for others, as this wasnt immediately obvious to me: in the linear( ) expression, the "10" defines the # of copies the path will support, or how many times the path is divided. I was trying to add 100 layers to the path and was stumped for a minute as to why i could only see 10 of them. so you can manually enter the # of layers there, or perhaps rig up a little layer index expression as i did that will automagically set the correct # inside the linear expression.

    • @yewsoonfatt
      @yewsoonfatt Před rokem

      hi, can you place repeater objects along the path?

    • @Eikonic_
      @Eikonic_ Před rokem

      @@yewsoonfatt i doubt it

    • @Condemic
      @Condemic Před 3 měsíci

      That really helped me out thanks!
      Another addition if anyone is looking for this too, I had all my objects aligned on a wavy zig-zag line. The position of my objects weren't aligned to my mask path. The layer of the path (wether it's a solid or shape layer) needs to be at postion 0,0.
      Also parenting that '10' value to a slider control makes this entire animation editable, when you want more or less shapes in the futre.

  • @kerrhisng123
    @kerrhisng123 Před 4 lety +65

    pos = linear(index,1,10,0,1);
    thisComp.layer("PATH").mask("Mask 1").maskPath.pointOnPath(pos, t = time);

  • @justinfernandes113
    @justinfernandes113 Před 5 lety +6

    Wow! Never knew this! Keep em coming.

    • @aescripts
      @aescripts  Před 5 lety +1

      We are premiering a new one every day for 13 days: www.youtube.com/watch?list=PLZAr8tT8TcsRj62nIO7ILCMitj5RKjsMf

    • @11305205219
      @11305205219 Před 4 lety

      @@aescripts i can't open on mac in AE 2018 version

  • @daneeh806
    @daneeh806 Před 5 lety +2

    What a nice birthday present this could be...

  • @danielslusarz1
    @danielslusarz1 Před 5 lety +7

    Great tutorial! Works fine, but i was wandering what for are:
    numbers after index ,0,10,0,1 and
    what change t = time

    • @eurasia2941
      @eurasia2941 Před 3 lety +1

      The same for me. I am investigating and, if I find I shall inform you

    • @RanveerSingh-gd9ue
      @RanveerSingh-gd9ue Před 3 lety +2

      @@eurasia2941 the numbers in linear expression is to translate the value of the layer index to position on the path. for example: index 0 = 0, index 1 = 10% of the path, index 2 = 20%....so on and so forth. You can see by duplicating the circle each time it gets placed 10% ahead on the path.
      in path expression "t" by default is time. not sure why? but, as much I understand the expressions. it is so that it always looks at the path at the current time and set the value according to that. in other words, the circles will always follow the path even if you are animating it.

  • @mrmotiondesignberlin
    @mrmotiondesignberlin Před 2 lety

    Amazing, thanks!

  • @mymotherbitch
    @mymotherbitch Před 2 lety +2

    Great tutorial. Does anyone know how to orient the shapes automatically?
    Let's say I'm using a line instead of the circle, I would like the lines to radiate from the center.
    How can we do this?
    Thanks

  • @alexandremaye1221
    @alexandremaye1221 Před měsícem

    Hey! Great tips thank you! It work really well, but how can I attach precomp on it. I tried with a precomp and the position is offset.
    Do I need to add a expression for a precomp?
    Thank you 🙂

  • @mkozlinski
    @mkozlinski Před 2 lety +8

    Now it's limited to 10 objects only. Replacing "10" with "pos = linear(index,0, thisComp.numLayers-1,0,1) " allows to place any number of evenly distributed objects
    pos = linear(index,0, thisComp.numLayers-1,0,1) ;

  • @jim-friend
    @jim-friend Před 2 lety

    Great tutorial!!!!

  • @felipehoyos9252
    @felipehoyos9252 Před 5 lety

    So great!

  • @alfredmb
    @alfredmb Před 5 lety

    Wow! So cool !

  • @phillustrator
    @phillustrator Před rokem

    This is awesome, but I wish you explained more thoroughly. It's a good starting point to research how it's done though.

  • @pixmation-h3t
    @pixmation-h3t Před 5 lety

    I found it the returned pos for the circles are offset if the solid is not the same size of the comp.

    • @thepowerofexpression3472
      @thepowerofexpression3472 Před 5 lety +1

      As explained in a previous comment, you can add a toComp() method so the Objects will follow the path whichever transformation you apply to the Solid layer:
      pos = linear(index,1,10,0,1);
      point = thisComp.layer("PATH").mask("Mask 1").maskPath.pointOnPath(pos, t = time);
      thisComp.layer("PATH").toComp(point);

  • @TheKaver
    @TheKaver Před rokem +1

    Hello, how do you make something move along a moving path?

  • @marckhernandez7990
    @marckhernandez7990 Před 2 lety +1

    Sadly I dont seem to be able to use this expression, everytime I set the values I get an message saying Expression Disabled, error in line 3 in property Position :(

  • @yewsoonfatt
    @yewsoonfatt Před rokem +1

    hi, can you place repeater objects along the path?

  • @consp1rcy531
    @consp1rcy531 Před 4 lety +5

    Hi! Can I do this with pngs instead of shape layers? I'm looking to create a circle burst with gems.

    • @consp1rcy531
      @consp1rcy531 Před 4 lety +7

      For anyone wondering, yes, it is possible, I've done it downloading the project file. Then I copied the expression, deleted the shapes, and hooked my layer to the mask, and finally pasted the expression there.

    • @bakfiets32
      @bakfiets32 Před 2 lety

      ​@@consp1rcy531 My .png files are stuck in the same (top) position. FIXED! > at first, just adding PNGs and dubplicating them didn't work, but I left the old "OBJECT" layers in, removing those fixes the issue. Also: adding "pos = linear(index,0, thisComp.numLayers-1,0,1) ;" instead of the first line is fantastic - distributes the layers evenly (got that from Marcin Koźliński's comment 🙌💖)

  • @thedinardi
    @thedinardi Před 5 lety

    This is great and I can't wait to see the new ones!! Any chance we could get the scripts in the description for easy reference? Thanks!!

    • @aescripts
      @aescripts  Před 5 lety

      Just download the project file linked in the description

  • @EvgeniyShmukler
    @EvgeniyShmukler Před 3 lety +2

    Is it possible to confine myulltiple objects with North-South axes (assymetrical) along a path so that they keep orientation relative to its curves? So the North always point outwards?Is there a way to make it like "auto-orient along path" when making it move along it? Thanks a lot.

    • @fajrinaf
      @fajrinaf Před 2 lety

      Hi man, did you ever get an answer on this somewhere else?

    • @EvgeniyShmukler
      @EvgeniyShmukler Před 2 lety

      @@fajrinaf - quite some answers I found, but if you have yours it would be good.

  • @rihardsseso
    @rihardsseso Před 5 lety

    NICE IDEA

  • @markmcgovern629
    @markmcgovern629 Před 4 lety

    holy shit incredible

  • @jeric_synergy8581
    @jeric_synergy8581 Před 3 lety

    Trying to, and failing, to get the layers to move along the path in a looping fashion.

  • @diemmeti
    @diemmeti Před 3 lety

    Great tutorial, is there any way to scale the objects along the path so i can place more of them? Thanks

  • @hybrid3d
    @hybrid3d Před 5 lety +1

    Great Tutorials! Thank you!
    Rookie question: If I scale the mask path, the shape layer objects don't follow - why is that and is it possible? Thank you

    • @thepowerofexpression3472
      @thepowerofexpression3472 Před 5 lety +5

      Yes it should work as I show in the video. You can do all kind of transformations (Scale, Rotation, Position) to the path the objects follow. The only case when it offsets from the path is when you change the Transform properties of the layer containing the path but someone mentioned a great way to fix this by adding a toComp() method, so in our example if we want the objects to follow the path no matter the transformations made to the layer or path, we have to add this to the expression we wrote, so now it would be:
      pos = linear(index,1,10,0,1);
      point = thisComp.layer("PATH").mask("Mask 1").maskPath.pointOnPath(pos, t = time);
      thisComp.layer("PATH").toComp(point);

    • @hybrid3d
      @hybrid3d Před 5 lety

      @@thepowerofexpression3472 That's great Thanks, I couldn't get it to animate originally but I can do now. This is a great series thank you for the quick response.

    • @paulreed07
      @paulreed07 Před 4 lety

      @@thepowerofexpression3472 Thank you so much! Was trying to parent it to a null, but due to the expressions I never got it centered correctly for proper scaling. With the toComp Expression it works like a charm

  • @generodidtheedit
    @generodidtheedit Před 5 lety +2

    Anyone clever that knows a way to make it rotate when you duplicate it aswell? I animted a pop/snap effect & wanted to try it go around a circle.

    • @Condemic
      @Condemic Před měsícem

      Ever found a way on how to do this?

  • @1hrcreative
    @1hrcreative Před 5 lety

    Wow!

  • @sebastienbruzzo7489
    @sebastienbruzzo7489 Před 5 lety +1

    Hello AE team, thanks for the incredible expressions !
    I would like to know if there is a way to slide each shape along the path, while staying attached to it, and keep following the path's changes.
    Thank you !

    • @SpamBotRheinMain3118
      @SpamBotRheinMain3118 Před 3 lety +4

      var posOnPath = effect("Slider Control")("Slider") //Slider Range from zero to one
      thisComp.layer("Shape Layer 1").content("Path 1").path.pointOnPath(percentage = posOnPath, t = time);

    • @sebastienbruzzo7489
      @sebastienbruzzo7489 Před 3 lety

      @@SpamBotRheinMain3118 Thank you, but on which layer and property do you put this expression ?

    • @SpamBotRheinMain3118
      @SpamBotRheinMain3118 Před 3 lety

      @@sebastienbruzzo7489 put it on the layer of the oject that you want to place on the path. On the property layer.

    • @JamesSpinkUK
      @JamesSpinkUK Před rokem

      @@SpamBotRheinMain3118 Hey, so you mention a slider tool here, what layer is this? A new one? Also not sure where this expression should be place

    • @SpamBotRheinMain3118
      @SpamBotRheinMain3118 Před rokem

      @@JamesSpinkUK Hey , the "slider tool" is an effect you can put on any layer you want to.
      Look for "slider " in the effects tab.
      I usually put it on a CTRL Null.
      Then i pickwhip to connect to where i need the value coming from the slider.
      It creates a "interface" for you to interact with your effect

  • @dccnightowl
    @dccnightowl Před 3 lety

    Thanks for this tip! I do have a question that I just can't figure out though; how do you change the path?

  • @Eindrew9
    @Eindrew9 Před 3 lety

    this is great! what is the value that gives you the spacing between the objects on the path? I am using your values and the spacing is too large, I need it to be way smaller

  • @LuisMartinez-oh2nx
    @LuisMartinez-oh2nx Před 5 lety

    Nice.

  • @laplace8149
    @laplace8149 Před 5 lety

    I like it

  • @Elcastigador2013
    @Elcastigador2013 Před 5 lety

    demasiado bueno

  • @kalinatzenkova3100
    @kalinatzenkova3100 Před 3 lety

    This is aweseom! Thank you so much! It's sort of similar to something I've been tryng to do...
    I've been trying to find a way to connect the number of copies distributed along the path to a slider control. I'm trying to create a (e.g.) graphic that sort of fills seats in a congress (some are blue, some are red) and the controller controls how many are one color and how many are the other.
    Does anyone have any idea how you could achieve that? I've been really struggling to find the correct way to do that.

    • @RanveerSingh-gd9ue
      @RanveerSingh-gd9ue Před 3 lety

      If you are trying to show the seats of just two sets as blue and red. you can create an expression on the color property to set the color to blue or red if the index is higher or equal to the slider value.

    • @gretelrodriguez1842
      @gretelrodriguez1842 Před 6 měsíci

      I have a script on my github repo where I have something similar using a slider control but youtube doesn't let me add external links

  • @Gisburne2000
    @Gisburne2000 Před 5 lety +1

    You are duplicating the layers, so the expression is duplicated for each of 10 layers. I understand how that works. What if you now what to change the expression? Do you have to edit the expression in each of those 10 layers? Is there are way to have one, centralised function you can call from each of the layers, so that if you want to change things you just have to change that function once? I have a programming background but I'm new to After Effects and I don't yet know how such things would work in AE, or where those functions/expressions would be stored.

    • @aescripts
      @aescripts  Před 5 lety +1

      There is no official way to do this, you could hack your own by storing your function in a text layer and then evaluating the text contents.

    • @Gisburne2000
      @Gisburne2000 Před 5 lety +1

      @@aescripts Thanks, that sounds like a workable solution. Edit: I've now actually found an excellent way of doing what I described in one of your own videos, "Building your own Expressions Library": czcams.com/video/tGJaglcRiRc/video.html

  • @sethiarvinder
    @sethiarvinder Před 4 lety

    Hello. I did't know any language can i learn and understand Expressions in After Effects or need to learn any language first. plz tell me

  • @crissparkslove
    @crissparkslove Před 5 lety

    Great job! Thank you so much for this. Everything works fine, but if I try to set Auto-orient to an object, it doesn't work. Is this a limitation of this particular method? Thanks again.

    • @thepowerofexpression3472
      @thepowerofexpression3472 Před 5 lety +2

      Auto-orient only works for an Object that actually has its position moving. I assume that’s how After Effects calculates the correct angle between two positions.
      But here is a trick, because we are able to know the positions of all the points on the path, we can orient the Object toward the next point in the path. We just have to reuse the same expression and add a lookAt() method.
      In our example, turn the Object into 3D, and type this in the orientation property:
      pos = linear(index+1,1,10,0,1);
      nextPosition = thisComp.layer("PATH").mask("Mask 1").maskPath.pointOnPath(pos, t = time);
      lookAt(thisLayer.position,nextPosition);

    • @durnik
      @durnik Před 4 lety

      @@thepowerofexpression3472 I was able to add this expression to the shape layer's orientation property in order for each shape layer to Z-axis orient itself towards the layer directly above it:
      my_orient=lookAt(position,thisComp.layer(index-1).position)
      X=orientation[0];
      Y=orientation[1];
      Z=my_orient[1];
      [X,Y,Z]
      May have to finagle with the X=, Y=, Z= values to figure out how to orient on which axis.
      Thank you for your video!

  • @jacquescourtot2250
    @jacquescourtot2250 Před rokem

    Une traduction en francais serait la bienvenue !

  • @felipezapata3146
    @felipezapata3146 Před 3 lety

    I don't know why my object shows up far away from the path, does anyone have an answer for this?

  • @enricopiazza1779
    @enricopiazza1779 Před 3 lety

    Soundtrack please!

  • @11305205219
    @11305205219 Před 4 lety

    *Can't open with 2018 cc version on MAC*
    anyone can fix ?

  • @RJMAN625
    @RJMAN625 Před 4 lety

    How did you change the path from a circle to a rectangle to line? I've watched 0.25 speed over and over, but couldn't figure out. Someone, please tell me

    • @rayrnyc
      @rayrnyc Před 4 lety

      link mask one path to mask 2 path with pic whip

  • @erica22595
    @erica22595 Před 4 lety +1

    Excited for the book until I saw it was $89.

    • @andrewbird8624
      @andrewbird8624 Před 3 lety

      Same. There's an e-Book though which we can afford!

  • @Chris-eg9mg
    @Chris-eg9mg Před 3 lety

    link to the project file has been removed. Can you restore it?

    • @aescripts
      @aescripts  Před 3 lety

      You can download the projects from our site: aescripts.com/learn/after-effects-incredible-expressions-challenge/

  • @siddi2525
    @siddi2525 Před 5 lety

    gertting error: pointOnPath is not a function . what shud i doooo???

    • @aescripts
      @aescripts  Před 5 lety

      Download the project (link in description) and you will see how the working expression

    • @siddi2525
      @siddi2525 Před 5 lety

      @@aescripts already did. But its done in newer version of AE , i only have cc 17 . Or this expression works with newer vers only??

  • @MohammadAlshahrani
    @MohammadAlshahrani Před 3 lety

    very fast and there is in-between steps

  • @pavankumarn5898
    @pavankumarn5898 Před 5 lety

    this's not working in 2017 after effects?

  • @vitolinusa
    @vitolinusa Před 4 lety

    doesnt work

  • @paulreed07
    @paulreed07 Před 4 lety