Animation Note Tracks

From HEWIKI
Jump to: navigation, search

Contents

Overview

Animation Data can contain optional note track which identifies key frames where specific events need to occur. For example, to play a sound when a creature begins to roar, or to mark foot falls in a run animation. These events are then communicated as HSL script callbacks. Additionally, Character Behave Commands can be issued directly from note tracks.


What problems does this solve?


What problems does this not solve?


Concepts

Authoring Note Tracks

Originally, note tracks where authored directly in 3Ds Max. However, Maya does not have a corresponding equivalent concept. Consequently, we implemented the ability to author animation notes as part of sequence definitions using the Animation Panel and it is no longer recommended that you embed notes in the max animation file (though it will still work).


Using 3Ds Max

Please note, it is recommended you utilize the animation panel to add animation notes rather than embedding them in your files.


Note tracks are authored in 3Ds Max. Notes are automatically included on Export.



HSL Callbacks

method HE_OnAnimationNote(char as NodeRef of Class HBNode, sequence as String, note as String, time as Float) as Boolean
// Used by SYSTEM.NODE.BASECHARCONTROL
//
// Called from the animation agent for start, end and note events in animation sequences
//
// return true skips any "optional" processing by required/core scripts as default
//   mechanics.  Any functionally required mechanics occur no matter what the setting of this field.
// 
  return false
.

Any text in the note track is included in the callback as the note parameter. For normal notes, this will be prepended with "*NOTE ". Therefore, if the note contained the text "Hello World" then you'd receive: "*NOTE Hello World".


Automatic Note Callbacks

Whenever an Animation Sequence begins playing on a channel, it will issue an animation call back with the note text of "*BEGIN".

Likewise, when an Animation Sequence stops playing on a channel, an animation call back will occur with the note text of "*END".

These only occur for the 'root' animation sequence. In other words, only for the sequence that was issued by the Animation Agent Script in the anim command.


Culling

Animation Notes can be distance culled. If a character is farther away than this cutoff distance, then animation call backs do not occur. This can be an important optimization. The distance is per character, and you set it with the behave command. For example:

behave 0 animcallbacks 10

This would cause your currently controlled character to not do any animation note callbacks if the character is farther than 100 meters from the camera.

You can also turn animation call backs on and off thusly:

behave 0 animcallbacks true behave 0 animcallbacks false

Remember, even though these examples show a behave command issued from the console, behave commands can be issued from client-side HSL scripts as well.


Issuing Character Behaves Commands Directly

Character Behave Commands allow you to send commands directly to the Advanced Customizable Character Controller that is in control of the character playing the animation. There are many commands built in, and because the ACCC is customizable (see: _onBehave), you can (or may have already) added many more.

To do this, the note track has to merely issue the appropriate command prevised with a dollar sign ($) character. For example, let's say we want to play a specific growl sound at a certain point in an animation. To do this we could use the following audio behave command as a note at the keyframe in the animation where we want it to start:

$audio "Bip01 Head" "/content/audio/growl.wav"

The $ character tells the animation system to issue the text following it as a behave command to the ACCC. As such, this does not issue an animation note callback.

It is worth mentioning that the behave macro system is especially useful here. For example, you might have a sword swing animation with an embeded behave command to play a sword 'swish' sound. And that would work great, right up until the character changes weapons to use a lightsaber. Suddenly the sound is wrong for that type of weapon even though you are using the same animation. In such a case you might use a macro instead:

$audio "Bip01 Head" $SWORD_SOUND

Then, some other HSL system that is responsible for equiping weapons would set the SWORD_SOUND macro on the character to the proper sound file.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox