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

Expression to stop scaling in Child connected to Parent on Scale-Slider?

New Here ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

Hey gang- hope all is well.
I'm doing an After Effects project for a client, and I'm by no means an expert, and I need some help figuring out how to get some expressions working properly in relation to some parenting.
I'll see if I can describe it sans-pictures but I'll be happy to provide them if necessary.
There's three aspects to this particular bit of motion graphics- two parallel vertical lines (one parented to the other), one slider controlling ONLY the height-scale of the line (only attached to one line, but the other is parented to said line so it affects the height of both lines), and two separate little "dangly-bits" that extend and scale out of the bottom of the lines as they finish animating.
My client wants the slider to control the height of the lines for easy adjustment for future projects, without distorting or stretching the little flairs that come off them regardless of the size. Easy enough, as I've said I've got one line set to only scale vertically to the slider with this expression I found:
temp=thisComp.layer("VerticalSlider").effect("Slider Control")("Slider");
[temp,100]
The second line is then parented to this line, and voila, they scale just like I want.

The problem comes with the dangly-bits. I want them to always be at the same position hanging off the bottom of the line no matter the length of the lines they're on. Parenting them to the lines themselves does this, but they scale vertically and squish or extend in accordance with the lines' extending with the slider.
I'm trying to figure out if there's an expression I can put into both the dangly-bits so that they will MOVE with the lines (which are not actually moving position, but scaling to become longer), but not SCALE. I've found several expressions from google results and YT videos that seem like they should work based off descriptions, but they only make the distorting problem worse.
Would love some help on this- project's not technically due until saturday but the client would love me to show a close-to-finished project today.
Thank you so much for your help- let me know if anyone needs any more information.

TOPICS
Expressions

Views

2.0K

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 ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

This should work:

L = thisLayer;

s = transform.scale.value;

while (L.hasParent){

  L = L.parent;

  for (i = 0; i < s.length; i++) s *= 100/L.transform.scale.value

}

s

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
New Here ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

Sadly this doesn't seem to work:

ex1.pngex2.png

You can see that as I move the slider, the one "dangly bit" with the expression on it becomes wildly distorted, moreso than without it.

But we're on the right track! Do you know where to go from here?

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 ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

My guess is that it has to do with skewing that happens when you combine rotation and non-uniform scaling. I'm not sure what to do about it though.

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
New Here ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

After Effects: Solving non-uniform scale issues | lynda.com tutorial - YouTube

Would something like this help? I tried using your expression along with this video's advice to no avail, but does that help give you any ideas?

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
New Here ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

ex3.png

I went ahead and also applied the same expression to another instance of the same effect I'm going for, in which the decorations at the top/bottom move with the scaling of the gradient seen above. They, unlike the "dangly-bits," don't have any rotation, scaling, etc. No transformation done to the layers themselves. Still, I get this weird distortion, as seen when I applied the expression to the "top horizontal line." When the slider is moved to change the scale of the gradient, the distorted top horizontal decoration will still squish and expand.

I'm getting the feeling that, since the expression you gave me SHOULD work with things, it must be its interaction with this expression placed on the parent layer to connect it to the slider:

temp=thisComp.layer("TopBottomSlider").effect("Slider Control")("Slider");

[temp,100]

Any idea of where to go if we look at it from that angle?

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 ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

>it must be its interaction with this expression placed on the parent layer to connect it to the slider:

Well, that does introduce non-uniform scaling to the whole hierarchy, but it's hard to say what's going on exactly without being able to see it.

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
New Here ,
Jan 17, 2019 Jan 17, 2019

Copy link to clipboard

Copied

LATEST

ex4.png

So here's a photo of the slider, the top layer, along with the shape layer that it controls and its expression, and the graphic parented to said shape layer.

However, interestingly enough, I tried removing the slider expression from "Gradient Mask" and then applying your above scaling correction expression to the Top Horizontal Line graphic and...

ex5.png

... we have the same distortion...

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