Interface: trackviews

Interfaces > Core Interfaces > trackviews

 

   

Core Interfaces - Quick Navigation

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

trackviews.currentTrackView : Interface : Read 	 

Returns a TrackView [Mixin Interface] to the current track view, or undefined when no current track view exists.

   

trackviews.current: Interface : Read   

Returns a TrackView [Mixin Interface] 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

FOR EXAMPLE:

trackviews.currentTrackView
--> <MixinInterface:TrackView>

   

trackviews.lastUsedTrackViewName : string : Read 

Returns the name of the last used track view as string.

   

trackviews.defaultCurveEditorLayout : string : Read|Write 

NEW in 3ds Max 2017: Gets/sets the name of the default Curve Editor Layout. The default is "Function Curve Layout".

The value is stored in the trackviews.ini file and will persist between sessions.

   

Methods

<Interface>trackviews.getTrackView <fpvalue>name or index 

This method will get a TrackView [Mixin Interface] based on the trackview's index or name.

   

<Interface by value array>trackviews.getAllOpenTrackViews() 

Returns an array of the TrackView [Mixin Interfaces] of all open trackviews.

   

<integer>trackviews.numTrackViews() 

Returns the number of trackviews.

   

<boolean>trackviews.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 an effect when the track view is opened for the first time. 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>trackviews.close <fpvalue>name or index 

Closes a trackview based on its index or name.

   

<void>trackviews.delete <fpvalue>name or index 

Deletes a trackview based on its index or name.

   

<string>trackviews.getTrackViewName <index>index 

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

   

<boolean>trackviews.zoomSelected <string>name 

Zooms to the selected object's track.

   

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

Returns True if successful and False otherwise.

   

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

Sets the specified filter for the specified Trackview by name. Returns True if successful and False otherwise.

Possible filter names are:

Filter Name Note
#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  

FOR 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>trackviews.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 above as possible arguments of setFilter .

   

<fpvalue>trackviews.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 a single value.

   

<boolean>trackviews.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>trackviews.isOpen <fpvalue>nameorindex 

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 must first use trackviews.exists() to make sure that the requested TrackView is valid.

FOR EXAMPLE:

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 aTrack View
--> true
trackviews.exists "something"
--> true
trackviews.exists 1
--> true

   

<boolean>trackviews.openLastUsedTrackView() 

Opens the current trackview if it has been closed.

   

<boolean>trackviews.isCurrent <fpvalue>name or index 

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

   

<boolean>trackviews.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 [Mixin Interface] provides access to the features of the TrackView dialog. It is returned by the .current property of the trackviews Core Interface as well as by several methods described earlier in this page.

   

Properties:

.ui : Interface : Read 

Returns a ui [Mixin Interface] exposing features of the User Interface of the specified TrackView.

EXAMPLE:

trackviews.currentTrackView.ui
--> <MixinInterface:ui>

   

.modifySubTree : boolean : Read|Write 

Gets/Sets 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 

Gets/Sets 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 

Gets/Sets 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 such as, 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 helps in drawing curves by giving visual feedback of what is being drawn.

EXAMPLE:

trackviews.current.syncTime = true

   

.freezeSelKeys : boolean : Read|Write 

Gets/Sets the freezing of selected keys.

   

.freezeNonSelCurves : boolean : Read|Write 

Gets/Sets the freezing of non-selected curves.

   

.showNonSelCurves : boolean : Read|Write 

Gets/Sets the visibility of non-selected curves.

   

.showTangents : enum : Read|Write showTangents enums: { #none | #selected | #all } 

Gets/Sets the 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 

Gets/Sets the visibility of frozen keys.

   

.useSoftSelect : boolean : Read|Write 

Gets/Sets the keys soft selection usage.

   

.softSelectRange : time : Read|Write 

Gets/Sets the keys soft selection range.

   

.softSelectFalloff : float : Read|Write 

Gets/Sets the keys soft selection falloff.

   

.autoExpandSelectedOnly : boolean : Read|Write 

Gets/Sets the auto-expand tracks of the selected objects mode.

   

.autoExpandChildren : boolean : Read|Write 

Gets/Sets the auto-expand children mode.

   

.autoExpandTransforms : boolean : Read|Write 

Gets/Sets the auto-expand transformation tracks mode.

   

.autoExpandObjects : boolean : Read|Write 

Gets/Sets the auto-expand objects mode.

   

.autoExpandModifiers : boolean : Read|Write 

Gets/Sets the auto-expand modifiers mode.

   

.autoExpandMaterials : boolean : Read|Write 

Gets/Sets the auto-expand materials mode.

   

.autoExpandXYZ : boolean : Read|Write 

Gets/Sets the auto-expand X,Y,Z sub-tracks mode.

   

.autoSelectAnimated : boolean : Read|Write 

Gets/Sets the auto-select animated tracks mode.

   

.autoSelectPosition : boolean : Read|Write 

Gets/Sets the auto-select position tracks mode.

   

.autoSelectRotation : boolean : Read|Write 

Gets/Sets the auto-select rotation tracks mode.

   

.autoSelectScale : boolean : Read|Write 

Gets/Sets the auto-select scale tracks mode.

   

.autoSelectXYZ : boolean : Read|Write 

Gets/Sets the auto-select X,Y,T sub-tracks mode.

   

.autoScrollToRoot : boolean : Read|Write 

Gets/Sets the auto-scroll to root mode.

   

.autoScrollToSelected : boolean : Read|Write 

Gets/Sets the auto-scroll to selected mode.

   

.manualNavigation : boolean : Read|Write 

Gets/Sets the manual navigation mode.

   

.rootTrack: maxObject : Read|Write 

Gets/Sets the root track.

Setting this property to a maxObject value will make the specified object the Root (World) node of the TrackView and this limits the display to tracks belonging to the new Root and its children.

   

.scaleValuesOrigin : float : Read|Write 

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

   

.editMode : enum : Read|Write 

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

Gets/Sets 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 those set for setFilter in the trackviews table.

   

<boolean>clearFilter() 

Clears the specified filter. Possible filter names are the same as those set for setFilter in the trackviews table .

   

<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.

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 

Sets 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 

Sets 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 

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

   

<void>restoreRootTrack() 

Restores the root track.

   

<void>updateList() 

Updates the list.

 

Mixin Interface: (trackviews.current.ui)

Interface: ui 

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

 

Properties:

.hwnd : HWND : Read 

Contains the Window Handle of the Trackview. Read-only.

   

.layoutName : string by value : Read 

Contains the layout name of the Trackview. Read-only.

   

.menuBar : string by value : Read|Write 

Gets/sets the menu bar name of the Trackview.

EXAMPLES:

trackview.open "New Trackview"
trackviews.current.ui.hwnd --will vary between sessions
--> 855006
 
trackviews.current.ui.layoutName
--> "Function Curve Layout"
 
trackviews.current.ui.menuBar
--> "Track View - Curve Editor - Menu Bar"

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 

Gets/sets the visibility of the menu bar.

   

.showScrollBars : bool : Read|Write 

Gets/sets the visibility of the scroll bars.

   

.showTrackWindow : bool : Read|Write 

Gets/sets the visibility of the track window.

   

.showKeyWindow : bool : Read|Write 

Gets/sets the visibility of the key window.

   

.showTimeRuler : bool : Read|Write 

Gets/sets 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 its own unique icon.

EXAMPLE:

trackviews.current.ui.showCustomIcons = true

   

showUnlockedIcons : bool : Read|Write 

When set to True, a lock icon will be shown next to the track.

The icon will show an unlocked state when the track is not locked, and will appear as locked when the track is locked.

When set to false, these icons will not be shown, but the word (Locked) will still appear to the right of the track name if the track is locked.

Available in 3ds Max 2010 and higher.

EXAMPLE:

trackviews.current.ui.showUnlockedIcons = true

Methods:

<integer>toolbarCount() 

Returns the number of toolbars.

   

<bool>addToolbar <string>name 

Adds a toolbar with the specified name.

   

<bool>deleteToolbar <fpvalue>name or index 

Deletes a toolbar 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() 

Returns the number of layouts.

   

<string>getLayoutName <index>index 

Returns the layout name of the indexed layout.

   

See Also