-
Notifications
You must be signed in to change notification settings - Fork 15
FaceLibraryViewer
The Face Library Viewer allows to create a facial expression, using configurable AUs. These AUs are classified as follow :
- Upper Face AUs (eyebrows and eyelids...)
- Lower Face - Up / Down / Horizontal (Mouth openness or stretch...)
- Lower Face - Oblique / Orbital (Smile and other mouth configuration...)
- Misc (nose and cheek...)
As the class is dealing with AU, you have to connect this module to the SimpleAUPerformer, so you can see the resulting facial expression while using the editor.
In the left windows, you can see the sliders corresponding to the AUs, and the intensity value aside. Once you're done, you can save the facial expression using the File / Show Modifications option in the menu. The XML version of the settings will then be displayed in the panel. Next, you'll have to copy / paste the text in the facelibrary.xml file as shown below.
In the right window, you can see the resulting facial expression.
Each AU is asymmetric. It means, for instance, that you can lift only one eyebrow, while the other doesn't move. You can also set different intensity for each side of the AU.
This class can be found in the FaceLibraryViewer project (in the tools folder). There are 3 main functions defined in this class.
The first one sends a list of AUs. These AUs are send whenever a slider value is modified, thus the result of the facial expression can be viewed "in real time" on the player.
public void sendAUAPFrame(AUAPFrame auapAnimation, String requestId) {
ArrayList<AUAPFrame> list = new ArrayList<AUAPFrame>();
list.add(auapAnimation);
for (AUPerformer performer : AUperformers) {
performer.performAUAPFrames(list, (int) (Timer.getTimeMillis() / 40 + 1), "from face library viewer");
}
}
This one adds the corresponding AU to the list whenever a slider value is modified (with its intensity and side, if asymmetric). It then call the sendAUAPFrame function described above.
private void SliderAU39LeftStateChanged(javax.swing.event.ChangeEvent evt) {
int slider_value1 = SliderAU39Left.getValue();
double temp_intensity = slider_value1 / 100.0;
if (AsymetrieAU39.isSelected()) {
_auframe.setAUAP(39, temp_intensity, 2);
} else {
_auframe.setAUAP(39, temp_intensity);
}
sendAUAPFrame(_auframe, "from face library viewer");
}
The last one is related to the "show modifications" option in the menu. It displays the facial expression settings, as used in the facelibrary.xml. Once displayed, you have to copy/paste it in the XML file.
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add the code for saving FAP file in XML format
if (FaceExpName.getText().equalsIgnoreCase("")) {
JOptionPane.showMessageDialog(this, "Damn ! You forgot to give a name to this expression !");
} else {
XMLTree expression = XML.createTree("expression");
expression.setAttribute("class", "faceexp");
expression.setAttribute("instance", FaceExpName.getText());
for (int i = 1; i <= AUAPFrame.NUM_OF_AUS; ++i) {
AUAP left = _auframe.getAUAPleft(i);
AUAP right = _auframe.getAUAPright(i);
if (left.getMask() && right.getMask() && left.getValue() == right.getValue() && left.getValue() != 0) {
XMLTree action = expression.createChild("action");
action.setAttribute("name", "AU" + i);
if (left.getValue() != 1000) {
action.setAttribute("intensity", "" + (left.getValue() / 1000.0));
}
} else {
if (left.getMask() && left.getValue() != 0) {
XMLTree action = expression.createChild("action");
action.setAttribute("name", "AU" + i);
if (left.getValue() != 1000) {
action.setAttribute("intensity", "" + (left.getValue() / 1000.0));
}
action.setAttribute("side", "left");
}
if (right.getMask() && right.getValue() != 0) {
XMLTree action = expression.createChild("action");
action.setAttribute("name", "AU" + i);
if (right.getValue() != 1000) {
action.setAttribute("intensity", "" + (right.getValue() / 1000.0));
}
action.setAttribute("side", "right");
}
}
}
jTextArea1.setText(expression.toString());
}
}
Advanced
- Generating New Facial expressions
- Generating New Gestures
- Generating new Hand configurations
- Torso Editor Interface
- Creating an Instance for Interaction
- Create a new virtual character
- Creating a Greta Module in Java
- Modular Application
- Basic Configuration
- Signal
- Feedbacks
- From text to FML
- Expressivity Parameters
- Text-to-speech, TTS
-
AUs from external sources
-
Large language model (LLM)
-
Automatic speech recognition (ASR)
-
Extentions
-
Integration examples
Nothing to show here