Animating an AnimatedVectorDrawable with Blender

James Williams
2 min readDec 28, 2018

--

Photo by rawpixel on Unsplash

In a couple recent posts, I explored creating AnimatedVectorDrawables in Shape Shifter and Blender. For the most part, Blender has been relegated to a supporting role as a possible route to create initial graphics to be animated in Shape Shifter. In this post, Blender will be used for the all parts of the process save final export to AVD.

If you’d like to follow along, here’s the source Blender file. Note that there is a little bit of setup required to facilitate export, check out these wiki posts for details(Setting Up Blender and Exporting SVG from Blender).

We’ll be creating this animation. It uses an exisiting Android model I imported from SVG and some text.

Animating with Blender

Like most animation software, Blender’s animations are driven by key frames, which determine the start and end points of a transition and interpolate between them.

The timeline editor is a part of the default UI when you first open up Blender. It shows you an overview of key frames, specific moments in an animation where values are directly set by the animator.

So what can we animate? Almost anything can hold a value can be animated, even checkboxes. However, there’s a limited subset that is supported by SVG and Shape Shifter.

  • Path/Shape
  • Diffuse Color and alpha channel
  • Translation
  • Rotation
  • Scale

Creating Key Frames

You can create a key frame by hitting the ‘I’ key. If the cursor is over an attribute that can accept a key frame, it sets it. Otherwise, it will surface a context menu to figure out what you what to animate.

Let’s create a key frame for the arm at rest. Advance 20 or 30 frames and select the arm. Rotate the arm with the ‘R’ key. Set a key frame. Advance the frame counter and set a few more if you like. Make sure to create final key frame for the arm at rest.

You can play back the animation with Alt-A. Render the animation with the following the steps listed here to export to SVG and use the default settings for SVG2ShapeShifter to convert that file to Shape Shifter. The generated Shape Shifter file can be opened and exported to an AnimatedVectorDrawable with ShapeShifter.

In the next post, we’ll explore more complex ways to animate in Blender.

--

--

James Williams

Developer Relations Engineer at Google, Fmr Android Lead @Udacity