I am new to After Affects CC but very experienced with Illustrator. I am trying to animate this logo to behave as if it is being continuously drawn. So it basically draws itself over and over. A looping GIF.

I originally had a fill in illustrator but when I copy and pasted it into a new solid layer in After Effects it splits the fill into 5 masks and animates each new mask individually. So now the logo is 5 different shapes and not 1 continuous stroke. I am using Effect > Generate > Stroke. So then I drew the logo with one single stroke using the variable width tool to adjust the stroke width. Copied it into After Effects the same way and After Effects splits the single stroke into 2 paths? I have the same problem. Is there anyway to join the masks into 1? I don't understand why After Effects is splitting a single stroke into 2 separate masks? I have experimented with using Add, Subtract etc. on the masks in After Effects but that still makes no difference to it still being split into 2 separate masks. See pictures. Thanks for any help.

Illustrator Stroke

After Effects Result


3 Answers 3


After Effects doesn't have variable width strokes so trying to import them from Illustrator will just expand the stroke. If you're trying to animate a variable width stroke then you'll need to animate a regular stroke and use the outlined variable width stroke as a mask.

Unfortunately with a single intersecting path then you'll end up with something like this:

enter image description here

There's not much of a way around that while keeping it as a single stroke (you could cleverly mask the overlaps, but that's not very practical). The easiest solution is to separate the paths so each overlap is its own distinct path (with its own mask too)...

I'll walk you through how I did this. The explanation looks long and complicated, but it actually only took me ~15 minutes once I knew what I was doing.

In Illustrator, you first need a path for the stroke animation, and an outlined stroke for the mask. The path for the stroke needs to have a basic appearance to import in to After Effects correctly; no brushes or width profiles. It can have a basic stroke but nothing else (and you can change the stroke once we're in After Effects anyway). The outlined stroke to use as the mask just needs to be an outlined version of your variable width path.

You should have something like this (viewed in outline mode):

enter image description here

Still in Illustrator, separate the paths so that no path intersects itself (in this case you need three paths). You need to do this with both the stroked path and the mask paths.

This looks a bit complex but it isn't really, you just cut both the path and mask in three and place everything in its own layer (After Effects needs everything in its own layer to import properly). The overlaps are just to prevent rendering artefacts where the paths meet.

enter image description here

Import the AI file in to After Effects.

Convert the first stroke path layer to a shape layer (Right click layer → Create Shapes from Vector Layer), that should give you a new shape layer with a single path — you can then delete the original AI layer.

Set the stroke width wide enough to completely fill the mask and add a Trim Paths from the "add" button on the "Contents" property of the layer.

enter image description here

Then all you need to do is animate the "start" and "end" of the trim paths.

Something like this:

enter image description here

Repeat for the other path segments and you should have something like this:

enter image description here

That doesn't loop properly, but you can just duplicate the needed keyframes and loop at the appropriate place:

enter image description here

All that's left to do then is mask each stroke. You could use a regular mask but it's easier to just use the layers you already have as track mattes (track mattes are basically opacity masks, rather than vector masks).

Just make sure each mask layer is directly above the relevant stroke segment in the timeline and choose "Alpha Matte" from the track matte dropdown on each stroke layer:

enter image description here

The result:

enter image description here

  • This is an extremely useful response. I appreciate your time very much. Thanks again :) Aug 7, 2017 at 8:57
  • Yeah, great answer! Dec 25, 2017 at 3:28

In Illustrator when you create a variable stroke, it is no longer just a simple stroke to a path. Clearly when you are importing it into AfterEffects, it is expanding that variable width stroke into two paths. That might explain your problem. As to a solution, sorry I know next to nothing about AfterEffects, but couldn't you perhaps just use a simple stroked (non variable width) version of the logo for the mask you are creating in AfterEffects?

  • Thanks for your response. Yes I also tried this. The same thing happened. Seems like a problem that many would come across but found nothing after a day of googling :( Jul 26, 2017 at 11:14
  • Have you tried setting the stroke and fill to none in Illustrator - just import the vector path to AfterEffects?
    – Billy Kerr
    Jul 26, 2017 at 12:44
  • Yes unfortunately it doesn't quite work. When you up the brush size on the single mask in After Effects it does not maintain it's variable width that is needed for the logo. So it is just one single width stroke :( I appreciate your help. Jul 26, 2017 at 13:17

I had a similar issue and came up with an idea that may be an alternative solution - cutting the overlapping parts into sections and separate pre-comps. I created a video tutorial to show what I did - I hope this might be helpful: https://www.youtube.com/watch?v=moPWXM1jbpw

  • Hi Otavio, thanks for your answer! While we don't mind video tutorials, we do ask that you add the basics of your answer in the answer itself. Just so you remove the video one day, or youtube is down or the video is inaccessible in another way. Could you edit your answer to include the basic steps?
    – PieBie
    Dec 17, 2018 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.