This tutorial is about setting up and adjust the facial expression for a character. SmartBody allows control over a character's facial expressions by setting weights for different face action units. By combining different facial poses with different blending weights, it can enables a character to perform various emotional expression or even perform lip-syncing animation to an utterance.
The first step is to setup the face definition for the character. The goal is to assign a proper face pose to each Face Action Unit according to Face Action Coding System (FACS) and to each viseme for speech animation.
bradFace = scene.createFaceDefinition('ChrBrad') bradFace.setFaceNeutral('ChrBrad@face_neutral') bradFace.setAU(1, "left", "ChrBrad@001_inner_brow_raiser_lf") bradFace.setAU(1, "right", "ChrBrad@001_inner_brow_raiser_rt") bradFace.setAU(2, "left", "ChrBrad@002_outer_brow_raiser_lf") bradFace.setAU(2, "right", "ChrBrad@002_outer_brow_raiser_rt") bradFace.setAU(4, "left", "ChrBrad@004_brow_lowerer_lf") bradFace.setAU(4, "right", "ChrBrad@004_brow_lowerer_rt") bradFace.setAU(5, "both", "ChrBrad@005_upper_lid_raiser") bradFace.setAU(6, "both", "ChrBrad@006_cheek_raiser") bradFace.setAU(7, "both", "ChrBrad@007_lid_tightener") bradFace.setAU(10, "both", "ChrBrad@010_upper_lip_raiser") bradFace.setAU(12, "left", "ChrBrad@012_lip_corner_puller_lf") bradFace.setAU(12, "right", "ChrBrad@012_lip_corner_puller_rt") bradFace.setAU(25, "both", "ChrBrad@025_lips_part") bradFace.setAU(26, "both", "ChrBrad@026_jaw_drop") bradFace.setAU(45, "left", "ChrBrad@045_blink_lf") bradFace.setAU(45, "right", "ChrBrad@045_blink_rt") bradFace.setViseme("open", "ChrBrad@open") bradFace.setViseme("W", "ChrBrad@W") bradFace.setViseme("ShCh", "ChrBrad@ShCh") bradFace.setViseme("PBM", "ChrBrad@PBM") bradFace.setViseme("FV", "ChrBrad@FV") bradFace.setViseme("wide", "ChrBrad@wide") bradFace.setViseme("tBack", "ChrBrad@tBack") bradFace.setViseme("tRoof", "ChrBrad@tRoof") bradFace.setViseme("tTeeth", "ChrBrad@tTeeth") brad.setFaceDefinition(bradFace)
This looks like a big chunk of codes, but it is actually very straightfoward. Line 1 simply create an empty face definition for the character. Then we need to first assign a neutral face pose as the baseline for all expressions. Here 'ChrBrad@face_neutral' is the file name for the face pose. After setting the neutral face pose, we also assign face poses for each action unit (AU) and viseme in a similar manner ( Line 3 ~ Line 27 ). Once we finish assigning the face poses, the face definition is set to the character. This way the character can start using these face poses accordingly when synthesizing facial animations.
Once we setup the face poses for the character, we can test the face expressions using Face Viewer by selecting Window->Face Viewer.
Here each slider indicates the weight for a specific face pose AU or viseme. Since these poses are additive, we can have different weights for multiple face poses. By adjusting the weights, we are able to change the character's facial expressions to reflect different emotions.
More details about configuring face definition and changing face pose weights via BML command can be found in Section Configuring Facial Animations and Lip Syncing and Section BML Face Command.
Attachments:



