MAXScript Extensions > MAXScript Extensions for character studio > Mixer MAXScript Extensions >

# MxTrack Class

| Character Studio - Quick Navigation

Properties

    .tracktype: name (#layertrack|#transtrack)

Get/set the type of the track - layer or transition.

    .mute: boolean

Get/set the muted state of the track.If set to true, the track will be muted.

If you turn soloon,mute will be turned off, and vice-versa.

    .solo: boolean

Get/set the solo state of the track. If set to true, all other track will be muted.

If you turn mute on, solo will be turned off, and vice-versa.

    .transPreserveHgt: boolean

Although this appears in the transition edit dialog, it is actually set for the entire track.

    .numClips: integer .numTransClips: integer

For a layer track, this property will always contain 0.

For a transition track, this property will contain the number of clips which are actually part of the transitioning clips in the track. A greyed out clip will not be counted. This value should be used to loop through the transition clips, in order, using the GetClip()function.

    .numWeights: integer, not settable

The number of weights in the track’s weight curve (relevant for transition tracks only)

Methods

    getclip <track:mxtrack> <index:integer>

This method will return the clip in the track specified by the index.

Indices start with 1.

In the case of a transition track, this will be an index into the set of clips, in order, which are actually part of the transitioning clips in the track.

A greyed out clip will not be counted.

Use the . numTransClips property to find out how many transitioning clips there are in the track.

    cleartrack <track:mxtrack>

This method deletes all the clips in the track. It returns true .

    appendClip <track:mxtrack > <fname:string> <ZeroFootHgt:boolean> <interval:timevalue>

The specified bip file will be loaded into the new clip, and the reservoir, using the ZeroFootHeight parameter.

For layer tracks, the start of the new clip will be appended interval time from the end of the last clip in the track.

The interval variable must be >= 0.

For transition tracks, the interval parameter is ignored. The start of the new clip will be at the inpoint of the last clip in the track, and it will be on the opposite row of the last clip. It will start later if it collides with another clip.

For both layer and transition tracks, if there are no clips in the track, the new clip will start at frame 0.

Returns false if the specified file could not be loaded. Other wise, it returns true .

    appendMaxClip <track:MXtrack> <fname:string> <interval:timevalue> <mapName:string>

Loads the specified max animation file as a clip onto the track. Only works for 3ds Maxanimation tracks, see appendTrack() above for a Biped-only method.

The fname argument defines the filename of the .xaf file to be loaded.

The interval argument defines the number of frames from the end of the last clip in the track that the new clip will be appended at in layer tracks. The interval must be greater or equal to 0.

For transistion tracks, the interval parameter is ingnored and the start of the new clip will be at the inpoint of the last clip in the track, and it will be on the opposite row of the last clip. The parameter is also ignored if there are no clips in the track - in that case, the clip will automatically start at frame 0.

The mapName argument defines the filename of the .xmm map file to be loaded.

The method returns true if the clip is created properly.

The method returns false if the files cannot be loaded or the mapping is not correct.

    optimizeTransitions <track:mxtrack> <PreferredTransLength:integer> <SearchEntireClip:boolean> <SearchRangeBefore:integer> <SearchRangeAfter:integer>

This method optimizes transitions.

If this methodis called foralayer track, it will return false and do nothing.

PreferredTransLength and the search ranges must be positive values. They are specified as frames. If they are negative values, the optimization will not be performed and the function will return false .

Otherwise, the function will return true on success and false on failure.

If optimization requires clips to be trimmed to avoid visual overlap, then they will be trimmed.

    optimizeClipTransition <track:mxtrack > <PreferredTransLength:integer> <SearchEntireClip:boolean> <SearchRangeBefore:integer> <SearchRangeAfter:integer> <ClipIndex:integer>

See notes above about legal parameter values. This function optimizes only a single clip's transition.

The ClipIndex is an index into the track's trans clips and specifies which clip’s transition, from itself to the next clip, will be optimized.

If the ClipIndex is out of range of the trans clips, the optimization will not be performed and the function will return false .

    getWeight <index::integer >

This method returns the weight at the specified index in the track’s weight curve. If the Index is out of bounds, the function will return 0.0.

    getWeightTime <index::integer >

This method returns the time at the specified index in the track’s weight curve. If the Index is out of bounds, the function will return 0.

    deleteWeight <index::integer >

This method deletes the weight at the specified index in the track’s weight curve. If the Index is out of bounds, the function will return false . Otherwise, it returns true .

    setWeight <index::integer > <float::weight>

This method sets the weight at the specified index in the track’s weight curve. If the Index is out of bounds or weight is not between 0.0 and 1.0, the function will return false . Otherwise, it returns true .

    setWeightTime <index::integer > <time::timevalue>

This method sets the time at the specified index in the track’s weight curve. If the Index is out of bounds or time is not between the time values of the previous and next values in the weight curve, the function will return false . Otherwise, it returns true .

    setWeightAtTime <time::timevalue> <float::weight>

If there is a key at time time on the weight curve, this will reset the weight at that key. If not, this method will create a new key at time time with weight weight.

    getWeightAtTime <time::timevalue>

If t is at a key at time time in the weight curve, This method returns the weight at that key. Otherwise, it returns the interpolated weight at time time. If there are no weights,itreturns 1.0.

#### See Also

- Mixer MAXScript Extensions

- MAXScript Extensions in character studio