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

Stop children from scaling by parent scale

Community Beginner ,
Sep 29, 2019 Sep 29, 2019

So I have a composition with a single image that has this expression attached to its position:

[thisComp.width - 100, thisComp.height - 100]

 

clipboard_image_0.png

All this expression does is makes my image to be located in the right bottom corner. That's it.

 

But when I try to use this composition in other composition, my children image is scaled together with the parent scale:

clipboard_image_2.png

How do I make the image be located in right bottom corner, but do not scale with the parent?

TOPICS
Expressions
659
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 ,
Sep 29, 2019 Sep 29, 2019

Your workflow seems a bit odd, and all your screenshots are telling me is that you have a layer selected and put in the bottom left corner of one comp, then the comp has been placed in another comp and scaled-down unequally causing the graphic to be distorted. That's normal. I don't see any parenting. All I see is scaling. Collapsing transformations may reveal the rest of the arrow graphic but if you want to counteract the scale change in the nested comp you'll have to use an expression in the first comp, the one with the arrow to tie that layer's scale property to the scale property of the nested comp in the main comp. Did you follow that? You create an expression in the scale property of the arrow graphic that looks at the scale of the nested comp in the main comp and reverses the changes to keep things proportional. If you want the arrow to get bigger or smaller but remain undistorted, that's another calculation. 

 

If your main comp is called Main Comp and the first comp, the one with the arrow graphic is called Graphic Comp, and you wanted the arrow to always be the same size that it is in the Graphic Comp your expression would look like this:

 

newScale = comp("Main Comp").layer("Graphic Comp").transform.scale;
nx = newScale[0];
ny = newScale[1];
x = value[0] * 100;
y = value[1] * 100;
[x / nx, y / ny]

 

 

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 ,
Sep 29, 2019 Sep 29, 2019
LATEST

Thank you. This is exactly what I wanted! I also created a Slider Control "Index" in my "Graphic Comp" and made "layer" method use this "Index", so that I could use assign different indexes through Essential Graphics and because of that be able to use multiple "Graphic Comp" comps in my main composition

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