Skip to main content
mart-martinlofqvist
Known Participant
September 5, 2022
Question

Several length operations to shape layers - possible?

  • September 5, 2022
  • 4 replies
  • 1186 views

Hi, 

 

trying to achieve a setup where one layer ("Distance") make up the distance to several shape layers using the length function. I'm getting there but running into a couple of situations:

 

1.  I'm trying to have several layers be affected by each other - not going great. Is this a limitation of how the Expression system is constructed where each code runs in sequence?

2. Each time I add more than one length function on one layer the results is not what I'm expecting. Is this a limitation? 

 

I'm attaching a scene file with this test setup. 

Basically what I want to achieve is for each layer to increase in size[0] when the Distance layer is close and for it to affect all the other surrounding layers. 

 

Best

/M

 

This topic has been closed for replies.

4 replies

Mylenium
Legend
September 6, 2022

Here's a possible solution to your issue:

 

 

Since it would take too long to explain all the details, I've created a project (CS6) and attached it here. You can add as many rectangles as you like. You only need to adapt the references to the previous rectangle in the expressions and play with the values. Check the Controller. There are some options there for the gaps and scaling and the "Mover" is what drives the animation as it passes across the rectangles.

 

Mylenium

mart-martinlofqvist
Known Participant
September 6, 2022

Thank you a lot for the brain power on this one. 

Although this is very close to the existing setup I already have. 

 

 

 

Mylenium
Legend
September 6, 2022

This is not a limitation of expressions or for that matter JavaScript, you simply need to smarten up your code. Of course just measuring the linear distance with multiple objects will produce ambiguous situations simply because the distances may eventually be the same and yes, of course if you just slap on one such calculation after the other one result may override the other. You have to do your research and use more advanced math and algorithms. And please do everyone a favor and provide the actual code and screenshots, not projects. Not everyone has time or will to open projects and the version messinesss will simply make it impossible to look at your project if people use older versions.

 

Mylenium

mart-martinlofqvist
Known Participant
September 6, 2022

🫣

yeah, researching is exactly what I'm trying to do here. Thanks for not pointing me in any useful direction, real helpful. 

Noted about attached .aep 

Roland Kahlenberg
Legend
September 6, 2022

See if this tutorial on using Expressions to create a proximity effect helps - https://youtu.be/eEEd-YuBHn0


Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
mart-martinlofqvist
Known Participant
September 6, 2022

Thanks!! I'll look into that

mart-martinlofqvist
Known Participant
September 5, 2022

Oh, another thing I can't fully understand is that sometimes the selected shape of the shape layer differs from rendered shape. I'm guessing this has to do with the order of how this is executed but can't fully understand it.