Track View Pick Dialog

The Track View Pick dialog displays the hierarchy for the 3ds Max scene in a manner similar to what is seen in Track View. The user can select one or more items from this dialog. The following method displays the Track View Pick dialog:

trackView.pickTrackDlg [#multiple][<filter function>] [options:<integer>]

This method brings up the Track View Pick dialog and returns a TrackViewPick value when the user selects a track and clicks "Ok", or undefined if the user clicks "Cancel".

If the optional argument #multiple is passed, multiple tracks can be picked in the dialog and an array of TrackViewPick values is returned instead of single value.

If the optional filter_function is supplied, each track is passed to the function as a TrackViewPick value. If the function returns true, the track is selectable in the Track View Pick dialog.

If the optional keyword argument options : is specified, the bits of the integer value define what is shown in the Track View Pick dialog.

The bits are:

1: turn on display of animated tracks only
2: turn off display of node Visibility track
3: turn on display of only selected nodes
4: turn off display of World Space Modifiers
5: turn off display of Object Space Modifiers
6: turn off display of node Transform track
7: turn off display of node base object
8: turn off display of controller types
9: turn off display of note tracks
10: turn off display of the sound track
11: turn off display of maps in materials
12: turn off display of material parameters
13: turn on display of hidden nodes
14: turn off display of hierarchy
15: turn off display of non-keyable tracks
16: turn off display of nodes
17: turn off display of geometry nodes
18: turn off display of shape nodes
19: turn off display of light nodes
20: turn off display of camera nodes
21: turn off display of helper nodes
22: turn off display of warp nodes
23: turn off display of position controllers
24: turn off display of rotation controllers
25: turn off display of scale controllers
26: turn off display of bone nodes
27: set focus to first selected node found 

EXAMPLE:

theInt = 0 
theInt = bit.set theInt 1 true --animated tracks only
theInt = bit.set theInt 3 true --display selected nodes only
theInt = bit.set theInt 10 true --hide sound track
theTrack = trackView.pickTrackDlg options:theInt --open dialog 

You can also use the following function to turn a bitarray into an integer with bits sets according to the flags described above. The resulting integer can be passed to the named options : parameter:

fn bitArrayToInt theBitArray = (
local theInt = 0
for i in theBitArray do theInt = bit.set theInt i true
theInt
)
theInt =bitArrayToInt #{1,3,10}
theTrack = trackView.pickTrackDlg options:theInt

TrackViewPick : Value

Instances of the TrackViewPick class store the result of a selection from the Track View Pick dialog. A TrackViewPick value has the following properties:

<trackViewPick>.name : string

The name of the picked item as shown in the Track View Pick dialog.

   

<trackViewPick>.anim : subAnim

The subAnim for the item the user picked.

   

<trackViewPick>.client : MAXWrapper

The owner of the subAnim for the item the user picked. If the owner is a subclass of MAXWrapper, the MAXWrapper value for the owner is returned, otherwise a value of undefined is returned.

   

<trackViewPick>.subNum: integer

The subAnim index for anim in client .

   

FOR EXAMPLE:

 -- Create a sphere,apply a bend modifier and execute:
tvp=trackview.pickTrackDlg()
-- pick objects->Sphere01->Modified object->Bend->Angle
tvp.anim -- returns SubAnim:Angle
tvp.client -- returns Bend:Bend
tvp.subNum -- returns 3
tvp.name -- returns "Angle"
tvp.client[tvp.subNum] -- returns SubAnim:Angle