Skip to main content
Participant
October 6, 2022
Question

Composition within a Composition and maintaining stroke width?

  • October 6, 2022
  • 2 replies
  • 503 views

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!

This topic has been closed for replies.

2 replies

Mylenium
Legend
October 6, 2022

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

Participant
October 6, 2022

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.

Dan Ebberts
Community Expert
Community Expert
October 6, 2022

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

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

Holy smoke wagons that did the trick. You saved my day, man.. Thank you.