Shape keys, or previously called Relative Vertex Keys (RVK) in Blender is a simple and effective tool to set up basic animations or different versions of the same object. In other applications shape keys can also be called morph targets.
How to use a shape key in Blender?
In the rest of this article we will take a deeper dive into shape keys and explain further the details and use cases of shape keys. We will also take a simple example and explore how we can export shape keys to be imported in another application such as a game engine.
We want to use shape keys when we need multiple versions of the same object. Let's take an example. Let's pretend that we have a bedside table with a drawer. Sometimes we want the drawer to be slightly open, sometimes closed, and sometimes fully open. Instead of creating three different objects we can create one object and use a shape key to adjust the drawers position.
Likewise, we could have a door object where we can open or close the door with a shape key instead of having to transform the doors position manually.
Shape keys can also be animated. Instead of creating a rig we can create a shape key for simpler animations and animate the shape key values instead.
So, when do we not want to use shape keys? Well, we probably don't want to use a shape key when a transformation becomes too complex. For example the folding of a beach chair or the motions of a character. That would require a more complex rig tailored for each case.
Other examples would be when the landing wheels of an airplane moves into position or perhaps the arm of an industrial robot moves and twists while performing its work.
Shape keys are available for mesh and curve objects. We will focus on mesh objects for the rest of this article. However, shape keys for curved objects are very similar and you should be able to handle them just as well as shape keys for mesh objects after reading this article.
With a mesh object selected, we can go into the object data tab in the properties panel. That is the green upside down triangle icon. Here we will find a “shape keys” section.
When we expand the shape key section, we will see an empty list were we can add shape keys. For shape keys to be useful we need to add at least two. The first one will be called “basis” and every key after that will be called "key" with a number. 1 2 3 and so on. With a specific shape key selected we can go into edit mode and make changes that will be bound to that specific key.
The first entry in the list that is called basis is the representation of the resting position of our object. The only thing this means is that it has no shape key data applied. It is just the object that we created.
When a key is selected, and we go into edit mode we are in edit mode for that specific shape key. It is therefore important to take note of which key is selected before you go into edit mode so that the changes that you make is the changes you intended.
If you do not want your edit mode changes to apply to a specific shape key you just select the basis key and enter edit mode as normal.
You can add and remove shape keys with the plus and minus icons. You can also rename a shape key by double-clicking on its name in the list.
Just below our plus and minus button there is a darker icon with a down arrow. This will bring up a menu with additional operations we can perform on our shape keys. Here we can do things like copy and pasting shape keys between objects. Quickly move shape keys up and down the list or perhaps mirror shape keys across the x-axis. Personally I never use this menu, but now you know that it is there and you have seen the available options.
Below this menu we have a couple of more arrows that will just move the selected shape key up or down the list. The order of shape keys is not important for the functionality of a shape key.
Below the list there is a checkbox named “relative”. In most cases we want this to be checked. If this is not checked the shape keys will behave differently. Instead of being able to manage them one by one they will be managed in a chain with a single value slider to apply each shape key in turn. Our only other option in this mode is to change the interpretation between keys. We will not use this mode very often. But if we do, the order of the shape keys becomes important.
The rest of the settings are individual for each key. The basis key has no additional settings. So if you want to view settings for individual keys make sure you select one. First we have the value slider that by default goes from 0 to 1. The lowest and highest possible values for the slider is set just below it. Use the range min and max settings.
A value of 0 will mean that this key has 0% influence and a value of 1 will be 100% influence. If we were to change the max setting to let's say 5 that means that if we bring the value up to 5 we can create a 500% influence.
The vertex group will limit the keys influence to the vertices in the group and the “relative to” setting will determine the key that the current key will has as it’s resting key. Generally this is the basis key.
Now we will look at a simple example. We will start with this model of a low poly Christmas tree.
The goal is to make a few alternative trees without having multiple objects instead we will use shape keys to create the variations. Let's look at how we can do this.
First go to the object data tab in the properties panel and find the shape key section. Click the plus icon twice to add the bases and the first key. Make sure the first key is selected and enter edit mode.
It is possible to add extra geometry but that is not the intended purpose. It might give you results that may be hard to work with.
Then will just start to move some vertices around to make a variation of this tree. This is my result.
When we go back to object mode all vertices will instantly jump back to their original position. This is because the shape key that we have just edited is not active. It has 0% influence on the object. To let the shape key have influence just move the value slider while you still have the key selected.
Now we add the second key. Make sure that this new key is selected and go in to edit mode. Notice how the object Goes back to its original shape when we enter edit mode while having a new key selected. Make some adjustments for this new key and tab out to object mode.
Any new shape key will start with the basic form of the basis key.
Now we can blend the values of our two shape keys to create small variations of our original tree.
This is just one use case for shape keys. In the introduction to this article we gave some more examples as well as some examples when not to use shape keys. One very common use case of shape keys is to make small animations or variations like this to use in game engines.
Before we wrap this article up we'll take a quick look at how we can export shape keys, and we will use Unreal Engine as the import example. It is a very simple process.
We can export an object with shape keys using the built-in fbx exporter. There are no special settings required. Shape keys will be exported with the object using the default settings.
If we later want to import our object together with our shape keys, we may have to use special import settings in the application we are importing to. Let's take Unreal Engine as an example. To import into Unreal Engine we can drag-and-drop the file into the asset manager inside Unreal Engine.
We will get the prompt with imports settings, and we will need to check “skeletal mesh” and “import morph targets”. If you remember from the introduction, morph targets are the same thing as shape keys.
How do I import shape keys to unity?
Just like with Unreal engine, drag and drop your fbx into unity. When importing, make sure that “Import BlendShapes” is selected in the import settings.
Blendshapes? Is that another name for shape keys?
Yes, morph target, shape keys, blend shapes or relative vertex keys. There is no real name standard here.
Can I animate a shape key?
Yes, hover the key value and press “i” to insert a keyframe. Move your play head in the timeline to another frame. Change the value and press “i” again. The shape key is now animated over time. There is a lot more to learn about this but this is the very basic first step.