I've wanted to do this task quite often, and I usually end up settling on something else that works. And in the case that I came across this time, I'll just draw a mask and animate it manually. BUT I would love to know if this is possible.
I had one idea, and it works to an extent, but it's not perfect. I added a gaussian Blur, then added levels with individual control. Make the alpha gamma zero, and animate the blur.
The problem with this, aside from making very stair stepped edges, is that it only works for objects that only have outside corners. Inside corners rounding gives a "melting" kind of look.
I really just want to evenly erode the entire alpha. Is that a thing and I just don't know what the effect is called? Doing that Should keep corners mostly intact.
Also, just to point out, this is a raster layer. Otherwise, yes, I could just a path offset.
Simple choker give me pretty much what I was doing, but with less steps. So thanks. I wouldn't have thought of that one. I don't use that tool much, so it's overlooked by me.
In my case today I found the illustrator file. So that was easy, just convert all those objects to shapes, and use the shapes which has offset path as an option. I just animated the offset.
I had a fill, and needed to convert it to a stroke. AfterEffects doesn't have a stroke option for which side the stroke is on. But you can sort of cheat that using offset path. Just add an expression so the path offset is your path thickness divided by two, and of course multiply that by negative 1 so it goes the right direction. That way it'll be inside no matter what thickness you make your stroke. Although, your expression will break if you hit zero I think.
That did the trick in this instance. Hopefully that method will help someone else down the road. For any geometric shape I definitely recommend just making a quick shape to use as a mask to erode the object.
And a note there, offset isn't there by default. You have to add that by using the little arrow in the top right just under the layer name (to the right of "Contents"
That's also where you'll find the Trim Paths, that seems to be generally overlooked by Most of the people answering questions on the internet on how to draw on/off a path. That's how to do it, not the stroke effect. The stroke effect makes corners look Terrible if they are 90deg or smaller. Trim paths has it's own issues with corners, but it's not nearly as bad.