Menu

Tutorial 80: Auto-scale Trimmed Paths

Joe Clay | Jul 20, 2017

This week, we take a quick look at an expression that will automatically scale Stroke Width when the length of the stroke is below a certain threshold so our trimmed strokes don't just pop on or off.

Here's the relevant code that we apply to the Stroke Width property of any strokes we want to scale. This expects a Trim Paths placed outside any shape groups—it should be under the main Contents of your shape layer.

ramp = 5;
start = content("Trim Paths 1").start;
end = content("Trim Paths 1").end;
length = Math.abs(start-end);
if(length < ramp) { ease(length,0,ramp,0,length/ramp*value)  } else { value }

If you'd like to help support Workbench, check out my Patreon page. Thank you for even considering clicking this link to support what I'm doing. I appreciate it.