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

Scaling with expression and then parent/child

Community Beginner ,
Mar 26, 2020 Mar 26, 2020

I want to create a scale animation like a comparison plandet video, it scale smaller as the new object bigger apear (follow parent), here the case

here is the link:

https://youtu.be/U_P9XKTPnxA

 

A size = 100%
---
A size = 60% (because it 40% smaller than the b)
B size = 100%
---
A size = 60% (parent to B, appear is 30% because it follow B scale down)
B size = 50%
C size = 100%
---
A size = 60% (parent to B, appear scale is 27,5% because it follow B scale down)
B size = 50% (parent to C, appear scale is 45% because it follow B scale down)
C size = 90%
D size = 100%
---
and so on

it works pretty well, i just copy the code from forum,
but as it scale down, it follow the parent anchor point

first, i want it to scale down on its on position
second, can i time it to start at the spesific second, like, B scale down at 6, C scacle down at 9, etc.
i already try action, start time, begin, etc doesnt work well

 

 

startScale = 100; // percent of Scale at start
endScale = 5/10*100; // percent of Scale at end 5 is the size of the shape, 10 is the size of the parent

scaleUpTime = 3; // time to scale up from inPoint in seconds

s = linear(time,inPoint,inPoint+scaleUpTime,startScale,endScale);
[s,s]

 


Thank you

TOPICS
Expressions , How to , Scripting
3.0K
Translate
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

LEGEND , Mar 28, 2020 Mar 28, 2020

Again - no need for parenting nor any reason to make it that complicated. Simply animate the scale directly and then use linear() functions and multiplication. Something like that:

 

pNext=thisComp.layer("Saturn");
pScale=pNext.transform.scale[0];

pOut=linear(value[0],0,pScale)*value[0]/100;

[pOut,pOut]

 

That's all you need to control the scale and keep the relative sizes intact. Everything else can be animated directly.

 

Mylenium 

Translate
LEGEND ,
Mar 27, 2020 Mar 27, 2020

You have to make up your mind whether you actually want to use parenting or expressions only. Using both only complicates things unnecessarily. Likewise, why even fiddle with time interpolation, when you can easily animate the actual scale and position shift? You are making this way too complicated and are just trying to be super smart when there is no reason to do so. The rest would be just a simple multiplication with the min and max values limited through a linear() expression with the next largest planet driving the scale of the adjacent smaller planet to keep the proportions.

 

Mylenium

Translate
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 ,
Mar 27, 2020 Mar 27, 2020

Im sorry im not expert here, i just think the concept how to do it in easy way. I copy the code from the internet too. It just how im thinking how it to be made. I think if i can follow the parent i can make it proportions, and for the first downscale i use expresion to make it propotion with the bigger one. and so on.


i dont even know what is time interpolation. Can you explain it in basic way? 

Translate
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 27, 2020 Mar 27, 2020

You are making the project much too complicated. The easiest solution I can think of is to use vector math to calculate the distance between the layers and use that to adjust the scale. The farther away the layer is from the main layer the smaller it is. If you use the comp width as a multiplier you can have the scale of the layer at the left edge be zero with the main layer is at the other side of the comp. 

 

Something like this would work on any layer tied to the Master layer by this expression:

 

point1 = thisComp.layer("Master layer").position;
len = length(point1, position);
scaleFactor = thisComp.width * 1.5;
ratio = len / scaleFactor * 100;
s = 100 - ratio;
[s, s]

 

If you put the slave layer on the left edge of the comp and the master on the right the slave layer would be 33% scale. Change the scaleFactor multiplier to 1 and the slave layer would be at zero.  To change the size vs distance ratio just change the multiplier.

 

The comp would look like this:

Screenshot_2020-03-27 14.00.33_Vo83yn.png

Duplicate the layers and move them around and get this:

Screenshot_2020-03-27 14.03.12_u5wyy2.png

You could even tie the multiplier to a slider control on a null and control the spacing of all layers at the same time. Then all it takes to do your animation is to position the layers and animate the opacity and position. Maybe something like this:

https://www.dropbox.com/s/wonc25tl3l0lrr2/scale%20reveal.aep?dl=0

 

 

 

 

Translate
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 ,
Mar 27, 2020 Mar 27, 2020

Thank you for your response, what if i want the scale based on the size of other object not by distance. Is that possible?

 

It will be very good to have expresion when i can just input the actual size. Maybe something like this.

A: 10km (100% of the scale before B appear)

B: 15km (100% before C) (Scale of A : 10/15*100%)

C: 65km (100% before D) (Scale of B : 15/65*100%) (Scale of A: 10/65*100%)

D: 1200km (Scale of C : 60/1200*100%) (Scale of B: 15/1200*100%) (Scale of A : 10/1200*100%)

 

and so on, so i think if i can parent A to B i only need to change the calculation once. Its not based on position but buy size it self. It compare one and another. I need to input the exact number to make it real comparison,

 

thank you

Translate
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
LEGEND ,
Mar 28, 2020 Mar 28, 2020

Again - no need for parenting nor any reason to make it that complicated. Simply animate the scale directly and then use linear() functions and multiplication. Something like that:

 

pNext=thisComp.layer("Saturn");
pScale=pNext.transform.scale[0];

pOut=linear(value[0],0,pScale)*value[0]/100;

[pOut,pOut]

 

That's all you need to control the scale and keep the relative sizes intact. Everything else can be animated directly.

 

Mylenium 

Translate
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 ,
Mar 31, 2020 Mar 31, 2020
LATEST

GOOD! it solved, what if i want that expresion have animation on it? I mean that expresion solved the propotion size problem, but how to make it scale down slowly? or i just need to zoomin the composition and zoom out slowly?

 

and what if i want it to scale down at 10 or 16

Translate
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