Just trying this. However for me, the auto orient isn't working. The rotation just isn't happening.
I tried creating a new simple comp - layer 1 with a rotobezier mask path, layer 2 a simple square. Linked them with your script and auto orient turned on - no joy.
It wasn't working until I added a keyframe on the 'Motion Path Complete' slider and now it is orienting. Maybe to do with the numkeys part of the expression? If no keys exist, auto rotate doesn't work?
Yes, that is correct. Auto-Orient will only work once you have keyframes on the slider. I thought I had mentioned that fact in the docs, but I guess I missed it. Thanks for pointing the omission out.
The other thing I just found is that if you accidentally turn on the layer's auto orient to path feature, it seriously messes with the expressions! I was scratching my head for a bit wondering why the layer would suddenly flip 90 degrees on the Y axis - until I remembered I had turned auto orient on when trying to troubleshoot the previous problem!
Yeah, I originally had the script working by using the Auto-Orient feature, but it ended up failing in some cases that had more than one motion path along with a couple details I can't remember right now. So I recreated the auto-orient in the expression and it worked better. It's not too surprising that Auto-Orient would conflict with the custom expression.
One thing that's missing that would make this script absolutely great is an update button. So when making a change to the mask path (as would happen a lot), pressing a button would update the null rather than having to reapply the script and then delete the extra null and controllers.
Even better, an automated update or live update would be great if possible?
That's a good idea. I'm not sure how easy it would be to get Live Update to work, but I think an update button on the script would be doable. I'll try to find some time in the next week or two to take a look at implementing it.
Oh, on another topic - if the layer that has the mask on is scaled, align to path doesn't work properly - can that be fixed? Not sure if that was a limitation in the docs at all?
I was hoping to create a layer, rotate along X axis to line up to a ground plane and animate a null along it so I can attach a camera to create a camera rig but the path is just drawn in 2D orientation. Can that then be rotated?
What you could do, would be to set up the path, and then drag the composition into a new composition, and make the original comp a 3d layer. That would let you rotate it, but I'm not sure if you would be able to use the camera as you want to.
One thing to make sure you don't do, is pre-comp the composition that has the controllers in it. That will break the expressions. This will be fixed in the update, however.
This script has now been updated! You are now able to update a path after you have attached an object to it. See the description or included docs for more information. Enjoy.
This is very close to the solution I've been looking for except I'd want the ability to have the object follow the selected paths in the order selected. i.e. it follows path_1 100% then switches to path 2 then to path 3 etc. I realize I could set that up with this script but if I want 100's of paths, I would want it done automatically.
Your script looks amazing... but it doesn't seem to work on french version of After Effects. I tried it on CS6 and CC, the expression isn't applied. No problem with english version of After Effects.
This script has now been updated again to work on international versions. I found a small bug in the most recent update which prevented it from applying expressions, but it has now been fixed. So please try version 1.6
I just got this script and it works well, my only problem is that when I duplicate the comp, and try to edit the mask in the new comp it wont update that one. is there an easy way to do that?
When I select to auto-align to path, the object seems to glitch and it'll randomly twitch its rotation while moving along the path. Also it'd be nice to have a button to remove all alignment effects and expressions. Thanks.
Sorry you're having an issue. What frame rate is your composition that is glitching?
Are you talking about a button to permanently remove all effects, or more like an animated checkbox so you can disable/enable the alignment when you need?
Auto orient isn't working for me either. There is no glitch and no other problem, but I cannot get auto-orient to work at all.
Also, is there no way to get it to attach to a mask layer that has been rotated? Not a huge deal, just curious. I saw your work-around for 3D space, and it's working perfectly for me on that! I just wondered if I wanted to stay in 2D, and rotate the mask layer.
I wish I had found this script before my last project - it would have saved me literally hours of time! If I can get Auto-Orient to work, I will be over the moon!
Just trying this. However for me, the auto orient isn't working. The rotation just isn't happening.
I tried creating a new simple comp - layer 1 with a rotobezier mask path, layer 2 a simple square. Linked them with your script and auto orient turned on - no joy.
AE CC 12.1.0.168
Ooooh, I take that back - well a bit.
It wasn't working until I added a keyframe on the 'Motion Path Complete' slider and now it is orienting. Maybe to do with the numkeys part of the expression? If no keys exist, auto rotate doesn't work?
Yes, that is correct. Auto-Orient will only work once you have keyframes on the slider. I thought I had mentioned that fact in the docs, but I guess I missed it. Thanks for pointing the omission out.
Adam
Docs - what are they
The other thing I just found is that if you accidentally turn on the layer's auto orient to path feature, it seriously messes with the expressions! I was scratching my head for a bit wondering why the layer would suddenly flip 90 degrees on the Y axis - until I remembered I had turned auto orient on when trying to troubleshoot the previous problem!
Right - going to read the docs now!!
Glad you got it working again.
Even better, an automated update or live update would be great if possible?
I think I'd use this script quite a bit
Cheers,
Paul
Hi Adam,
Did you get a chance to have a think about an update button? using the script on a few projects now - update would be very useful
Yes, I have gotten it working. I was planning on uploading it today or tomorrow.
Oh excellent - any chance of an early version at all? I'm working on the paths right now and it would be incredibly useful
For a future possibility - is it possible to do the same align to path but on a shape layer path? or is that a completely different ball game?
Cheers,
Paul.
The update will probably happen tonight, but I can't post it here. It will be under the normal place where you can download updates.
The best work around is to scale the mask, not the layer.
Is that the same for layer masks in 3D space?
I was hoping to create a layer, rotate along X axis to line up to a ground plane and animate a null along it so I can attach a camera to create a camera rig but the path is just drawn in 2D orientation. Can that then be rotated?
3D support would be even more awesome!
OK thanks - will need to re-think how I do it then.
Would you consider adding 3D support for the future?
OK thanks - maybe in time for the next project then.
If you could also look at support for scaled layers too, that would be great.
Thanks.
Oh cool thanks Adam.
Let me try that now...
Will give it a go.
Your script looks amazing... but it doesn't seem to work on french version of After Effects. I tried it on CS6 and CC, the expression isn't applied.
No problem with english version of After Effects.
Cheers,
Benoit
Unfortunately I can't let you know if it works because you don't update the trial version.
By the way, nice responsiveness!
Benoit
The updated version doesn't work either.
The expression isn't applied.
Benoit
Adam
Nice work.
Benoit