Face Rig.

Here is a simplified diagram of how a face rig works after it is built.

_images/FaceRig_scheme.jpg

Face MetaChain.

Face Metachain is a custom node that describes future face chain.

_images/FaceMetaChain.jpg

Naming.

{side}_{name}_{type}_mtnt

type can be module - mod, chain - chn, face bone - fbn, name should be one word. No underscores. Camelcase is okay.

Attributes:

mtBuildStage
Shows on what build stage this chain is now.
mtParent
Although, there is no real hierarchy in facerig, parent-child relationship is needed to structure things for other features. Chains, sliders and facebones connect to modules, module connects to “faceRig_mtnt”.
mtChildren
Same. Modules connect to chains and faceBones.
mtNumberOfJoints

Number of joints in module/chain. If its a chain:

-1 means that every vertex in chain will get a joint, -2 for every second, etc.

If the number is >0, will do exact number of joints.

Note

Most likely AutoSkinning algorithm wont work if you set joints number manually.

mtEyeball
Only if module. Shows if this module is an eyeball. Eyeballs have extra features like eyeBulge, lookat etc.
mtEyeBulge
Only for module and Eyeball. Enables eyeBulge.
mtEyeCollision
Only for module and Eyeball. Enables eyelidCollision.
mtEyeFleshy
Only for module and Eyeball. Enables fleshyEye.
mtVertices
Indices of vertices this chain/ module/ FaceBone_ is initialized on.
mtOffsetVertices
For chain: Vertices where script will offset pivots of joints. Needed for zipping For eyeball module: Shows vertices of the eyeball.
mtSkinCurveData
Needed for AutoSkinning. Shows loop indices up and down from main chain loop and skinweights algorithm should apply to them.
mtPoses
Links to face expressions. Read more in FaceExpressions section.
mtProxyParameters
Stores facechain proxyes transform and FaceBone_ Weight. In worldspace.
mtFaceBone
Link to FaceBone_ metanetwork.
mtZipTo
Link to another chain to zip to. Needed for zipping.

Editing Metanetwork.

Every metanode should be connected to others via “mtParent”,*”mtChildren”,”mtFaceBone”,”mtDriven”,”mtDriver”* and “mtZipTo” attributes all the way to the root “nopiaRig_mtnt”.

_images/FaceRigNetwork.jpg

Before you build anything, you can validate your metanetwork by pressing “Validate Scene for face rig” and “Graph Validation”. Script will check how your nodes are connected and tell you if something is wrong. Usually.

Building a faceRig.

Stage 0.

_images/FaceStage0_btns.jpg
Main Textfield
Face chains or modules rig will process. Helps to isolate rigging of some chains for deburring or step-by-step rigging.
Set face networks
Adds selected meta networks to the main textfield.
Link Joints
Links selected face proxy joints for symmetrical behaviour. Select joint on source side, then other joints in chain and press.

When your network is ready, you can start building it. First, you need to set vertices of chains and modules. Rig system then will use these vertices to create proxy curves and for AutoSkinning.

  1. Call a UI to set vertices by pressing “Set network data UI.” Button.
    It will merge all meshes in your “geom” group to one and create temporary mesh. This mesh has the same vertex order as your final mesh will have.
  2. Select network you want to add vertices to.
  3. Press “Set Network”
  4. Select vertices.
  5. Press set Vertices.
  6. Repeat for every face meta network you have. except for support_chains.

Note

Script merges all meshes from top to bottom of your “geom” group, so never reorder them after your vertices are set.

When your vertices are set you can start placing your face modules.

  1. Clean all transform data from face modules.
    ( Not necessary, but your modules can appear somewhere you dont expect(where they were in previous rig))
  2. Set a face module you want to build.
    By selecting networks ans pressing “Set Face Networks” button. Now system builds all modules no matter what you set. Its a bug. But you need to set it anyway, or system will build chains too.
  3. System will place them automatically first. Then you can tweak positions.
    Those positions are then stored automatically and reused when you rebuild your facerig.

Note

Eyes are placed automatically to the center of chosen offset vertices of eye modules, but you have to scale them manually.

Note

X axis of eye module should be aimed to sight direction.

Then you should place proxyes for facechains.

  1. Set a face chain you want to build.
    By selecting networks ans pressing “Set Face Networks” button. (if you wont select any rig will build all chains)
  2. Build your rig on stage 0.
    (If you forgot to set the number of controls under “mtProxyParameters” section, just undo your build.)
  3. Move face proxies where you want em. Curves should be as close to previously selected vertices as possible.
  4. Repeat for every chain.

Here is how it should look.

_images/FaceChains.jpg

Note

You can place modules after you placed chain proxies and vise-versa. At this stage they are not connected and its safe.

Stage 1.

_images/FaceStage1_btns.jpg
CrSecCtrl
Creates secondary controls in in same place where your temp joints are.
SortVctrs
Makes sort vectors for skinning (next stage). No need to tweak them now, just check if thouse appear.
Conv2Sslv
If checktd, will convert your temp curves to curve solve custom nodes.
PrjOrDrive
Parents chain to face module, or projects it on module’s surface or parents it to another chains(if its support chain)
DeletePxs
Deletes old temporary proxies.

When all your proxies are in place, you should rig stage 1. On this stage rig will convert temporary curves to curveSolve custom nodes, place joints, create projections, create secondary face controllers. Rig it and check if everything is fine.

_images/mtNumberOfJoints.jpg

Warning

If you will try to undo this stage maya will most likely crash. So, save your scene before you do, so you can come back and change some attributes, if you forgot, for example, set number of joints.

Known issues on this stage: If your joints appeared are on the opposite side of the eye - check scale on module control’s offset. It might have double negative scales. Scale should be negative only on Z axis. Secondary controls might not affect your chains as you expect. This is temporary. They will be connected properly on stage 5.

Stage 2.

_images/FaceStage2_btns.jpg

If everything is good with joints and controls, you can proceed to autoskinning stage (Stage 2) To setup autoskin you have to set MtSkinCurveData attribute on every chain. Modules are skinned differently, so you don’t have to touch that attribute on modules.

MtSkinCurveData attributes shows autoskin algorithm how many loops up and down from the main one it should skin. To set where up and down for a particular chain is, you need to build sort vectors on previous stage. Note that system only sorts first vertices, then it can tell where up and down is by checking connected vertices. So if your chain bends along its direction a lot, just set where up and down is only where it starts. (Check indices of your controls or proxy joints to see where it starts.)

Algorithm will search vertices that are close to chain joints and skin them as you’ve set. Note that if you have made 1 joint for each vertex, weights will be exactly that, if sth else, algorithm will try to blend between neighbour joints.

_images/sort_vectors.jpg

First skinning might take a while, then you can save it to json and there will be no need to go through this. Unless you change topology, ofcourse.

If you do it for the first time, we suggest you to skin chains one by one, so you can see the result faster and try different skin values.

Note

At this stage there is no need to tweak skin yourself. Not all influences are added yet.

Known issues on this stage:

  1. No Joints error.
    If rig complains that chain doesn’t have joints, but it does, try to roll back and rerig the face to this stage. Maya’s undo/redo can cause that.

Stage 3.

_images/FaceStage3_btns.png
FaceBones
Rig will create face bones if checked.
SupprtLps
Builder will create support loops, if checked.
Get3Skin
If checked, and skin file exists, builder will import skin weights related to this stage.
Exp 3 Face Skin.
Exports this stage’s skin weights.
Visualize FaceBones.
Builder will create 2 temporary joints, that represent facebone’s base and aim. Place those where you need facebone to be.
Clear FaceBones.
Builder will delete 2 temporary joints, that represent facebone’s base and aim.

Face bones.

Face bone is a rig entity that drives face chains as parent and sits on the same skin level with face chain joints.

_images/FaceBones_network.jpg

To create a facebone you need to create its metanetwork, name it with “_fbn_” suffix and connect to children. MtFaceBone attribute of children connects to MtChildren attribute of faceBone.

Then you set its vertices as before and rig stage 3 with FaceBones checked

Support loops.

Support chains help to drive skin more precisely. For example, on eyes when skin penetrates eyeballs on blinking you want to create these chains to push vertices away from the eyeball. Support chains are driven by other 2 face chains.

To create support chains you need to create meta nodes that represent em. Add “Support” before affix, so builder knows its a support chain. Then connect MtChildren attribute of parent to “MtParent” of support chain.

_images/SupportChains_network.jpg

Builder will create a support chain for every loop between parent chains. Support loops will take skin weights from parents, so dont forget to skin those “between loops” on stage 2.

Stage 4.

_images/FaceStage4_btns.jpg
CrtSliders
If checked, Rig will create sliders. E.g. Main face expression controls.
CnnMdCtrl
If checked, Rig will connect module controls to their joints.
CnsFcCtrl
If checked, Rig will connect face controls to body rig. ( To head, for example. Rig tries to find em automatically. Default order is: c_headLattice, c_head, c_neck, c_spine. Rigger will pick one of these.
MatchCtrl
Will match secondary face control’s space to space of locators that drive face curves.

Create sliders

Read more about creating sliders in Face_poses section. You should plan your face controls and expressions at this stage already.

_images/FaceSliders.gif

Connect Mod controls

_images/ConnectModControls.gif

Blenshape skin merge

Merges all skins onto one mesh. This is temporary and very slow approach. Use only to preview your skins.

_images/BsMergeSkins.gif

Connect Face controls.

Connects main face controls and module controls to body rig. Note that secondary face controls are not attached yet.

_images/ConnectFaceControls.gif

Match Face controls spaces

_images/MatchSpaces.gif

Stage 5.

_images/FaceStage5_btns.jpg
ZippEyess
If checked, Rig will add eyelidCollision. Will be replaced with proper eye collision later.
ZippMouth
If checked, Rig will create lip_zipping.
MkeLookAt
If checked, Rig will add eye lookAt_controls.
MkIrisRig
Will add iris-pupil_rig to lookats. Works only with MkeLookAt flag.
EyeeBulge
Will add eye_bulging.
EyeFleshy_
Will add fleshy_eyes. This feature will be reworked.
Par2FaceB
Will Parent secondary face controls to faceBone_.
CrtPosess
Will create face expressions rig.
ScalRamps
Will make picked face chains scalable. To pick a chain enable MtScaleRamp checkbox attribute on chain’s meta node.
ExtraCtrl
Will match secondary face control’s space to space of locators that drive face curves. See driven_chains.
Get5Skin
Will try to import skin for stage 5. DOes nothing if skin is not exported.

In detail.

Eye Bulge.

_images/EyeBulge.gif

Eye bulge is essentially a sphere parented to eye joint. This sphere pushes eyelid joints out. Eye bulge controlling attributes are under extra attributes section on eye slider.

Bulge Radius
Radius of pushing sphere.
Bulge push
Determines how far this bulge sphere is pushed from eye center.
Bulge mult
Effect multiplier.

LookAt setup.

Has a main controller that controls all eyes. Has follow… Attributes to change spaces. Also has a controller for each eye. These controllers can be scaled to change pupil and iris size, iris-pupil_rig was enabled.

Iris-pupil rig.

_images/IrisPupilRig.gif

Joing based eye rig. Size of pupil and iris are controlled by scale and push values of eye joints.

If your iris and pupil dont scale properly, try to tweak Iris Pos and Pupil pos attributes on lookat controller.

Note

Currently eyeballs should be aligned to Z axis for this to work.

Note

Currently does not support inner eyes.

Eyelids Collision

Warning

Doen’t work yet.

Fleshy eyes setup

Essentially this is a slightly offsetted joint that inherits a small portion of eye rotation, making the whole eye move slightly. Hack. This should trigger eyelid poses. Will be fixed in following versions. To control how far this joint is from normal pivot, you can tweak Fleshy Push attribute. To control how much rotation this joint inherits, you can tweak Fleshy Mult attribute.

_images/FleshyEyes.gif

Zipping chains.

_images/LipsZipping.gif

To setup zipping you should connect MtZipTo attributes of two meta networks. .. image:: img/MtZipTo.jpg Also, zipping needs offset vertices to be set-up in order to work. Feature algorithm will move skinned joints to positions of picked offsets and parent them under old pivots. So chain can behave as before, but also will be able to zip along offset vertices chain.

If your normal joints are in, say, geometrical center of lips, offset vertices should be on the closest to other side lip’s edge.

Driven face chains.

_images/DrivenChains.gif

To setup driven chains, you need to connect MtDriven attribute of one chain to MtDriver parameter of second chain. Sedond chain will be driven by first. By default drive weight equals 0.5 on every chain controller. You can control that value by tweaking DriveMultiplier parameter on dirver’s chain controls.

_images/MtDriverDriven.jpg

Face Expressions

First you need to setup your fase expression network, or use existing one. Open face expression setup UI by clicking Pose Editor button.

_images/PoseEditor.jpg

First we need to create a slider. Start by selecting parent module meta network and typing a pose name and slider name in UI’s textfield. Also pick controlling attribute in combobox.

_images/PoseEditorPoseCreate.jpg

Click P+ (add pose). Here is what should happen:

_images/PoseEditorPoseCreated.jpg

Slider network is created and connected to “poses_mtnt” netwdork.

Now we need to specify chains that will be affected by this pose. For that, select meta chains and press C+ (add chains)

_images/PoseEditorPoseConnected.jpg

In the end it should look like this.

_images/PoseEditorPosesConnected.jpg

Then we rig until stage 5, where all face expressions are really created. Here we can tweak face poses.

Note

At this stage you cant add or remove influenced chains.

To do that we pick a pose from PoseEditor(Left combobox), then press Set pose context. This will hide all unnecessary controls.

_images/PoseEditorPoseContext.jpg

Now we move these controls where we need them to be when pose is triggered and press Save pose from context.

_images/PoseEditorPoseTweaked.jpg

To mirror pose to the other side press Mirror pose context

_images/PoseEditorPoseMirror.gif

Then we press Reset pose And continue with another pose.

To unhide all controls type “reset” to pose textfield and press Set Pose Context.