background top

DesignByNumbers

Growing Vines in After Effects

Recently we had a project where the design required growing vines, a popular analogy for growth.  I had used masks before to create the grow effect but was never really happy with the results or the lack of flexibility with that method.  I searched the internet and found a number of different ways to do it but still it didn’t have the look I wanted so I modified one of those techniques to get what I needed.

I’m using After Effects CS3 in this tutorial.

The most versatile solution I found comes from the stroke effect.  The stroke effect mimics a brush stroke following along a mask path.  You can animate the start and end points as well as the thickness.  This would have worked fine, but I didn’t like how the stroke maintained the same thickness along the length of the path.  I wanted the think point at the top of the vine, getting thicker as it grew upwards.

To do this I used the stroke effect multiple times linked with some expressions for simple manipulation.

  1. Create a new composition for your vine.
  2. Next create a solid in the dimensions of your composition.
  3. Using the pen tool, draw a mask on your solid.  If you don’t close your mask its mode should be set to none by default.  Otherwise, right click on your path and select Mask > Mode > None
  4. Apply the stroke effect.  Effects > Generate > Stroke
  5. Increase the size of the brush size on this stroke -- it becomes more obvious without having to hide the mask.  Then play with the Start & End options on the effect control to see your vine grow and shrink. So far, it’s looking good but we don’t have that point of where the vine starts.  To do that we’re going to use multiple instances of the stroke effect.
  6. Select the stroke effect you just added and duplicate it a number of times.  The more instances you use, the smoother the gradation from point to full size.  For the purposes of this demonstration we’ll use 5 instances.
  7. For each instance of the Stroke effect make sure you have your Mask selected in the Path drop down.  I kept the default mask name of Mask 1.
  8. For the top instance only, select On Transparent from the Paint Style drop down.  This ensures we can add any background we want.  Make sure all the other instances are set to “On Original Image” otherwise each succeeding instance will overwrite the last.
    We don’t want to have to modify every single effect if we need to modify width or how gradual the point is.  This is where expressions come to help out.  First we need to add the controls that we will use to control the expressions.

    vine-2

  9. Add 3 sliders.  Effect >Expression Controls > Slider Control.
  10. Rename these controls to stroke end, stroke offset, stroke width.The stroke end control will control the end point of all instances of the stroke effect.
    Stroke offset will control how far apart each instance will be from the next.  This will allow us to modify how gradual the vine goes to a point.
    Stroke width will control the overall width of our vine.

    The basic idea is to use multipliers of the slider control.

    vine-11

  11. Expand out the effects of your vine solid in our composition timeline.  Expand the first stroke effect so you can see all it’s properties and then click on “Brush Size” to select it.
  12. We need to add an expression to this property.  Use the shortcut ALT + Shift + = or go to the menu Animation > Add Expression.
  13. Use the following expression: effect(“width”)(“Slider”) * 0.1This is basically saying  get the value of width custom slider we added and multiply it by 0.2.  Using a small decimal number gives us more control with the slider.  If the slider is set to 10 then our width will be 1 (10 * 1).
  14. Repeat steps 12-13 for the remaining stroke effect instances.  However increase the multiplier as you go.  For example stroke effect 2 would be effect(“width”)(“Slider”) * 0.2.
  15. Go back to our first stroke effect and select the property “End”.  Add an expression using ALT + Shift + =.
  16. Add the following expression: effect(“end”)(“Slider”) -- (effect(“offset”)(“Slider”) * 0.1)What we’re saying is to subtract our multiplier (0.1) from the end custom slider.  This will make each successive stroke be slightly less than our end custom slider.  In order to adjust the amount of the multiplier we muliply that by our offset custom slider.  That will uniformly increase or decrease that value.vine-3
  17. Repeat this for each successive stroke effect, incrementing the multipler (0.2, 0.3, 0.4, etc…)
  18. Take a moment to play with our custom sliders to see the effect.
  19. Now we can animate our vine by using the “end custom slider”.vine-4

You can tell right away would should probably add more instances of our stroke effect to achieve a smoother transition.  With the way the expressions are set up you should be able to add more instances without having to reanimate.  Just add extra instances with appropriate multipliers (you may have noticed that I setup the multiplier to be a tenth of the instance number. eg. instance 1 was 0.1)

Have fun animating your new vine.

Checkout the finished video below -- vine effect starts at about 30 seconds.

About the author
JeremyJeremy describes his favourite work moment with rtraction as the time the weekly team meetings were renamed to “Cake” to help improve morale. The initial “cake” was a resounding success with three employees contributing unsolicited desserts. Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life’s work is in reality a long string of 1’s and 0’s.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • Reddit
  • TwitThis

Leave a Reply