Description
Characters can playback motions generated from animation files in various formats such as .bvh, .amc, .fbx and .skm. The motion controller operates after the posture/idling controller in the controller hierarchy. Thus, any joints specified in the motion file will override the data established by the posture controller. A motion that uses all of the joints of the character will override completely the underlying posture, while a motion that only uses a few joints will only override the motion on those joints, leaving the rest of the joints to use the motion specified on the underlying posture.
Requirements
To run the <animation> behavior, SmartBody needs motion files whose joint names match those on the character's skeleton.The character and the motion can be any topology and any number of joints. Data from a motion file that matches the joint names of a skeleton will be used, and any joint names that do not match will be ignored.
Motion files need are required to have metadata that indicates their blend-in, blend-out times.
Usage
<animation name="motion1"/>
where motion1is the name of the motion to be played. Note that the animation will be played at a location and orientation in the world based on the character's offset.
Parameters
Parameter | Description | Example |
---|---|---|
start | starts the motion at a time in the future | <animation name="motion1" start="3"/> |
ready | the time when the motion is fully blended. The total ramp-in time is (ready-start) | <animation name="motion1" start="3" ready="5"/> |
stroke | for a gesture, the time of the emphasis point of a gesture | <animation name="motion1" stroke="4"/> |
relax | time when the animation starts to fade out | <animation name="motion1" relax="5"/> |
end | indicates when the animation ends | <animation name="motion1" end="8"/> |
time | multiplier for the speed of the animation (2x plays the animation twice as fast). Note that specifying a time multiplier will automatically adjust the synchronization points. | <animation name="motion1" time="2"/> |
Timewarping Motions
Animation behaviors can be timewarped (stretched or compressed) by specifying more than one synchronization point. SmartBody handles timewarping of animations as follows:
- If only one synchronization point is specified, align the behavior such that the behavior will occur at normal speed in line with the synchronization point. Example, let's assume that motion1 lasts for 3 seconds, with it's stroke point at second 2:
<animation name="motion1" stroke="5"/>
will play motion1 such that the middle (or stroke) of the motion occurs at second 5, with the rest of the motion aligned to that time. In other words, the beginning of the motion will play at second 4, and finish at second 6.
- If two synchronization points are specified, then timewarp the rest of the motion according to the relative scale of two synchronization points. For example:
<animation name="motion1" start="1" stroke="5"/>
will play motion1 by timewarping it (in this case, slowing it down) by 2x, since the original motion took two seconds to go from the start point to the stroke point, and the user is specifying that that phase should now take 4 seconds, yielding a slowdown of 2x. Thus, the remainder of the motion which has not been explicitly specified by the user, will also play at 1/2 speed. Thus the entire motion will now take 6 seconds to play, and finish at second 7. If three or more synchronization points are specifed, then the behavior will be unevenly timewarped such that each phase of the behavior will be stretched or compressed according to the closest explicitly specified behavior segment. For example, let's assume that the synchronization points for motion1 are: start = 0, ready = 1, stroke = 2, relax = 3, end = 4. Then by specifying:<animation name="motion1" start="1" ready="1.5" stroke="4"/> Then the start-ready phase will be double in speed (since the user explicitly requested it), the ready-stroke phase will now be slowed down by 3x times (originally took 1 second, but the user requested that it now take 3 seconds), and the stroke-relax and relax-end phases will also be slowed down by 3x, since their closest explicit request was a 3x slowdown.