• No results found

Constructing a Shape Set:

Having made it through the gruelingly meticulous process of creating a shape-set, we are finally ready to start building stuff! Yay!

This section includes a lot of helpful sculpting tricks and techniques. I do not pretend to be a modeling guru (I am definitely not a modeling guru) but I have developed some good workflows for sculpting blend- shapes. These techniques will help save enormous amounts of time. Us- ing some freely available MEL tools (from highend3d.com) this section will help you maintain consistencies across lines of symmetry and gen- erally make your shapes look better.

Constructing a shape set involves a couple of steps that, if followed correctly, can turn a potentially disastrous waste of time into a pleasant day of sculpting. In addition to sculpting shapes, we have to take care of joint placement in the face and how to weight joints to the mesh.

Preparation and Organization

Before you start pulling vertices, make sure your mesh is finalized. Making changes to the character’s mesh (this includes UVs) can cause your blendshapes to not function correctly. Changes to the UV’s may

cause really nasty problems and loads of memory sucking history. Do not start work on an unfinished mesh!

Here is a list of things you can do to prep for constructing a facial shape set:

1. Make sure your mesh is final. (If I sound like a broken record it is be- cause this is such an avoidable pitfall)

2. Export the mesh as an .obj and scale it appropriately as described in the ‘Model Preparation’ section earlier in this chapter.

3. Create a new directory structure to hold all the blendshapes.

4. Duplicate the base mesh (without history) and put this in it’s own layer. Name this ‘baseShape’. This mesh will not be used except to du- plicate in order to start modeling another shape. Keep this mesh in a locked layer and do not touch it except to duplicate it.

5. As you work, save your files in steps. I usually use a lettering conven- tion (smileA.mb, frownB.mb etc...) but the important thing is that you can go back in time if you make a huge mistake (and you WILL). 6. Ensure that your modeling environment is setup the way you want it. I use a custom Maya shelf to house my most used tools during the modeling process.

7. Start modeling! Push and Pull Like Clay

For the majority of the blendshapes, you can simply duplicate the base shape and start pulling vertices. Using the move, rotate and scale tool provides all of the control necessary to sculpt any blendshape. What these tools do not offer, is efficiency. Wouldn’t it be nice if we could just push and pull on the mesh and have the surrounding vertices behave like clay? Thanks to the new Soft Modification tool in Maya 6.0, this is now possible.

Soft modification is not hard to visualize since it more closely resembles the way physical materials behave. By pulling on a single point on a mesh, the soft mod tool can affect surrounding vertices by a percent- age of the total transformation. This falloff is fully adjustable, allowing the artist to control exactly how each push and pull will affect the sur- rounding vertices.

Soft modification has been around for ages. Competing software pack- ages have had a variation of soft modification for many years. Alias has finally recognized the usefulness of such a tool and so they have included the Soft Modification tool/deformer in Maya 6.0. Better late than never I say.

There are some important things to know when using Maya’s Soft Mod tool, especially if you are coming from another package. Every artist (using every software package) has at one point or another experienced feature envy. It happens when you watch a friend or co-worker do something in another package that you cannot do in your own. When it comes to soft modification, I am afraid Maya is somewhat behind the times (it makes up for this in other areas). The problem lies in how Maya’s Soft Mod tool determines falloff. Remember, falloff determines the amount of influence surrounding vertices will inherit from your push/pull. Maya calculates this falloff by measuring the distance (in a straight line) from the soft mod point to each vertex. This creates the problem where a soft modification may affect areas of the mesh that you never intended FIGURE 4.105. The problem rears it’s ugly head in several areas of the face. Consider the upper lip up shapes. If you create a soft modification on the corner of the upper lip, the vertices on the

lower lip will likely be affected (even with a very sharp falloff). 3ds Max has a soft modification tool with the ability to have it’s falloff adhere to the distance along the surface as opposed to in a straight line. This may not sound like much, but boy would it be useful for blendshapes. I guess you could say I have a little bit of feature envy.

Figure 4.105.

Regardless, Maya’s soft modification tool is still a tremendous help with sculpting shapes. This brings me to the main point I want to make about sculpting in Maya:

Use whatever you can!

This ambiguous little exclamation means that you should resist getting tunnel vision while sculpting. Do not forget that one of the main reasons that blendshapes are so cool is because you can create them however you want. When sculpting shapes, use a combination of point pushing, soft mod, lattices, joint weighting, clusters, the sculpt polygons artisan brush and even sculpt deformers. Get familiar with everything under the Animation > Deform menu and keep an open mind. Do not worry about adding gobs of history because in the end, you can delete the history and ‘bake’ it all into a shape. All that matters is the end result, the means to get there are irrelevant.

Dealing With Symmetry

If you have taken any classical animation, posing, or composition courses, you will immediately associate ‘symmetry’ with being wrong. Indeed, having a perfectly symmetrical character can lead to boring, lackluster performances. The problem, for character riggers, is that asymmetrical meshes require about twice as much setup work because every blendshape (not only in the face) must be created separately for each side.

I would like to stress that, if possible, you should try to keep your crea- ture meshes perfectly symmetrical. The key word here is ‘perfect’. A perfectly symmetrical mesh will enable the setup artist to simply mirror each blendshape (for the face and body) without problems. A perfectly symmetrical mesh can be created by using the polygon mirror tools during construction. Careful attention must be payed to ensuring that the row of vertices running along the line of symmetry are perfectly planar. Without a planar line of symmetry, mirroring blendshapes is impossible. I paid special attention to ensuring that Zuckafa’s mesh was symmetrical FIGURE 4.106 . This careful attention enabled me to sculpt his shape set in half the time!

Figure 4.106.

But if I have to have a perfectly symmetrical mesh, aren’t my characters going to look cheap and boring? In the world of 3d animation, there are many different ways to make your character asymmetrical besides altering the base mesh. Often times, having an asymmetrical texture map, clothing or hair style is enough to break the curse of symmetry. Further asymmetry can be added by altering the default pose of the character. For example, a salty old sea captain can be setup with a per- fectly symmetrical mesh, but be turned into an asymmetrical character by altering the default facial pose to have him in a lopsided scowl. This provides the best of both worlds. Fast, efficient setup time, with an in- teresting, asymmetrical character.

Of course, this kind of workflow is not always possible. What if the char- acter has only one eye or is missing a limb? Well, in these cases, I can only recommend that you bite the bullet and create all the shapes for both left/right sides. Who ever said animation was easy?

Mirroring a Blendshape

Alright, so now you have a perfectly symmetrical mesh. You duplicated the mesh, sculpted the first shape (maybe a smile) and are ready to mirror it. You duplicate the smile blendshape geometry and enter a ‘-1’ into the scale X in order to mirror it across the Z axis. Voila! A perfectly mirrored shape, or is it...

Unfortunately, mirroring blendshapes using the negative scaling meth- od will not work. When applied as a blendshape deformer, you can witness this problem as you interpolate the shape between 0 and 1. The mesh will squish up and flip across the Z axis as the shape is turned to 1 (on). To understand why this does not work, you need to understand a little something about vertex ordering and the way Maya stores mesh data.

A polygonal mesh, at it’s most basic, is an array of points. These 3d points represent the positions of the vertices in the mesh. If you are familiar with MEL, you could represent this as an array of vectors (if you do not understand arrays and vectors, please revisit the MEL sections in the previous chapters and check the MEL help documentation. This is actually the model for a point cloud, (something similar, but quite different from a polygonal mesh) but because blendshapes have no re- gard for edges, (they only care about vertex positions) it can help to think of them as a point cloud.

So if we can represent a polygonal mesh as an array of vectors, then that must mean that each vertex corresponds to an index number in the array. Imagine a polygonal sphere named ball. We could represent it’s vertices in MEL like this:

vector $ball[];

Similarly, we can refer to any vertex in this mesh by the index of the ar- ray. The tenth vertex in the mesh could be represented by (remember, arrays are 0 based):

$ball[9];

This is the essence of vertex ordering. Simply put: Every vertex in a mesh has it’s own number.

You probably would have known this already if Maya did not do such a good job of hiding it. To see what the exact number is for a specific vertex:

1. In component mode, select a vertex on a polygon mesh. 2. Open the channel box.

3. At the top of the channel box, you should see the name of the shape node of the polygonal object, followed by the little message “Cvs (click to show)”. Clicking this will display the number of the currently selected vertex as well as the local space position of said point.

This seemingly useless concept of vertex ordering has some important implications for mirroring blendshapes. With vertex ordering in mind, think of a blendshape target as an array of displacements. Basically, a blendshape target is saying ‘move vertex X into position XYZ’. So, for example, let’s say you wanted to create a blendshape for a very simple Pinocchio character. We want a shape that can be used to stretch his nose when he is telling a lie. Let us assume that his mesh is really simple and his nose is only one vertex. To create that blendshape we do the following:

1. We duplicate his mesh. This creates an exact copy of the array of vec- tors that represented the first mesh. Let’s call this new array $target[] . 2. Next, we want to sculpt his nose shape. We can do this by selecting the vertex at the tip of his nose (let’s call this vertex number 268). To sculpt the shape, we pull the vertex at the tip of his nose forward in the positive Z axis (14 units), we can also pull it up slightly in Y (4 units). We just created a target shape that looks like he is lying (nose is stretched outwards).

3. This means that $target[268] = 0, 4, 14 .

4. If we apply our newly created target shape as a blendshape, it will displace the 268th vertex on the original mesh by the vector (0,4,14). This illustrates the importance of vertex ordering. Each vertex on a mesh has it’s own number and a blendshape works by displacing each vertex according to it’s number. Whenever a change is made to a mesh via the polygon tools, the vertex ordering will change. This can cause a target shape to affect the wrong vertices. Let’s say we merged Pinocchio’s hat mesh to his face mesh. This will cause a complete re-ordering of his ver- tices. The vertex at the tip of his nose will likely not be #268 anymore. Our ‘lying’ blendshape is rendered useless.

Sometimes, the vertex re-ordering can be subtle enough (as can be the case with some polygon operations) so that some vertices in the tar- get shape remain properly ordered while others are not. In this case, a blendshape may work on half of the vertices while causing random, unpredictable deformations, on other unintended parts of the mesh. Yuck! To avoid this common pitfall, make sure your mesh is finalized before you starting sculpting shapes. Modeling corrections will likely ruin all of your hard work.

With vertex ordering in mind, we can begin to understand how mirror- ing a shape is accomplished. If you have your mesh modeled in a per- fectly symmetrical way, each vertex on the left side, has a correspond- ing vertex on the right. When using negative scaling, the displacements you sculpted into your target shape’s left side are not mirrored to the corresponding vertices on the right. This is why the negative scaling method does not work. To properly mirror a blendshape, we need a tool that can copy displacements across a line of symmetry between the correct, corresponding vertices.

Unfortunately, there are no tools in Maya that can easily mirror a blend- shape. Fortunately, we can use MEL to do this. Before I introduce the solution I use for mirroring blendshapes, I want to talk a little bit about the process of finding solutions for problems with Maya.

So far, I have been showing you how to fix your own problems when- ever you encounter one of Maya’s limitations. I have been doing this by including extensive MEL lessons at the end of each chapter to explain exactly how the MEL fixes work. This chapter is no different, there is a large section at the end of this chapter dedicated to a MEL fix. But for this example, I want you to understand that you may not have the time (or the knowledge) to script a fix for every problem that crops up. Part of being a good TD, is knowing where to find help.

Before I set off to program a fix for something, I always check with the community to see if such a fix or workaround exists. Building up a net- work of reliable help is as essential to being successful in this industry as being able to use a mouse.

For this problem of mirroring a blendshape, I was able to find a solution within minutes. In fact, I found several different scripts available online and from those, I tried and tested until I found one that I liked. I finally settled on a script from highend3d.com by the name of abSymMesh v1.1. This little gem is scripted by the talented Brendan Ross. AbSymMesh. mel enables you to perform all sorts of symmetry operations on a po- lygonal mesh. I used it extensively during the construction of Zuckafa’s shape set.

To install abSymMesh:

1. Download abSymMesh.mel from www.highend3d.com. 2. Paste this script file into your Maya scripts directory.

3. Open Maya and execute ‘abSymMesh;’ from the command line. This will bring up the script’s user interface FIGURE 4.107. I have found this script to be quite easy to use because this interface is so well de- signed. To get started, you must select your mesh and click the ‘Check Symmetry’ button. This may take a few moments (depending on your CPU and the size of the mesh). The script will then spit out a message indicating whether or not the mesh is purely symmetrical. If it is, con- gratulations, you are ready to start sculpting a shape set. If not, you’ve got to rework the mesh if you want to use the mirroring features of this (or any other) tool.

Once you know your mesh is symmetrical (and thus ‘mirrorable’), se- lect the mesh and load it into the script by selecting ‘Select Base Ge- ometry’. The script will check the mesh to ensure it’s symmetry, and load it’s name into the text field. From here, you can perform several different operations on your target shapes like mirroring and flipping. The script works by comparing the currently selected target against the

base mesh that has been loaded. AbSymMesh is a real pleasure to work with and a fine example of how a simple search through the Internet can yield some very helpful, free tools.

Figure 4.107.

I would like to thank Brendan Ross and all other programmers out there who have helped the Maya community so much by releasing their scripts. As you become more proficient with MEL scripting, I hope that, you too, will release some of your scripts into the wild. It is a great way to find new friends and contacts while gaining renown in this tightly knit industry.

This exercise will cover, in detail, the process used to sculpt the left smile shape. Once sculpted, the lesson will finish by showing the user how to create a duplicate target shape with a smile mirrored onto the other side the face. This exercise uses the abSymMesh.mel script file. Please install this script from the DVD before continuing.

Sculpting the Smile Shapes Exercise 4.1

1. Open exercise4.1_Start.mb . This file contains only Zuckafa’s head, mouth and eye geometry FIGURE 4.108. It has been prepared according to the outlines stated in the earlier section on proper mesh preparation. That includes, scaling, ensur- ing symmetry (with the abSymMesh tool) and ex- porting as an .obj file. This is a good starting place to begin sculpting shapes.

Figure 4.108.

2. De-reference the layers so that you can select Zuckafa’s head geometry. Select Edit > Duplicate

and open the options box. Reset the duplicate op- tions (do not duplicate with any inputs) and hit ‘Apply’.

3. Move the duplicate mesh to the side. Name this mesh, ‘baseMesh’. It is from this mesh that we will duplicate to create the various different shapes. Create a new layer and name it ‘baseMeshLayer’. Add the baseMesh object into this layer and hide it while you work.

4. You can save this file now. Select the base mesh and duplicate it (again ensuring that no inputs or history are on). Name this shape, ‘leftSmile’. It is absolutely important that you name your tar- gets exactly as they appear in your list. Without a proper naming scheme, it will be troublesome to connect these shapes with a script.

5. Move this new mesh out of the way and throw it into it’s own layer. Hide or template all the other layers to prevent you from accidentally messing up the base mesh while you sculpt.

6. Open exercise4.1_MiddleA.mb to see the file before we start sculpting. Select the leftSmile mesh and press the ‘f’ key to center the camera on this object. The ‘f’ key is an essential part of my sculpting workflow as I like to move quickly between shapes without worrying about camera