Using Shrink Wrap to define muscle bulges & skin sliding

By Michael Malinowski

Click the image below to view an avi of the guys arm moving using the shrinkwrap technique, compressed with cinepak
Sample file:
The use of muscles can add a quite a lot of subtle movement on a character, or indeed any object, if used to its full potential. However, to get an even nice and more realistic effect we need to simulate skin sliding over the muscles as they bulge. You could use clothe etc, however the problem being the time taking setup as well as the calculation time required is quite high (depending on the density and complexity of your mesh). There are a few tried and tested methods to create skin slide, I will attempt to demonstrate the method of using the shrinkwrap tool to gain slide over deforming objects.
Before you tackle this method on a character, or complex mesh, I would suggest you do some tests on much simpler objects, just so you can see how things react, and where the possible flaws of this method may lay.
Lets start by creating a 2 bone 2D chain like the one in the image along the left, then create a cylinder, that matches the length of the bones, and give it quite a few subdivision steps, just so we can defiantly see the deformations happening. For mine I have chosen the following settings (though this will depend on how long you made your bones)….

Height : 10
Subdivision U : 12
Subdivision V : 24

That should easily give us some density to play with making the effects very easy to see.

Now create a primitive sphere and align it with the first bone as shown, scale it down to fit inside the cylinders mesh (very important). Now make the sphere a child of the first bone, making the sphere follow the bone at all times.
Select the mesh and choose envelope, and envelope the mesh to both bones, do not envelope the mesh to the sphere (the effects of the sphere will be dealt with next) .
So now you should have the cylinder enveloped to the bones and the sphere should follow the first bone….. here comes the fun!
Move the effector to make sure the bones are in a stretched position, then open the local transform properties of the sphere, lock the property page, on the Y axis (or any axis of your choosing) right click and select "Link With" , and choose to link it with the rotation Z of the second bone. Now move the effector so the chain looks to be in this position, scale the sphere in the y axis to a larger size (that extends outside of the cylinders mesh), with the property page still open, right click once again on the link with icon, this time choosing "set relative values". Now when you more the effector, thus "bending" the chain, the sphere will appear to bulge….. well, scale, but it's a simplistic bulge effect.  
This is where we apply the shrinkwrap deformer to make the sphere effect the cylinder also, so select the set of points around the sphere that you want to be effected, then in the "model" menu choose, deform / shrinkwrap, you will notice that the points you selected suddenly jump the othe sphere, don't worry, this is supposed to happen ;).
This will open the shrinkwrap ppg, from here we will set it up to get the desired effects we require.
For now we will leave the amplitude at one, I would normally set a custom slider to this, just so that later, if I need any extra movement I can easily animate it through my own slider sets. But for now we will leave it how it is. As I mentioned earlier, and as you have probably noticed, the mesh has wrapped around the sphere, deforming your mesh in a non-desirable way, so we need to check the reverse option, what this does is instead of wrapping to the sphere, it will be deformed by the sphere if the sphere is pushed outside the mesh.

From here you should be able to see the effects the shrinkwrap has whilst you move the effector, if you hide the sphere the effects will probably be easier to see.
So now we have created a bulge that effects the mesh without needing to envelope the deformers. Though you probably wont see much sliding happening because the sphere is only being scaled, to see the full effects try either setting some shape keys, then liking the blend of the shape keys to the bone rotation, or simply moving the sphere around inside the mesh, if you re-open the shrinkwrap ppg, and choose "follow vertex normals" you may get a better sliding effect, depending on the type of shape you have.
Now you have the basis of how it works, give it a try on your characters, however I will point out some of the disadvantages of this method, firstly, because the deformation happens in realtime, if you have a lot happening on a dense mesh do expect a slight performance hit, my tip is to create a button that will mute all your shrinkwrap operators whilst doing your primary animation, then reactivate them once your ready to tweak.
The other downside, or at least caution to look out for is that the centre of the object NEEDS to be inside the mesh its deforming, so if you are moving the sphere around inside the cylinder for instance, you will notice that the moment the centre of the sphere is outside of the mesh the mesh will "pop" inwards, remember, when we revered the effect it will always pull away from the centre. Its really important to keep that in mind when setting up the muscle animations.
There are times when you will get "un-predicted" results, occasionally, if your muscles jump to an extreme position you may get an effect you don't welcome, this is where having the amplitude slider comes in handy, if you know something will cause an adverse effect, just animate the slider down gradually and with a bit of luck you should be able to hide any effects you don't want.

Click here to view an avi of a similar test i did previous to this, showing a shpere moving around under the mesh
  Hope this helps or at least inspires, any feedback would be greatly welcomed.
Mike Malinowski.