Day 1 - Place Objects Along A Path | After Effects Incredible Expressions Challenge
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
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.
hi, can you place repeater objects along the path?
@@yewsoonfatt i doubt it
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.
pos = linear(index,1,10,0,1);
thisComp.layer("PATH").mask("Mask 1").maskPath.pointOnPath(pos, t = time);
percentage = pos
thank you!!
hi, hi, can you place repeater objects along the path?
Wow! Never knew this! Keep em coming.
We are premiering a new one every day for 13 days: www.youtube.com/watch?list=PLZAr8tT8TcsRj62nIO7ILCMitj5RKjsMf
@@aescripts i can't open on mac in AE 2018 version
What a nice birthday present this could be...
Daneeh happy birthday brother
Great tutorial! Works fine, but i was wandering what for are:
numbers after index ,0,10,0,1 and
what change t = time
The same for me. I am investigating and, if I find I shall inform you
@@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.
Amazing, thanks!
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
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 🙂
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) ;
Great tutorial!!!!
So great!
Wow! So cool !
This is awesome, but I wish you explained more thoroughly. It's a good starting point to research how it's done though.
I found it the returned pos for the circles are offset if the solid is not the same size of the comp.
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);
Hello, how do you make something move along a moving path?
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 :(
hi, can you place repeater objects along the path?
Hi! Can I do this with pngs instead of shape layers? I'm looking to create a circle burst with gems.
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.
@@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 🙌💖)
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!!
Just download the project file linked in the description
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.
Hi man, did you ever get an answer on this somewhere else?
@@fajrinaf - quite some answers I found, but if you have yours it would be good.
NICE IDEA
holy shit incredible
Trying to, and failing, to get the layers to move along the path in a looping fashion.
Great tutorial, is there any way to scale the objects along the path so i can place more of them? Thanks
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
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);
@@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.
@@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
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.
Ever found a way on how to do this?
Wow!
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 !
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);
@@SpamBotRheinMain3118 Thank you, but on which layer and property do you put this expression ?
@@sebastienbruzzo7489 put it on the layer of the oject that you want to place on the path. On the property layer.
@@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
@@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
Thanks for this tip! I do have a question that I just can't figure out though; how do you change the path?
you can create a new mask, copy the path and paste on mask1, or just adjust the mask
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
I'm having the same issue
Nice.
I like it
demasiado bueno
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.
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.
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
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.
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.
@@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
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
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.
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);
@@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!
Une traduction en francais serait la bienvenue !
I don't know why my object shows up far away from the path, does anyone have an answer for this?
Soundtrack please!
*Can't open with 2018 cc version on MAC*
anyone can fix ?
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
link mask one path to mask 2 path with pic whip
Excited for the book until I saw it was $89.
Same. There's an e-Book though which we can afford!
link to the project file has been removed. Can you restore it?
You can download the projects from our site: aescripts.com/learn/after-effects-incredible-expressions-challenge/
gertting error: pointOnPath is not a function . what shud i doooo???
Download the project (link in description) and you will see how the working expression
@@aescripts already did. But its done in newer version of AE , i only have cc 17 . Or this expression works with newer vers only??
very fast and there is in-between steps
this's not working in 2017 after effects?
Not working for me either in AE 2019 :(
@@madetomuve cc 2019 me neither
doesnt work