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

How to Maintaining Stroke Width when Scaling Disproportionately?

New Here ,
Jul 14, 2023 Jul 14, 2023

Hi!

I am currently working on a project where I need to scale a precomp or null horizontally (and not vertically), basically squishing the shapes in my precomp. Its too many layers to do manually. I have searched for an expression that will let me maintain stroke width when scaling a precomp, but none of them work when the scaling is not propotionate/ uniform. My stroke width keeps getting distorted no matter what I try. Does any one know a fix/ expression for how to maintain the stroke width when scaling horizontally. 

 

Thank you so much!!! 

TOPICS
Error or problem , Expressions , How to , Scripting
733
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

Community Expert , Jul 15, 2023 Jul 15, 2023

If you are working with shape layers in a nested Pre-comp, you need to start by putting your shapes in a group, then deleting the Stroke, then adding a Stroke to the group. Then you apply this expression to the Shape Layer/Contents/Group/Shape/Shape Transform/Scale:

x = comp("Main").layer("Conhtrol").effect("X Scale")("Slider");
y = comp("Main").layer("Conhtrol").effect("Y Scale")("Slider");
[x, y]

 Putting the stroke in the group and the Shape/Transform Shape/Scale expression, and the fills und

...
Translate
LEGEND ,
Jul 14, 2023 Jul 14, 2023

There is no such thing. You need to restructure your project. Without seeing your actual layout we can't advise, though. Could easily be that you just need to do the scaling differently by grouping your shape layers, not using the entire pre-comp or whatever.

 

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 Expert ,
Jul 15, 2023 Jul 15, 2023
LATEST

If you are working with shape layers in a nested Pre-comp, you need to start by putting your shapes in a group, then deleting the Stroke, then adding a Stroke to the group. Then you apply this expression to the Shape Layer/Contents/Group/Shape/Shape Transform/Scale:

x = comp("Main").layer("Conhtrol").effect("X Scale")("Slider");
y = comp("Main").layer("Conhtrol").effect("Y Scale")("Slider");
[x, y]

 Putting the stroke in the group and the Shape/Transform Shape/Scale expression, and the fills under the Shapes will let you scale the shapes and maintain the same stroke around all of the combined shapes. 

 

If you want the stroke around each separate shape, you will have to put each shape in a separate group. The basic Pre-comp would look something like this:

RickGerard_0-1689405841143.png

 

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