Description
Characters can perform gestures, often with their hands and arms. In their simplest form, a gesture is an animation that is compatible with the underlying idle posture. A gesture could also use a set of animations in order to blend data, or use an algorithm to procedurally generate motion (such as a pointing gesture at a target). The type of gestures used is determined by the underlying data set, and their are generally no restrictions as to the type and style.
Requirements
To use the <gesture> tag, each character requires a gesture map. Please see the section on Configuring Gestures For Characters.
Usage
Gesture lookup
With gesture map configured properly, you can retrieve the gesture according to your input. Lexeme, type, hand, style, posture are the four input that will determine the gesture you query. If the information given is not entire, you will get one animation from all the gesture animations that meet the criteria, note that your character's current posture has to match the posture from the gesture map unless you have set the gesture BML command to use sbm:additive attribute. Depending on gesture policy, you can either randomly get one or get first one from the animation list. To change gesture policy, set the attribute "gesturePolicy" to "random"|"first".
Gesture timing control
Start, ready, stroke, relax, end time markers are the same usage as <animation> BML. The extra feature for Gesture is holding capability. This will be achieved by stroke_end. e.g. <gesture lexeme="DEICTIC" stroke="3" relax="4"/>. If the gesture motion stroke relax time gap is 0.4sec, then by playing the above bml, you will hold gesture for 0.6sec. But if the motion time gap is 2sec, then this bml won't have any effect.
You can start gesture immediately on stroke by cutting off the motion before stroke. e.g. <gesture lexeme="DEICTIC" start="1" ready="1" stroke_start="1" stroke="2"/>. This will blend into stroke directly, transition time will be determined by stroke_start, the blend duration is (stroke - stroke_start). This feature can be used to transition from one gesture stroke to another gesture stroke. e.g.
<gesture id="a" lexeme="DEICTIC" type="LEFT" stroke="2" relax="4"> <gesture id="b" lexeme="DEICTIC" type="MID" start="a:relax" ready="a:relax" stroke_start="a:relax" stroke="6" relax="8"/> <gesture id="c" lexeme="DEICTIC" type="RIGHT" start="b:relax" ready="b:relax" stroke_start="b:relax" stroke="10"/>
This gesture will first play gesture a, hold for x amount of time at stroke, transition 2sec to gesture b's stroke, hold for sometime and transition 2sec to gesture c's stroke and relax. By setting the attribute "bmlRequest.autoGestureTransition" to True. You just only need to specify stroke and stroke_end, the motion cutting part will be handled automatically. Previous BML looks like:
<gesture id="a" lexeme="DEICTIC" type="LEFT" stroke="2" relax="4"> <gesture id="b" lexeme="DEICTIC" type="MID" stroke="a:relax" relax="6"/> <gesture id="c" lexeme="DEICTIC" type="RIGHT" stroke="b:relax" relax="8"/>
To make gesture holding looking more natural and less stiff, Perlin noise can be added by specifying sbm:joint-range, sbm:frequency and sbm:scale. e.g.:
<gesture id="a" lexeme="DEICTIC" type="LEFT" stroke="2" relax="4" sbm:joint-range="l_shoulder" sbm:frequency="0.03" sbm:scale="0.02"/>
Parameters
Parameter | Description | Example |
---|---|---|
lexeme | type of gesture (required). This can be anything: DEICTIC, BEAT, YOU, ME, NEGATION, etc. | <gesture lexeme="YOU"/> |
mode | Handedness of the gesture. LEFT_HAND, RIGHT_HAND or BOTH_HANDS | <gesture lexeme="YOU" mode="LEFT_HAND"/> |
type | type of lexeme | <gesture lexeme="YOU" type="LEFT"/> |
name | name of the motion to use as a gesture. This is used as a substitute for using the gesture map. | <gesture name="BeatLeftHand" /> |
sbm:style | style of the lexeme | <gesture lexeme="YOU" type="LEFT" sbm:style="energetic"/> |
target | target for POINT and REACH gestures | <gesture lexeme="YOU" target="brad"/> |
start | start point of the gesture | <gesture lexeme="YOU" start="2"/> |
ready | ready point of the gesture | <gesture lexeme="YOU" start="2" ready="3"/> |
stroke_start | stroke start point of the gesture | <gesture lexeme="YOU" stroke_start="3" stroke="4"/> |
stroke | stroke point of the gesture | <gesture lexeme="YOU" stroke="5"/> |
stroke_end | stroke end point of the gesture | <gesture lexeme="YOU" stroke="3" stroke_end="4"/> |
relax | relax point of the gesture | <gesture lexeme="YOU" relax="3" end="4"/> |
end | end point of the gesture | <gesture lexeme="YOU" relax="3" end="4"/> |
sbm:joint-range | joints that will be added with perlin noise during gesture holding | <gesture lexeme="YOU" stroke="3" relax="4" sbm:joint-range="l_elbow l_shoulder l_wrist"/> |
sbm:frequency | Perlin noise frequency | <gesture lexeme="YOU" stroke="3" relax="4" sbm:joint-range="l_elbow l_shoulder l_wrist" sbm:frequency="0.05"/> |
sbm:scale | Perlin noise scale | <gesture lexeme="YOU" stroke="3" relax="4" sbm:joint-range="l_elbow l_shoulder l_wrist" sbm:scale="0.03"/> |
emotion | Emotion state. Can be: angry, neutral or sad. | <gesture lexeme="YOU" start="2" emotion="angry"/> |
sbm:additive | Whether if gesture is additive to current posture | <gesture lexeme="YOU" start="2" sbm:additive="true"/> |