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 }
Become a Patron
If you'd like to help support Workbench, check out our Patreon page. For $5 a month, you get access to all of the tutorial project files we've made available as well as other monthly projects, rigs, R&D, elements, early product previews, and BTS content not available anywhere else!