• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Move out from center

Explorer ,
Mar 10, 2018 Mar 10, 2018

Copy link to clipboard

Copied

Hi There,  Someone last week helped me with this expression to get hundred little objects (molecules) to burst apart:

var slider =  thisComp.layer("Slider Control").effect("Slider")("Slider"); // pick-whip slider here 

var endPosition = wiggle(0,5000); // or use any other method to calculate the desired final location 

linear(slider, 0,100,value, endPosition)

The problem is that it's random, so they don't all leave the screen. I could increase the value (over 5000) but then they're traveling to far and too fast).

How can I use this expression to tell the "end position" to be, for example, "1000 pixels from the middle of the comp"  ?    So they all fly out from the center.

TOPICS
Expressions

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

As I describe here, you can use the “Distribute Circle & Spiral iExpression” for that:

https://forums.adobe.com/thread/2460447

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Hey Mathias!.. thanks again. You're right... you had told me this last week.

It isn't clear on the AE Scripts site:   which bundle do I need to purchase that contains the :

Distribute 2D Circle and Spiral Expression

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

wait ... just found it.   It's the "Layer Placement" bundle.   thanks again

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Hi Andrew,

yes, it is part of the "Layer Placement Bundle" (and the "Full Bundle").

Cheers,

Mathias

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Hi Mathias,

Maybe this is not what I need. I just watched most of the tutorial, and it shows all the layers in a circle. But my starting point is a random scattering of layers (see attached) ... 280 layers! ... From here in need them to fly away from the center.

Screen Shot 2018-03-11 at 9.54.37 AM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Play around with this:

minSpd = 500;

maxSpd = 1500;

seedRandom(index,true);

spd = random(minSpd,maxSpd);

angle = random(Math.PI*2);

t = time-inPoint;

value + t*spd*[Math.cos(angle),Math.sin(angle)]

Dan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Thanks Dan!  Mathias' expression might work... I'm trying it, but it's taking over 30 minutes to move each of the 300 layers into position!

As for what you sent ... where does this go?  Is this added to the original expression I posted at the beginning of this thread?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

It would replace that one.

Dan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

thanks! ... So I apply it to each layer (all 300!)  ... can I connect it to a slider so I can keyframe the movement outward?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Apply it to one layer, select that property, Edit > Copy Expression Only, select all the other layers, Edit > Paste

Dan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Thanks Dan! ... seems to work.  Same question:  ... can I connect it to a slider so I can keyframe the movement outward?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

I guess you could tie minSpd and maxSpd to sliders. If you wanted to control when motion starts, you could trigger the movement with a marker on a control layer like this:

m = thisComp.layer("control").marker;

minSpd = 500;

maxSpd = 1500;

seedRandom(index,true);

spd = random(minSpd,maxSpd);

angle = random(Math.PI*2);

t = Math.max(0,time - m.key(1).time);

value + t*spd*[Math.cos(angle),Math.sin(angle)]

Dan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Thanks again!  I'm getting a "this property has no keyframe number 1"  error

Screen Shot 2018-03-11 at 1.03.17 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Make sure the "control" layer has a marker.

For the iExpressions solution:

Yes, by default it places the layers in a circle around a fixed center. But there is a trick: If you enable the "use keyframe value as offset" parameter and set the center of the circle to (0,0) it will for each layer use its current position as "center of the circle" (i.e. use (0,0) + the keyframed position value as the center). That way each layer stays where it is but with the radius parameter can be moved away from that location. With the wiggle parameters you can increase randomness as needed.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Thanks Mathias!  ... I'd love to play around with this (I did purchase the expression), but it's very slow. It took over 30 minutes to add the expression to my 300 layers, every change takes another 30 minutes. The earlier expression you sent me (below) ... works much better ... but since the position is random, I can't get them all to leave the screen.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2018 Mar 12, 2018

Copy link to clipboard

Copied

LATEST

Hi Andrew,

yes, unfortunately Ae gets pretty slow with complex expressions on lots of layers. This Ciricle and Spiral iExpression is way more complex than the simple wiggle, hence it is slower. Maybe First test it with just 10 layers or so and when you are happy with the result apply it to the others?

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines