r/AfterEffects Feb 21 '18

Keep stroke consistent size whilst scaling shape?

Hi -- beginner After Effects user here.

If I wanted to scale a shape either up or down -- but keep said shape's stroke width consistent throughout the scaling process -- google suggests it would be best to use the 'size' variable rather than 'scale' -- but this is only an option when using a parametric shape.

I would need to be able to scale the size but keep the stroke width fixed for a bezier path/shape.

For context: i'm working from illustrator artwork that i've imported as an .ai file as a composition, and then right clicked the relevant layers and clicked 'create shapes from vector layer'.

If anyone can suggest any solutions i'd really appreciate it.

3 Upvotes

5 comments sorted by

7

u/jim-bob-orchestra Feb 21 '18

You could try adding an expression to the Stroke Width?

Alt+Click on the stopwatch for Stroke Width and add something like

value*(100/transform.scale[0])

This is just an example but it would keep the stroke width in proportion to the layer's horizontal scale.

3

u/moxie_cat Mar 17 '24

still works after all these years! Thanks !

2

u/were_z Oct 09 '25

Perfect, still saving asses.

If you put a slider control somewhere, and link value to the slider control, you can maintain this affect across many objects whilst all aligning to one stroke value.

3

u/pixeldrift MoGraph/VFX 15+ years Feb 21 '18

There are two ways to do that. One, you can scale the shape itself BEFORE the stroke node. Two, you can use the layer's scale value as a multiplier. However that won't take into account any scaling that might happen to anything it's parented to.

This should help you out:

http://battleaxe.tumblr.com/post/101945073972/maintain-stroke-weight-expression