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

Composition within a Composition and maintaining stroke width?

New Here ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

Hi.

 

I am dragging COMP-1 into COMP-2 and then I'm scaling COMP-1 in various places on my timeline but when I do this, the STROKE WEIGHTS are also scaling but I want to keep them locked at 1pt. I DID apply the special "maintain stroke width" script on my strokes in COMP-1 but that doesn't seem to have any effect when working in COMP-2...  Am I totally overlooking something obvious here?  Thank you!

TOPICS
Expressions

Views

116

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 ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

You could try an expression like this on your stroke width:

L = comp("Comp 2").layer(thisComp.name);
value/(L.scale[0]/100)

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 ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

Holy smoke wagons that did the trick. You saved my day, man.. Thank 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
LEGEND ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

First things first: 1pt is a meaningless measurement in AE. It's always pixels. That said, you're not overlooking anything. What you want will require to apply an expression that inverts and effectively undoes the scaling. in the simplest form this could be something like this applied to the stroke with one the inside comp:

 

mScale=comp("Top").layer("Nested Comp").transform.scale;

mStroke=1;

 

mStroke*(1+(mScale-100)/100);

 

Of course you will have to adjust the reference to reflect your actual layer and composition names and tweak the values as needed.

 

Mylenium

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 ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

LATEST

Thank you, Mylenium....  I actually cut & pasted Dan's script (above) exactly as-is and it worked like a charm. I didn't even change the CompName in the script, which I probably should, but scared to mess with it at this point since it's working. I'll test your script as well. Pretty new to this.. Thanks for your time.

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