top of page

Blender 2D Eye Quick Rig UI

Video
Breakdown

Task: Creating the base mesh for the eye along with the base materials for the eye

Method: Starting with mesh, I created a low poly circle with a fill at 0,0,0, then added subdivision modifier to make it rounded and smooth. From there, I needed to set up the mesh for the two materials: the toon eye outline and the inner eye. To do that I inset the face of the circle twice with small values using the bmesh operation, which created a set of inner faces and a rim of outer faces for the eye. Then, I selected the inner faces and outer faces using indexing and appended the materials to the correct groups. Lastly, I applied an offset in the positive direction so that I can symmetrize the mesh to create the right eye. I also created empties for the inner eye material texture coords to make a simple eye lid and pupil that will later be controlled by bones.

Task: Creating vertex groups to prepare from rigging

Method: I started with hard coded values based on the static location of the mesh. To select the vertices for a group, I drew a box using the minimum values to the maximum values. The hard coded method had many flaws especially with dealing with the negative values of the right eye. So, I changed it to be based around the offset from the eye being created. Which led to the rough formula above.

Task: Creating the armature and properly parenting it

Method: The first thing I learned was making sure all things are deselected with the armature layer wise. From there, the process started with creating all the bones for the left eye/side of the mesh. For the bones matching the vertex groups they need to match the name of the vertex group exactly to parent correctly. From each bone, I started with hard coded values that later changed to a similar formula from before. For the empties, I directly parented them to their bones.

Task: Creating customization

Method: The first version of this code only had one button and no customization so I had to figure out what areas that users might want to change. I identified the eye outline thickness, inner eye size, iris color, and the base location of the eye as options. So, in the property class, I added base distance to allow the user to select the offset / positive location of the left eye. Base height to allow the user to set the height of the eye before creation. The eye outline thickness that scales the inner faces either direction to be either thicker or thinner. For the inner eye size, I had to get into the inner eye material to allow the user to directly influence the location of the color ramp elements: 0 being the pupil size, 1 being the iris size, 2 being the white size. A similar method was used to set the iris color with the UI using a color wheel to set the color. Lastly, I added a bone selector that allows the user to select a bone from armature, and it also sets the mode back to pose.

Task: Connect and designing the UI layout

Method: I used Blender’s method to create the UI. For connecting the functions to the UI that is done by creating classes for each function and registering it so that it is connected to UI.

bottom of page