It is possible to influence clip selection for bipeds during a Crowd solution by using preferred clips. The following biped MAXScript functions allow users to set the biped preferred clip during a crowd solution.
biped.numPrefClips <biped_ctrl>
Returns the number of preferred clips
biped.getPrefClip <biped_ctrl> <index_integer>
Returns the name of the nth preferred clip.
biped.clearPrefClips <biped_ctrl>
Clears the preferred clip list.
biped.addPrefClip <biped_ctrl> <name_string>
Adds the clip to the preferred clip list. returns true if added, false if not added because it was already in the list.
biped.deletePrefClip <biped_ctrl> <name_string>
Deletes the named clip from the preferred clip list. Returns true is successful, false if the clip was not in the list.
biped.isPrefClip <biped_ctrl> <name_string>
Returns true if the clip is in the list, false if not.
biped.getCurrentClip <biped_ctrl>
Returns the name of the currently active clip for this biped - only relevant during a crowd solve.
The following are examples showing how the crowd system "PerFrameFn" can be used to dynamically change the biped preferred clip.
Example:
-- changes the preferred clip as a function of frame number.
fn PerFrameFn crwd t = (
if (t == 200f) then
(
a = $bip100
a = a.transform.controller
biped.addprefclip a "jog_L45"
)
)
Example:
-- changes the preferred clip as a function of the current clip.
fn PerFrameFn crwd t = (
a = $bip100
a = a.transform.controller
if (biped.getcurrentclip a == "jog_L135") then
biped.addprefclip a "jog_L45"
)
See also