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

How to change position of multiple objects based on the scale of one

Community Beginner ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

Hi

I am trying to make the outer ring of dots in the polygon below move away from the central point of the composition when the scale of the null object changes. The null object is changing its scale based on audio keyframes.

I wanted the dots to move in reaction to the audio and this is the only way I can think of to do this. When I pickwhip the position value of the dots to the scale of the null object they do what I expected and bunch into the top corner of the composition.

Any help would be much appreciated as I'm well and truly stuck at this point. Screen Shot 2017-08-02 at 17.58.36.pngScreen Shot 2017-08-02 at 17.58.06.png

Views

3.8K

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

correct answers 1 Correct answer

Advisor , Aug 03, 2017 Aug 03, 2017

OK, I was feeling generous... here's a solution - I hope ; )

This expression assumes that your dot layers are not parented to any other layer.

1. Audio  layer.  [menu] Animation > Keyframe Assistant > Convert Audio to keyframes.

2. Paste this expression onto your first dot layer position property:

audioMin = 0;

audioMax = 50;

maxMove = 100;

radius = 500;

audioAmp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

compCentre = [thisComp.width/2, thisComp.height/2];

objPos = thisLayer.po

...

Votes

Translate

Translate
People's Champ ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

If i'm understanding you correctly you need to pre-comp the dots or parent them to a single null so they are one unit and then parent that single unit to the scale.  Think about it, you are pick whipping position in x & y to scale in x, y.  The scale is a value of 90 in x and y.  Show your rulers and find the 90,90 point on the screen.  It's in the upper left hand corner.  Basically scale interpolates differently than position.  Position originates at the upper left of the comp and increases right & down.  Scale originates at the anchor point of the layer and radiates outward.

~Gutterfish

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 ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

You need to add the original position value of the points to the expression. Your expression should be like this:

temp = thisComp.layer("Amplitud de audio").effect("Ambos canales")("Deslizador");

[temp+value[0], temp+value[1]]

Anyway, i think this is not what you are looking for. I think the best way to do this is to link the outer dots to a new null object via parenting, and link the scale of this new null to the scale of the "Central Pulse" layer via 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
Community Beginner ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

Thanks Jose

This is pretty much what I'm trying to do. So do I need to apply your expression to the central pulse layer and then add the values for the individual dots?

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 ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

The expression is only to apply to individual dots in case you don't link those dots to a new null. But I think the offset will be always in the positive ranges of position values so i'm not sure this is what you need.

The second way to do it is to link the outer dots to a null, then link the scale of the null to the audio keyframes in the Audio Amplitude layer.

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 Beginner ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

I tried using your second method already and this causes the size of the dots to change unfortunately. In your first method am I applying this expression to the dots position?

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
People's Champ ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

If you try to link the position of your dots to the scale of the null, even if you get them to move relative the their starting position they are all going to move down and to the right exactly the same together since they're all being driven by the same exact value.  Because you're using beam effect and all the lines are parented to the dots, that means all the beams are going to move with the dots.  The end result will be the entire object jumping down and to right in sync with the music. If that's what your trying to achieve then there are slightly less convoluted ways to achieve it.   But I suspect that is not what you are going for.

I suggest trying again to explain what you are trying to achieve in ridiculous, painstaking detail as it is not entirely clear (at least to me).  If you can they someone might be able to tell you how to achieve it.

~Gutterfish

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 Beginner ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

Yes I see your point.

Essentially what I want the dots to do is wiggle which I can do with an expression. However I want the outer dots to wiggle in a more exaggerated fashion in relation to the audio. For example if the keyframes in the audio amplitude have a higher value then the outer dots will wiggle more. The main problem with this however is that the dots will all move in the same direction, what I want them to do is move in a direction that is outward from the centre of the composition.

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 ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

Have you tried to put the anchor point of these outer dots in the center of the composition?

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 Beginner ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

Yes I have also tried this however parenting the dots to the central null object has caused my beams to disconnect from the dots

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
Advisor ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

grantM80  wrote

...what I want them to do is move in a direction that is outward from the centre of the composition.

I'm quite sure an expression can be crafted to do what you want. But as expressions are absolutely literal in interpretation you need to be absolutely exact in defining what you want - as Gutter-Fish requests.

The above quote says to me that you want the dots to wiggle ONLY on an axis between the centre of the comp (?) and their non-expressed position. My gut feeling is that isn't quite what you want.

Please think carefully about exactly what you want - or people will be wasting their time writing expressions trying to help you.

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 Beginner ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

Hi Mike

Yes you are exactly right. I want the dots to move on an axis between the centre of the comp and their original position if this is possible. As they are positioned in a ring shape I want them to wiggle outwards using an axis from the centre of the comp and their original position, and I would like them to move in relation to the audio. My apologies for being somewhat vague.

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
Advisor ,
Aug 03, 2017 Aug 03, 2017

Copy link to clipboard

Copied

OK, I was feeling generous... here's a solution - I hope ; )

This expression assumes that your dot layers are not parented to any other layer.

1. Audio  layer.  [menu] Animation > Keyframe Assistant > Convert Audio to keyframes.

2. Paste this expression onto your first dot layer position property:

audioMin = 0;

audioMax = 50;

maxMove = 100;

radius = 500;

audioAmp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

compCentre = [thisComp.width/2, thisComp.height/2];

objPos = thisLayer.position - compCentre;

Len = length(objPos);

Angle = radiansToDegrees(Math.atan2(objPos[1],objPos[0]))

move1 = linear(Len, 0, radius, 0, maxMove);

move2 = linear (audioAmp, audioMin, audioMax, 0, move1);

LenW = Len + move2;

objPos2 = [ LenW * Math.cos(degreesToRadians(Angle)), LenW * Math.sin(degreesToRadians(Angle))] + compCentre

NOTE:

You'll need to copy this to each of your dot layers - but before you do you, adjust the values on the first four lines:

audioMin = the minimum audio level to create any dot movement ;

audioMax = the maximum audio level to create dot movement ;

(look at the graph editor value graph for the audio amplitude 'both channels' property to decide on these values - vertical scale)

maxMove = the maximum amount of dot movement ;

radius = the radius of the outermost dot's position from comp centre ;

3. Once you've set the above values copy the expression to all the other dot layers.

Preview and report back.... : )

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 ,
Aug 03, 2017 Aug 03, 2017

Copy link to clipboard

Copied

I don't have time to play with your problem right now but my approach would be to use the length(point1, point2) method to retrieve the distance from the anchor point of the null and the anchor point of each dot then work out a linear or even ease method that adjusts that multiplies that value based on distance. The anchor point of each dot would need to be in the exact center of the dot.

The goal is to give you a new length based on the scale value of the null. Then you convert that length into a new position by retrieving the angle from the null's anchor point and the dot's anchor point.

I think that Mike Abbot may be on to something with his expression. I would have arranged it a little differently and used the position of the null rather than comp center, but his approach would probably work. I would probably throw in something like parent.toWorld (parent.anchorPoint) to take care of any parenting issues that you may have with the artwork.

On the other hand a much simpler approach would be to simply apply a displacement map driven by a simple multiplier based on scale to move things around. If you created a circular gradient shape layer with gray in the middle and white or black on the outside you would have it. This would make the dots grow but it would keep everything together. A slightly different look with a very simple expression and an adjustment layer or pre-composed dot/line comp.

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 Beginner ,
Aug 04, 2017 Aug 04, 2017

Copy link to clipboard

Copied

Hi Mike

Have just tested your expression and it works perfectly. Thank you so much for writing this for me! All the dots are reacting to the audio and pushing outwards from the centre of the comp which is exactly what I wanted them to do. A very clever expression indeed!

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
Advisor ,
Aug 04, 2017 Aug 04, 2017

Copy link to clipboard

Copied

Glad it worked for you, and I appreciate the kind words : )

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 Beginner ,
Aug 04, 2017 Aug 04, 2017

Copy link to clipboard

Copied

LATEST

No problem mate

I'm still studying as a student so it's great to get some help from a professional

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