Difference between revisions of "Expression Creation"

From Valve Developer Community
Jump to: navigation, search
m (typo)
(Task-orientated rewrite)
Line 1: Line 1:
This page covers the creation and manipulation of expressions in the FacePoser tool.
+
[[Image:Faceposer_expressions_tool.jpg|right|300px|The Expressions dialogue]]
  
=Expression Creation Tool=
+
An '''Expression''' is a static, reusable flex configuration which is stored independently from any scene file that uses it. An Expression cannot be modified on a per-scene basis, except in the [[Other FacePoser Tools#Ramp_Tool|ramp]], but will blend as normal. They are useful when many different scenes need the same expression or groups of expression (see [[#Creating_Markov_Groups|Creating Markov Groups]]); the [[phoneme]] library uses the system. They are also useful for quickly assembling 'rough draft' scenes.
<center>[[Image:Faceposer_expressions_tool.jpg]]</center>
 
  
 +
{{note|An Expression does not crossfade of its own accord. The ramp must be used to ease transitions.}}
  
The expression creation tool ("Expressions" tab) works in conjunction with any loaded Source engine model file (.MDL) in the 3d View and with the controls in the "Flex Sliders" tool. The general workflow is to manipulate the flex sliders into an expression that you wish to store for the model and then to right-click in the Expressions tool and choose "New Expression" which stores a thumbnail and the slider settings required to pose the face in the desired expression. One or more of these thumbnail/expressions become an expression class that can be saved/loaded to a .txt file for later re-use.
+
==Creating a new Expression==
 +
The following dialogues are used to create an Expression:
 +
*Expressions
 +
*Flex Sliders
 +
*3D View
  
A good starting point is to look at the facial expressions for each of the phonemes/visemes used to drive just the mouth portion of an actor's face during .wav playback. Choose "Expressions | Load…" from the main menu and pick phonemes.txt from the "expressions" subfolder. Alternately, you can load/save expression class files by right-clicking anywhere in the expression class tab row (where the names of the current expression classes are listed) and picking "Load…" from the context menu.
+
Make sure all are open on your workspace before starting.
  
If you have a model loaded and you load an expression class, FacePoser will check for changes that require recreating the thumbnails and will automatically recreate them as needed. Currently there are about 50 phonemes, so this might take a minute or so to complete. Any time you want to recreate all of the bitmaps for the current expression class file and current model, choose "Expressions | Recreate all bitmaps" from the menu.
+
#Create a new Expression Class with the <code>Expressions > New...</code> menu option. An Expression Class is like a folder (although it in fact takes the form of a .txt file), and you will want one of your own to ensure that your Expressions do not become inseparably mixed with Valve's preset phonemes. If you like, close the Phoneme classes.
 +
#Expressions are created by saving flex data from the Flex Sliders dialogue. Create your Expression there, using the 3D View for reference, and move on when you are satisfied.
 +
#To save your Expression, right-click on a blank area in the Expressions dialogue with the correct tab highlighted and click <code>New Expression...</code>. Fill in both fields on the new dialogue and click OK.
 +
#'''Important:''' Click the <code>Expressions > Save</code> menu option to write your work to disk.
  
 +
{{note|A bug in the current build of FacePoser means that Expression thumbnails will not be generated correctly.}}
 +
{{warning|Selecting an existing Expression will overwrite anything currently on the Flex Sliders!}}
  
<center>[[Image:Faceposer slider tool.jpg]]</center>
+
==Editing an existing Expression==
 +
[[Image:Faceposer slider tool.jpg|300px|right|The Flex Sliders dialogue]]
  
 +
Editing an existing expression is achieved by having it selected when modifying the Flex Sliders. This process adds several elements to the Expression thumbnail:
  
To select an expression, click on the thumbnail. Picking a thumbnail sets all of the sliders in the Flex Slider tool to the current flex settings for that thumbnail. Note that each flex slider has a checkbox indicating whether the slider is active for the specified expression.
+
*An asterisk (*) will appear to signify that the Expression has unsaved changes
 +
*A clickable undo history will appear
 +
*A <code>Revert</code> option will appear in the Expression's context menu
  
Most operations on an expression occur by right-clicking on the thumbnail. For instance, you can delete an expression by right-clicking on it and choosing delete from the menu.
+
Right-click on the Expression and choose the <code>Save</code> option to commit your changes.
  
If you make a change to an expression by moving one of the flex sliders in the upper right, then a few changes to the thumbnail will appear:
+
{{note|Expressions can be re-ordered by dragging. As ever, hit <code>Expressions > Save</code> to commit any changes.}}
  
First, a save option will become accessible from the right mouse menu. In addition, changing the sliders will create an Undo/Redo history for the expression. The undo button is the left facing arrow button on the left edge of the thumbnail. If you make multiple changes you'll see a Redo button next to it. A blue "*" will show in the upper left corner of the thumbnail showing that it has been changed. You can click the Undo and Redo buttons to cycle forward and backward in the change history for the sliders you've moved for the thumbnail. The 0/6 (e.g.) numbers displayed just show how much Undo information you currently have queued up and where you are in that stack of information. Hitting the Save button will clear out the undo information as the current state is committed to memory. Once you have made your first change to a thumbnail, a "Revert" option is also available in the right mouse menu. When you hit the undo/redo buttons, the sliders and real-time view (but not the thumbnail) will reflect the current settings.
+
==Using Expressions==
 +
An Expression can be used:
  
If you make any changes to an expression of a class, when you go to close that class, or to close the application, or to change the current model, the application will prompt whether you want to save all changes to expressions out to disk. Answer "Yes" to save your work to disk.
+
*In the Choreography timeline in the normal manner. Either create an Expression event with the context menu, or drag the thumbnail of the desired Expression from the Expressions dialogue to the timeline.
 +
*In the Flex Animation dialogue, by dragging the Expression thumbnail to the desired point.
  
You can re-order the thumbnails by dragging them around in the view. Just click, drag to a new spot, and release the mouse to do this. The ordering won't be saved unless you save the class of expressions out to disk. You can also drag an expression directly onto an actor's choreography channel to create an expression event.
+
==Creating Markov Groups==
 +
[[Image:Faceposer markov example.jpg|right]]
  
Using the A/B control. If you've selected one thumbnail then clicked on another, you can cycle between these last two selected thumbnails by pressing the A/B button in the upper right of the expression tray view.
+
A '''Markov Group''' is a collection of Expressions that are randomly chosen between when a scene plays. They are ideal for adding variety to your performances without requiring multiple scene files. The 'weight' of each Expression in the Group defines how likely it is to be picked.
  
You can reset / zero all of the sliders by clicking the "Zero Sliders" button in the flex controller slider area.
+
To create a Markov group, shift+left-click one or more normal expressions in the expression tray and then right-click anywhere and choose <code>Create Group...</code> from the menu.
  
You can load multiple expression files at the same time. The tab control allows you to change the current expression set.
+
A Markov Group appears as an Expression thumbnail, with these additions:
  
You can close the current expression class or all classes by choosing "File | Close" or "File | Close all" from the main menu or from the right-click context menu.
+
*<code>Total Weight</code>: the combined weight values of the Expressions in the group
 +
*Expression being displayed in the Group thumbnail (ID and name)
 +
*#ID / total number of Expressions
 +
*#Expression name
 +
*#Expression weight in current Group
 +
*Percentage probability that the Expression being displayed will occur
  
==Creating a new expression class==
+
Use your mouse's scroll wheel to scroll through the Expressions in a Group thumbnail.
  
You'll probably want to leave the phonemes alone (since they have been carefully defined globally for all models) and just create a new class of expressions for your actors to use when playing back a .VCD. To do so, choose "Expression | New…" from the right-click menu or main menu. Here, you'll want to create a .txt file in the "models" folder. The raw filename you provide here becomes the name of the class of expressions.
+
==Modifying Markov Groups==
 +
*To add or remove Expressions from an existing Group, left-click on the Group thumbnail. This will highlight the Group members with a purple border. Then, use the context menu and click the <code>Remove <Expression> from <Group></code> or <code>Add <Expression> to <Group></code> options.
 +
*To change the weight of an Expression within a Group, use the <code>Change weight of <Expression> in group <Group></code> context menu option. It is accessible from two locations:
 +
**By cycling to the Expression in the Group thumbnail with the mouse wheel
 +
**By right-clicking on the Expression's purple-highlighted thumbnail when the Group is selected
  
Creating a new expressions file will select that new class as the current class and the thumbnail views will be empty.
+
==Overrides==
 +
In most cases, one Expression will function with all actors. However, you can specify per-actor overrides to tweak the look of a certain Expression for a certain model.
  
To create a new expression, move the sliders around to a desirable position and right-click in the expression thumbnail area and choose "New Expression…" from the context menu. This will bring up a dialog box where you can enter the name and description for the new expression. Enter a new name and description and press "OK" to create the new expression. You can now select the new expression by clicking on it in the tray. Note that clicking the "New" button deselects any current expression so that manipulating the sliders isn't treated as making changes to the previously selected expression. Once you hit the "OK" button, any sliders you change after that point will be stored in the Undo/Redo buffers of the selected thumbnail/expression.
+
To create an Override, select an expression and manipulate the Flex Sliders as you see fit. Then right-click on the Expression and choose <code>Save <Expression> as an override for model <Model></code>.
  
If you want to change the name or description of an expression in the tray, just right-click on it and choose "Edit…"
+
Now, if "Show overrides" is checked, the thumbnail will show <code>++override</code> in the top left to signify that you are viewing a per-model override for the expression.
  
You can now use the mouse wheel to scroll the thumbnail list of expressions.
+
You can delete an Override using the right-click menu.
  
You can also draw an expression onto an actor's channel in the Choreography tool to create a new "Expression" event with the expression. You'll see the focus rectangle as you drag the expression off the Expressions tool. Furthermore, you can drag an expression from the Expressions tool onto a particular time spot in the Flex Animation tool to set the slider keys from the predefined expression at the time where the cursor is positioned when you let go of the mouse button.
+
Toggle the "Show overrides" checkbox to show/hide the Overrides and to globally enable/disable them during preview playback.
 
 
==Support for Markov Groups of Expressions==
 
 
 
A Markov group is simply a weighted graph where the next place to go to in the graph is randomly selected from a list of options. The way this works in the FacePoser is that you can select multiple expressions that you consider of a similar enough "type" to group together and use them to create a Markov group. During playback, when the model is told to play the expression that is a Markov group, one of the underlying expressions is chosen at random.
 
 
 
To create a Markov group, shift left-click one or more normal expressions in the expression tray and then right-click anywhere and choose "Create Group…" from the menu. Give the Markov group and name and description
 
 
 
 
 
<center>[[image:Faceposer markov example.jpg]]</center>
 
 
 
 
 
The Markov groups look like the other expressions in the thumbnail view, except that they show some additional text information:
 
 
 
First, they show the total weight of all of the items in the group. By default, each expression in a Markov group has a weight of 100. Thus, if there are two items in the group, the total weight is 200. When playing back from this group, it's easy to see that there is a 50/50 chance of either expression being chosen. The chance for the currently displayed group member is shown in the thumbnail view next to the label "Prob" (which stands for probability).
 
 
 
Just above the probability display is text showing which item of the group and how many total members in the group exist. Additionally, the item name and current weight are shown. To see other members of the group, click on it once with the left mouse button to make it active. This will highlight the group in red and will also highlight any other group members with a blue/purple highlight. You can also use the mouse wheel to cycle through the members of the Markov group that is currently selected.
 
 
 
There are two ways to change the weighting of a group member. First, you can use the mouse wheel on the group thumbnail to cycle to the desired member and use the right mouse button to bring up a menu and choose the "Change weight of 'member' in group 'group name'" option. The other way to change the weight is to select the group as above and to right-click on the blue-highlighted member whose weight you'd like to change.
 
 
 
If you right-click (but don't left-click or you'll deselect the currently selected Markov group) on a thumbnail that's not part of the currently selected group, you can choose "Add '[expression name]' to group 'group name'" from the menu to add the item to the currently selected group.
 
 
 
Similarly, if you right-click on a blue highlighted group member, you can select "Remove '(name 'from group)' group name to delete the item from the Markov group.
 
 
 
In all other respects, a Markov group is just like a regular expression except that, during playback, when the group is encountered, a random one of the weighted options from the list is chosen. This allows for variability during playback of the scene.
 
 
 
In general, expressions are global to all available models (i.e., an expression will work across all of our models). However, you can specify per-model overrides to tweak the look of a certain expression for a certain model.
 
 
 
To create an override, select an expression and manipulate the flex sliders into a facial pose that you want to use for the override. Then right-click on the expression, and choose "Save <name> as an override for model 'current model'" where <name> is the name of the expression you were working with and current model depends on which model is active in the 3d View.
 
 
 
Now, if "Show overrides" is checked, the thumbnail will show "++override" in the top left to signify that you are viewing a per-model override for the expression. You can delete the override using the right-click menu. Toggle the "Show overrides" checkbox to show/hide the overrides and to globally enable/disable them during preview playback, etc.
 
  
 
[[category:Choreography]]
 
[[category:Choreography]]
 
[[category:Tools]]
 
[[category:Tools]]

Revision as of 20:41, 10 July 2006

The Expressions dialogue

An Expression is a static, reusable flex configuration which is stored independently from any scene file that uses it. An Expression cannot be modified on a per-scene basis, except in the ramp, but will blend as normal. They are useful when many different scenes need the same expression or groups of expression (see Creating Markov Groups); the phoneme library uses the system. They are also useful for quickly assembling 'rough draft' scenes.

Note:An Expression does not crossfade of its own accord. The ramp must be used to ease transitions.

Creating a new Expression

The following dialogues are used to create an Expression:

  • Expressions
  • Flex Sliders
  • 3D View

Make sure all are open on your workspace before starting.

  1. Create a new Expression Class with the Expressions > New... menu option. An Expression Class is like a folder (although it in fact takes the form of a .txt file), and you will want one of your own to ensure that your Expressions do not become inseparably mixed with Valve's preset phonemes. If you like, close the Phoneme classes.
  2. Expressions are created by saving flex data from the Flex Sliders dialogue. Create your Expression there, using the 3D View for reference, and move on when you are satisfied.
  3. To save your Expression, right-click on a blank area in the Expressions dialogue with the correct tab highlighted and click New Expression.... Fill in both fields on the new dialogue and click OK.
  4. Important: Click the Expressions > Save menu option to write your work to disk.
Note:A bug in the current build of FacePoser means that Expression thumbnails will not be generated correctly.

Warning: Selecting an existing Expression will overwrite anything currently on the Flex Sliders!

Editing an existing Expression

The Flex Sliders dialogue

Editing an existing expression is achieved by having it selected when modifying the Flex Sliders. This process adds several elements to the Expression thumbnail:

  • An asterisk (*) will appear to signify that the Expression has unsaved changes
  • A clickable undo history will appear
  • A Revert option will appear in the Expression's context menu

Right-click on the Expression and choose the Save option to commit your changes.

Note:Expressions can be re-ordered by dragging. As ever, hit Expressions > Save to commit any changes.

Using Expressions

An Expression can be used:

  • In the Choreography timeline in the normal manner. Either create an Expression event with the context menu, or drag the thumbnail of the desired Expression from the Expressions dialogue to the timeline.
  • In the Flex Animation dialogue, by dragging the Expression thumbnail to the desired point.

Creating Markov Groups

Faceposer markov example.jpg

A Markov Group is a collection of Expressions that are randomly chosen between when a scene plays. They are ideal for adding variety to your performances without requiring multiple scene files. The 'weight' of each Expression in the Group defines how likely it is to be picked.

To create a Markov group, shift+left-click one or more normal expressions in the expression tray and then right-click anywhere and choose Create Group... from the menu.

A Markov Group appears as an Expression thumbnail, with these additions:

  • Total Weight: the combined weight values of the Expressions in the group
  • Expression being displayed in the Group thumbnail (ID and name)
    1. ID / total number of Expressions
    2. Expression name
    3. Expression weight in current Group
  • Percentage probability that the Expression being displayed will occur

Use your mouse's scroll wheel to scroll through the Expressions in a Group thumbnail.

Modifying Markov Groups

  • To add or remove Expressions from an existing Group, left-click on the Group thumbnail. This will highlight the Group members with a purple border. Then, use the context menu and click the Remove <Expression> from <Group> or Add <Expression> to <Group> options.
  • To change the weight of an Expression within a Group, use the Change weight of <Expression> in group <Group> context menu option. It is accessible from two locations:
    • By cycling to the Expression in the Group thumbnail with the mouse wheel
    • By right-clicking on the Expression's purple-highlighted thumbnail when the Group is selected

Overrides

In most cases, one Expression will function with all actors. However, you can specify per-actor overrides to tweak the look of a certain Expression for a certain model.

To create an Override, select an expression and manipulate the Flex Sliders as you see fit. Then right-click on the Expression and choose Save <Expression> as an override for model <Model>.

Now, if "Show overrides" is checked, the thumbnail will show ++override in the top left to signify that you are viewing a per-model override for the expression.

You can delete an Override using the right-click menu.

Toggle the "Show overrides" checkbox to show/hide the Overrides and to globally enable/disable them during preview playback.