Timeline

With the Timeline functions, you can return values for layers and frames in the Timeline window.

There are two main groups of Timeline functions:

selToXX: the selection functions work with a selection using the selIdx parameter.
layerToXX: the layer functions work with Timeline layers using the layerIdx parameter.

The layerIdx and selIdx parameters are used in many of the functions:

layerIdx: this is an integer that represents the layer in the Timeline. The first layer in the Timeline is considered 0 (zero).
selIdx: this is an integer that represents the selection in the Timeline. It is a number from 0 to the number of layers selected minus 1.

Following are the Timeline functions:

firstFrameSel
isAncestorOf
layerIsColumn
layerIsNode
layerToColumn
layerToNode
numFrameSel
numLayers
numLayerSel
parentNodeIndex
selIsColumn
linuxArch
selToColumn
selToLayer
selToNode
setDisplayToUnconnected

Example

function printTimelineLayerInformation()

{

 

//

// Print out information for all layers

//

 

var numLayers = Timeline.numLayers;

 

for ( var i = 0; i < numLayers;i++ )

{

if ( Timeline.layerIsNode( i ) )

System.println(i + ": is a node named " + Timeline.layerToNode(i));

 

if ( Timeline.layerIsColumn(i ) )

System.println( " " + i + ": also has an xsheet column named " + Timeline.layerToColumn(i) );

}

 

//

// Print out information on selected layers

//

 

System.println("number of frames selected is " + Timeline.numFrameSel + " starting at " + Timeline.firstFrameSel);

 

var numSelLayers = Timeline.numLayerSel;

 

for ( var i = 0; i < numSelLayers; i++ )

{

if ( Timeline.selIsNode( i ) )

System.println(" " + i + ": is a SELECTED node layer with name " + Timeline.selToNode(i));

 

if ( Timeline.selIsColumn(i ) )

System.println( i + ": SELECTED layer name is " + Timeline.selToColumn(i) );

}

}

Related Topics 

Function Summary