Workbench
patreon
Tutorial 80: Auto-scale Trimmed Paths
🕑 Added 2017-07-21 03:08:42 +0000 UTC As always, thanks for your support!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 }