Version 3.0 of the Web Driver adds the ability to read motion notes that have been embedded in an Actor file using 3dsmax. These notes can be enumerated after
the Actor is loaded, or you can check for them while the motion is playing. Motion notes detected during a character's playing motion can be used to control the timing of other
procedures, such as creating projectiles at the correct moment during a character's "fire gun" animation. In the lab above, you can load the sample Actor file
(gumby.wsad), view the Actor's motions and the motion notes embedded in the file, and play the motions to see the motion notes being read in real time. In the Web
Driver window, the motion note name will flash red at the moment that it is retrieved, and will display in white afterwards. Additionally, you can set a sound to
be played when the motion note is read. If you have a different Actor file for which you wish to view motion notes, you can enter the path to the Actor file in the
Actor File textbox and load it within this lab.
Left drag within the scene to rotate the Actor, and right drag to zoom in and out.
You must have version 2.3 or later of the WildTangent 3dsmax exporter to create motion notes.
Motion notes are created by adding a note track in 3dsmax's Track View editor, and then adding keys to that track. The note track can be added to
either the Actor's geometry or any constituent bones. There is currently no way to add motion notes to Actors using other tools (such as Maya or Deep Exploration),
but watch Developer Central for updates.
When an actor is exported, the motion notes will be contained in a file with a .wsdf extension.
Motion notes are retrieved using getNextMotionNote(). When motion notes are expected, this function should be checked at least once every render; if
a motion note comes due (that is, the motion note's time is between the time of the previous render and the current one) and is not retrieved, it is discarded, and will not be available
in subsequent renders. If it's possible that multiple motion notes will come due in a given render, they can all be retrieved by calling getNextMotionNote() repeatedly until an empty string is returned.
To enumerate all of the motion notes for a motion, use getMotionNoteCount() to determine the number of motion notes, and then use getMotionNote()
to retrieve the text of the notes themselves.
Since motion notes can only be retrieved during the render event, the accuracy of reading the motion note time is limited by the current framerate. As
a result, your motion notes may be retrieved slightly after they occur. A side effect of this is that if a motion note is placed at the end of
a non-looping motion, that note will never be read, since the motion will end before that note is generated (If the motion is looping, the motion note
will be retrievable).
This lab uses playMotion() for actor motions for simplicity, but motion notes are also generated for motions that are played using blendMotion().
Note that motion notes will come due for all playing motions, except for motions that have been blended down to zero weight.