Interface: trackviews

The trackviews Core Interface gives access to the Trackview.
It also provides control over the enhanced features of the new Function Curve / Dope Sheet editors introduced in
3ds Max 5.

Properties

.currentTrackView : Interface : Read

Returns a TrackView MixinInterface to the current track view, or undefined when no current track view exists.

.current : Interface : Read

Returns a TrackView MixinInterface to the current track view, or undefined when no current track view exists. Alias for .currentTrackView

See separate description of the TrackView interface later on this page

 

Example:

trackviews.currentTrackView

<MixinInterface:TrackView>

 

.lastUsedTrackViewName : string : Read

Returns the name of the last used track view as string

Methods

<Interface>getTrackView <fpvalue>name or index

This method will get a MaxinInterface to the trackview based on it’s index or name.

<Interface by value array>getAllOpenTrackViews()

Returns an array of trackviews.

<integer>numTrackViews()

Returns the number of trackviews.

<boolean>open <fpvalue>name or index [layoutName:<string>] [pos:<point2>] [width:<integer>] [height:<integer>] [dock:<enum>]

layoutName default value: ""

pos default value: [-1,-1]

width default value: -1

height default value: -1

dock enums: {#float|#top|#bottom|#canDockOnTop}

dock default value: #float

Open a trackview based on it's index or name.

If you supply a height and width argument, it only has effect the first time the track view is opened. After that the user defined size takes effect. This makes it possible to specify a size when scripting the opening of track view, but still allows users to change the size and have the new size remembered.

For Example:

trackviews.open "name" layoutName:"layout name" pos:[6,100] width:800 height:400

<boolean>close <fpvalue>name or index

Close a trackview based on it's index or name.

<void>delete <fpvalue>name or index

Delete a trackview based on it's index or name.

<string>getTrackViewName <index>index

Returns the name of the trackview window based on the index.

<boolean>zoomSelected <string>name

Zooms to the selected object's track

<boolean>zoomOn <string>name <maxObject>object <index>subNum

Returns True if successful and false otherwise.

<boolean>setFilter <string>TrackviewName <name>filterName

Set the specified filter for the specified Trackview by name. Returns true if successful and false otherwise.

Possible filter names are:

#all -- set or clear all flags

#default -- set default view flags

#selectedObjects

#selectedTracks

#animatedTracks

#spacewarpBindings

#modifiedObjects

#transforms

#baseObjects

#positionX

#positionY

#positionZ

#positionW

#rotationX

#rotationY

#rotationZ

#scaleX

#scaleY

#scaleZ

#red

#green

#blue

#alpha

#controllerTypes

#noteTracks

#sound

#materialsMaps

#materialParameters

#visibilityTracks

#hideGeometry

#hideShapes

#hideLights

#hideCameras

#hideHelpers

#hideSpacewarps

#visibleObjects

#position

#rotation

#scale

#curveX

#curveY

#curveZ

#curveW

#staticValues

#hierarchy

#objects

#boneobjects

#keyableTracks

Example:

trackviews.current.setFilter #keyableTracks

When the #keyableTracks filter is turned on, only keyframe controllers will be displayed in track view. All other controllers will be skipped and not displayed. This filter is off by default.

 

<boolean>clearFilter <string>TrackviewName <name>filterName

Clears the specified filter from the named Trackview. Returns true if successful and false otherwise. filterName can be the one of the names listed as possible arguments of setFilter.

<fpvalue>pickTrackDlg()

pickTrackDlg has variable number of arguments. 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.

<boolean>exists <fpvalue>name or index

Returns a boolean value indicating if the specified trackview exists or not. Available in 3ds Max 8 and higher.

<boolean>isOpen <fpvalue>name or index

Returns a boolean value indicating if the specified trackview is open.

If the argument does not point at a valid trackview, a Runtime error will be thrown. To avoid this, you should first use the trackviews.exists() to make sure the requested Track View is valid.

Examples:

trackviews.isopen "something"
-- Runtime error: No trackview was found with by that name
trackviews.isopen 99999
-- Runtime error: No trackview was found with that index
trackviews.iscurrent 99999
-- Runtime error: No trackview was found with that index

trackviews.exists
"something"
false
trackviews.exists 1
false
trackviews.exists 0
false

trackviews.open
"something" -- create a Track View
true
trackviews.exists "something"
true
trackviews.exists 1
true

 

<boolean>openLastUsedTrackView()

Opens the current trackview if it has been closed.

<boolean>isCurrent <fpvalue>name or index

Returns a boolean value indicating if the trackview is the last one used or not.

<boolean>setCurrent <fpvalue>name or index

Sets the specified trackview to be the current one. Returns true if successful.

Mixin Interface: (trackviews.current)

Interface: TrackView

 

The TrackView MixinInterface provides access to the TrackView features. It is returned by the .current property of the trackviews Core Interface.

Properties:

.ui : Interface : Read

Returns a ui MixinInterface to the ui of the specified TrackView.

Example:

trackviews.currentTrackView.ui

<MixinInterface:ui>

 

.modifySubTree : boolean : Read|Write

Get/Set the Modify SubTree state. When true, changes affect the children.

.modifyChildren : boolean : Read|Write

Alias for .modifySubTree

Example:

trackviews.current.modifyChildren = true

.interactiveUpdate : boolean : Read|Write

Get/Set the Interactive Update state. When set to true, the viewports redraw interactively while keys are moved in the TrackView. If set to false, updates are suspended until mouse up.

Example:

trackviews.current.interactiveUpdate = true

.syncTime : boolean : Read|Write

Get/Set the Synchronize Time mode. When set to true, the current frame is synchronized to the value at the mouse location during click and drag for most types of mouse operations, like moving keys, adding keys, selecting time, scaling time, scaling keys, inserting time, and drawing curves. Adjusting tangent handles does not sync to the frame of the handle. This mode also aids with drawing curves by giving visual feedback of what is being drawn.

Example:

trackviews.current.syncTime = true

.freezeSelKeys : boolean : Read|Write

Get/Set freezing of selected keys.

.freezeNonSelCurves : boolean : Read|Write

Get/Set freezing of non-selected curves.

.showNonSelCurves : boolean : Read|Write

Get/Set visibility of non-selected curves.

.showTangents : enum : Read|Write

showTangents enums: { #none | #selected | #all }

Get/Set visibility of the specified tangent types.

Example:

trackviews.current.showTangents = #none --hide all

trackviews.current.showTangents = #selected --show selected only

trackviews.current.showTangents = #all --show all

.showFrozenKeys : boolean : Read|Write

Get/Set visibility of frozen keys.

.useSoftSelect : boolean : Read|Write

Get/Set keys soft selection usage.

.softSelectRange : time : Read|Write

Get/Set keys soft selection range.

.softSelectFalloff : float : Read|Write

Get/Set keys soft selection falloff.

.autoExpandSelectedOnly : boolean : Read|Write

Get/Set the auto-expand tracks of selected objects mode

.autoExpandChildren : boolean : Read|Write

Get/Set the auto-expand children mode

.autoExpandTransforms : boolean : Read|Write

Get/Set the auto-expand transformation tracks mode

.autoExpandObjects : boolean : Read|Write

Get/Set the auto-expand objects mode

.autoExpandModifiers : boolean : Read|Write

Get/Set the auto-expand modifiers mode

.autoExpandMaterials : boolean : Read|Write

Get/Set the auto-expand materials mode

.autoExpandXYZ : boolean : Read|Write

Get/Set the auto-expand X,Y,Z sub-tracks mode

.autoSelectAnimated : boolean : Read|Write

Get/Set the auto-select animated tracks mode

.autoSelectPosition : boolean : Read|Write

Get/Set the auto-select position tracks mode

.autoSelectRotation : boolean : Read|Write

Get/Set the auto-select rotation tracks mode

.autoSelectScale : boolean : Read|Write

Get/Set the auto-select scale tracks mode

.autoSelectXYZ : boolean : Read|Write

Get/Set the auto-select X,Y,T sub-tracks mode

.autoScrollToRoot : boolean : Read|Write

Get/Set the auto-scroll to root mode

.autoScrollToSelected : boolean : Read|Write

Get/Set the auto-scroll to selected mode

.manualNavigation : boolean : Read|Write

Get/Set the manual navigation mode.

.rootTrack : maxObject : Read|Write

Get/Set the root track. Setting this property to a maxObject value will make the specified object the Root (World) node of the TrackView and thus limit display to tracks belonging to the new Root and its children.

.scaleValuesOrigin : float : Read|Write

Get/Set the value scaling origin. It is represented by a horizontal brown line when in Scale Values mode.

.editMode : enum : Read|Write

editMode enums: {#editKeys|#editTime|#editRanges|#positionRanges|#editFCurves}

Get/Set the Trackview edit mode.

Methods:

<string>getName()

Returns the name of the TrackView as string.

<void>setName <string>name

Sets the name of the TrackView to the specified string.

<integer>getNumTracks()

Returns the number of tracks in the TrackView.

<integer>numSelTracks()

Returns the number of selected tracks in the TrackView.

<boolean>canAssignController()

Returns true if a controller can be assigned to the current selection

<void>assignControllerDialog()

Opens the Assign Controller dialog.

<boolean>assignController <maxObject>controller

Assigns the specified controller to the currently selected tracks. Returns true on success.

<void>showControllerTypes <boolean>state

Enables/Disables the Controller Type display.

<void>expandTracks()

Expands the tracks of the Trackview.

<void>zoomSelected()

Zooms at the selected tracks.

<void>zoomOnTrack <maxObject>parent <index>subNum

Zooms at the indexed subAnim track of the specified object.

<maxObject>getTrack <index>index

Returns the indexed track.

<maxObject>getParent <index>index

Returns the parent of the indexed track.

<maxObject>getSelected <index>index

Returns the selected track of the indexed track.

<maxObject>getParentOfSelected <index>index

Returns the parent of the selected track of the indexed track.

<index>getSelectedSubNum <index>index

Returns the number of children of the selected track of the indexed track.

<index>getIndex <maxObject>object

Returns the index of the specified object.

<boolean>selectTrackByIndex <index>index <boolean>clearSelection

Selects the specified indexed track. If clearSelection is supplied as true, clears any previous selection. Returns true on success.

<boolean>selectTrack <maxObject>object <boolean>clearSelection

Selects the specified object. If clearSelection is supplied as true, clears any previous selection. Returns true on success.

<boolean>setFilter <name>FilterName

Sets the specified filter. Possible filter names are the same as for setFilter in the Interface: trackview section.

<boolean>clearFilter()

Clears the specified filter. Possible filter names are the same as for setFilter in the Interface: trackview section.

<void>setEditMode <enum>mode

mode enums: {#editKeys|#editTime|#editRanges|#positionRanges|#editFCurves}

Sets the Trackview edit mode.

<enum>getEditMode()

getEditMode enums: {#editKeys|#editTime|#editRanges|#positionRanges|#editFCurves}

Returns the Trackview edit mode.

<boolean>isCurrent()

Returns true if the Trackview is the current trackview.

<void>setCurrent()

Makes the Trackview current.

<void>openUtilityDialog()

Opens the Trackview Utility dialog.

<void>launchUtility <string>name

Launches the specified Utility.

<void>closeUtility <string>name

Closes the specified Utility.

<integer>utilityCount()

Returns the number of available Utilities.

<string>utilityName <index>index

Returns the name of the indexed Utility.

<void>setTangentType <enum>type [effect:<enum>]

type enums: {#smooth|#linear|#step|#fast|#slow|#custom|#flat}

effect enums: {#allSelKeys|#allKeys|#allKeysInSelTracks|#selKeysInSelTracks}

effect default value: #allSelKeys

Set the Tangent type of the specified keys to the specified type.

<void>setInTangentType <enum>type [effect:<enum>]

type enums: {#smooth|#linear|#step|#fast|#slow|#custom|#flat}

effect enums: {#allSelKeys|#allKeys|#allKeysInSelTracks|#selKeysInSelTracks}

effect default value: #allSelKeys

Set the InTangent type of the specified keys to the specified type.

<void>setOutTangentType <enum>type [effect:<enum>]

type enums: {#smooth|#linear|#step|#fast|#slow|#custom|#flat}

effect enums: {#allSelKeys|#allKeys|#allKeysInSelTracks|#selKeysInSelTracks}

effect default value: #allSelKeys

Set the OutTangent type of the specified keys to the specified type.

<void>restoreRootTrack()

Restore the root track.

<void>updateList()

Update the list.

Mixin Interface: (trackviews.current.ui)

Interface: ui

 

The ui MixinInterface provides access to the TrackView’s User Interface settings. It is returned by the .ui property of the trackview MixinInterface.

Properties:

.hwnd : HWND : Read

 

.layoutName : string by value : Read

 

.menuBar : string by value : Read|Write

 

There are two customizable Quad menus in the Function Curve Editor:

.controllerQuadMenu : string by value : Read|Write

When set to an existing menu name, the controllerQuadMenu will pop up when right-clicking in the controller window.

.keyQuadMenu : string by value : Read|Write

When set to an existing menu name, the keyQuadMenu will pop up when clicking in the keys window.

Example:

trackviews.current.ui.keyQuadMenu = "My Key Quad"

These menus get saved with the layout, so changing them and saving the layout will make them persistent. This allows the creation of different menu sets for different layouts.

 

.showMenuBar : bool : Read|Write

Get/set the visibility of the menu bar.

.showScrollBars : bool : Read|Write

Get/set the visibility of the scroll bars.

.showTrackWindow : bool : Read|Write

Get/set the visibility of the track window.

.showKeyWindow : bool : Read|Write

Get/set the visibility of the key window.

.showTimeRuler : bool : Read|Write

Get/set the visibility of the time ruler.

.showKeyableIcons : bool : Read|Write

When set to true, a Keyable icon will become visible next to the controllers. Clicking on the icon will toggle the keyable state which is used to determine if Set Key will set a key for the specific track. The showKeyableIcons state is saved with the Layout, so resaving the layout with the setting turned on will bring them back the next time the layout is used.

Example:

trackviews.current.ui.showKeyableIcons = true

.showCustomIcons : bool : Read|Write

When set to true, the icons next to the tracks will be taken from the ClassIcons.dat file. This means that each object, modifier, controller plugin can have it's own unique icon.

Example:

trackviews.current.ui.showCustomIcons = true

Methods:

<integer>toolbarCount()

Retruns the number of toolbars.

<bool>addToolbar <string>name

Adds a toolbars with the specified name.

<bool>deleteToolbar <fpvalue>name or index

Deletes a toolbars by its name or index.

<string>getToolbarName <index>index

Returns the name of the indexed toolbars.

<bool>isToolbarVisible <string>name

Returns the visibility of the named toolbar.

<void>showToolbar <string>name

Makes the named toolbar visible.

<void>hideToolbar <string>name

Hides the named toolbar.

<void>showAllToolbars()

Unhides all toolbars.

<void>hideAllToolbars()

Hides all toolbars.

<void>saveCurrentLayout()

Saves the current TrackView layout.

<void>saveLayout <string>name

Saves the TrackView layout under the specified name.

<void>loadLayout <string>name

Loads the TrackView layout with the specified name.

<integer>layoutCount()

Retruns the number of layouts.

<string>getLayoutName <index>index

Retruns the layout name of the indexed layout.

See also

Track View

Track View Pick Dialog

Interface: TrackSelectionSets