Timeline Class Reference

The Timeline JavaScript global object. Used to get informations about layers and frames from the Timeline view. More...

Public Slots

bool selIsColumn (int selectionIndex)
 Returns true if the selectionIndex points to a column. More...
 
String selToColumn (int selectionIndex)
 Converts the selection index to a column. More...
 
String selToNode (int selectionIndex)
 Converts the selection index to a node. More...
 
bool selIsNode (int selectionIndex)
 Returns true if the selection index is a node. More...
 
bool layerIsColumn (int layerIndex)
 Returns true if the layer index is a column. More...
 
String layerToColumn (int layerIndex)
 Returns the layer as a column, or the empty string if this layer is not a column. More...
 
bool layerIsNode (int layerIndex)
 Returns true if the layer is a node. More...
 
String layerToNode (int layerIndex)
 Returns the node associated to the layer, or the empty string if this layer is not a node. More...
 
int selToLayer (int selectionIndex)
 Converts a selection index to a layer index. More...
 
int parentNodeIndex (int layerIndex)
 Returns the layer index of the parent node. More...
 
bool isAncestorOf (int parentLayerIndex, int layerIndex)
 Returns true if the parent layer index is an ancestor of the layer index. More...
 
bool setDisplayToUnconnected ()
 Returns true if the display was set to unconnected. More...
 
QScriptValue getFrameMarker (int layerIndex, int frameNumber)
 Return an object representing the Timeline Frame Marker at the given frame for the given layer index. More...
 
QScriptValue getAllFrameMarkers (int layerIndex)
 Return an array of object representing the Timeline Frame Markers for the given layer index. More...
 
QScriptValue filterFrameMarkers (int layerIndex, String markerType)
 Return an array of object representing the Timeline Frame Markers for the given layer index, with the given type. More...
 
int createFrameMarker (int layerIndex, String markerType, int frameNumber)
 Creates a Timeline Frame Marker with the given properties. More...
 
bool deleteFrameMarker (int layerIndex, int markerId)
 Deletes the Timeline Frame Marker with the given id. More...
 
bool moveFrameMarker (int layerIndex, int markerId, int newFrame)
 Moves a Timeline Frame Marker from it's current frame to the new frame. More...
 
bool changeFrameMarkerType (int layerIndex, int markerId, String markerType)
 Changes the type of a Timeline Frame Marker. More...
 
StringList frameMarkerTypes ()
 Returns a list of Timeline Frame Marker types. More...
 

Public Member Functions

int numLayerSel ()
 Returns the number of layer selected. More...
 
int firstFrameSel ()
 Returns the first frame selected. More...
 
int numFrameSel ()
 Returns the number of the selected frame, if only one frame is selected. It will return zero (0) if no frames are selected. More...
 
int numLayers ()
 Returns the number of layers in the timeline. More...
 

Properties

int numLayerSel
 Returns the number of selected layers. More...
 
int firstFrameSel
 Returns the first selected frame number. More...
 
int numFrameSel
 Returns the number of selected the frame. If only 1 frame is selected. More...
 
int numLayers
 Returns the number of layers in the timeline. More...
 

Detailed Description

The Timeline JavaScript global object. Used to get informations about layers and frames from the Timeline view.

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.
function printTimelineLayerInformation()
{
//
// Print out information for all layers
//
for ( var i = 0; i < numLayers;i++ )
{
if ( Timeline.layerIsNode( i ) )
MessageLog.trace(i + ": is a node named " + Timeline.layerToNode(i));
MessageLog.trace( " " + i + ": also has an xsheet column named " + Timeline.layerToColumn(i) );
}
MessageLog.trace("number of frames selected is " + Timeline.numFrameSel + " starting at " + Timeline.firstFrameSel);
//
// Print out information on selected layers
//
var numSelLayers = Timeline.numLayerSel;
for ( var i = 0; i < numSelLayers; i++ )
{
if ( Timeline.selIsNode( i ) )
MessageLog.trace(" " + i + ": is a SELECTED node layer with name " + Timeline.selToNode(i));
if ( Timeline.selIsColumn(i ) )
MessageLog.trace( i + ": SELECTED layer name is " + Timeline.selToColumn(i) );
}
}

Member Function Documentation

◆ changeFrameMarkerType

bool Timeline::changeFrameMarkerType ( int  layerIndex,
int  markerId,
String  markerType 
)
slot

Changes the type of a Timeline Frame Marker.

Parameters
layerIndex: The layer index in the timeline layer.
markerId: The id of the marker to move.
markerType: The type to change the marker to.
Returns
True if the marker type was changed.

◆ createFrameMarker

int Timeline::createFrameMarker ( int  layerIndex,
String  markerType,
int  frameNumber 
)
slot

Creates a Timeline Frame Marker with the given properties.

The objects have the following properties:

type - The type of the frame marker. By default, these are the colours of the frame markers.

frame - The frame number.

id - The id of the frame marker. These are unique within the layer.

Parameters
layerIndex: The layer index in the timeline layer.
markerType: The type of frame marker to create.
frameNumber: The frame to create the marker on.
Returns
The id of the newly created marker, or -1 if adding the marker failed.

◆ deleteFrameMarker

bool Timeline::deleteFrameMarker ( int  layerIndex,
int  markerId 
)
slot

Deletes the Timeline Frame Marker with the given id.

Parameters
layerIndex: The layer index in the timeline layer.
markerId: The id of the marker to delete.
Returns
True if the marker was deleted.

◆ filterFrameMarkers

QScriptValue Timeline::filterFrameMarkers ( int  layerIndex,
String  markerType 
)
slot

Return an array of object representing the Timeline Frame Markers for the given layer index, with the given type.

The objects have the following properties:

type - The type of the frame marker. By default, these are the colours of the frame markers.

frame - The frame number.

id - The id of the frame marker. These are unique within the layer.

Parameters
layerIndex: The layer index in the timeline layer.
markerType: The type of frame marker to filter for.
Returns
An array of objects representing the Timeline Frame Markers.

◆ firstFrameSel()

int Timeline::firstFrameSel ( )

Returns the first frame selected.

Returns
Returns the first selected frame number.

◆ frameMarkerTypes

StringList Timeline::frameMarkerTypes ( )
slot

Returns a list of Timeline Frame Marker types.

Returns
A list of Timeline Frame Marker types.

◆ getAllFrameMarkers

QScriptValue Timeline::getAllFrameMarkers ( int  layerIndex)
slot

Return an array of object representing the Timeline Frame Markers for the given layer index.

The objects have the following properties:

type - The type of the frame marker. By default, these are the colours of the frame markers.

frame - The frame number.

id - The id of the frame marker. These are unique within the layer.

Parameters
layerIndex: The layer index in the timeline layer.
Returns
An array of objects representing the Timeline Frame Markers.

◆ getFrameMarker

QScriptValue Timeline::getFrameMarker ( int  layerIndex,
int  frameNumber 
)
slot

Return an object representing the Timeline Frame Marker at the given frame for the given layer index.

The object has the following properties:

type - The type of the frame marker. By default, these are the colours of the frame markers.

frame - The frame number.

id - The id of the frame marker. These are unique within the layer.

Parameters
layerIndex: The layer index in the timeline layer.
frameNumber: The frame number.
Returns
An object representing a Timeline Frame Marker.

◆ isAncestorOf

bool Timeline::isAncestorOf ( int  parentLayerIndex,
int  layerIndex 
)
slot

Returns true if the parent layer index is an ancestor of the layer index.

Parameters
parentLayerIndex: The parent layer index in the timeline layer.
layerIndex: The layer index in the timeline layer.
Returns
Returns true if the parent layer index is an ancestor of the layer index.

◆ layerIsColumn

bool Timeline::layerIsColumn ( int  layerIndex)
slot

Returns true if the layer index is a column.

Parameters
layerIndex: The layer index in the timeline layer.
Returns
Returns true if the layer index is a column.

◆ layerIsNode

bool Timeline::layerIsNode ( int  layerIndex)
slot

Returns true if the layer is a node.

Parameters
layerIndex: The layer index in the timeline layer.
Returns
Returns true if the layer is a node.

◆ layerToColumn

String Timeline::layerToColumn ( int  layerIndex)
slot

Returns the layer as a column, or the empty string if this layer is not a column.

Parameters
layerIndex: The layer index in the timeline layer.
Returns
Returns the layer as a column, or the empty string if this layer is not a column.

◆ layerToNode

String Timeline::layerToNode ( int  layerIndex)
slot

Returns the node associated to the layer, or the empty string if this layer is not a node.

Parameters
layerIndex: The layer index in the timeline layer.
Returns
Returns the node associate to the layer, or the empty string if this layer is not a node.

◆ moveFrameMarker

bool Timeline::moveFrameMarker ( int  layerIndex,
int  markerId,
int  newFrame 
)
slot

Moves a Timeline Frame Marker from it's current frame to the new frame.

Note
If a marker already exists on that frame, it will be deleted.
Parameters
layerIndex: The layer index in the timeline layer.
markerId: The id of the marker to move.
newFrame: The frame to move to the marker to.
Returns
True if the marker was moved.

◆ numFrameSel()

int Timeline::numFrameSel ( )

Returns the number of the selected frame, if only one frame is selected. It will return zero (0) if no frames are selected.

Returns
Returns the number of selected frame.

◆ numLayers()

int Timeline::numLayers ( )

Returns the number of layers in the timeline.

Returns
Returns the number of layers in the timeline.

◆ numLayerSel()

int Timeline::numLayerSel ( )

Returns the number of layer selected.

Returns
Returns the number of selected layers.

◆ parentNodeIndex

int Timeline::parentNodeIndex ( int  layerIndex)
slot

Returns the layer index of the parent node.

Parameters
layerIndex: The layer index in the timeline layer.
Returns
Returns the layer index of the parent node.

◆ selIsColumn

bool Timeline::selIsColumn ( int  selectionIndex)
slot

Returns true if the selectionIndex points to a column.

Parameters
selectionIndex: The selection index in the timeline layer.
Returns
Returns true if the selIdx points to a column.

◆ selIsNode

bool Timeline::selIsNode ( int  selectionIndex)
slot

Returns true if the selection index is a node.

Parameters
selectionIndex: The selection index in the timeline layer.
Returns
Returns true if the selection index is a node.

◆ selToColumn

String Timeline::selToColumn ( int  selectionIndex)
slot

Converts the selection index to a column.

Parameters
selectionIndex: The selection index in the timeline layer.
Returns
Returns the name of the column.

◆ selToLayer

int Timeline::selToLayer ( int  selectionIndex)
slot

Converts a selection index to a layer index.

Parameters
selectionIndex: The selection index in the timeline layer.
Returns
Returns a layer index.

◆ selToNode

String Timeline::selToNode ( int  selectionIndex)
slot

Converts the selection index to a node.

Parameters
selectionIndex: The selecton index in the timeline layer.
Returns
Returns the name of the node.

◆ setDisplayToUnconnected

bool Timeline::setDisplayToUnconnected ( )
slot

Returns true if the display was set to unconnected.

Returns
Returns true if the display was set to unconnected.

Property Documentation

◆ firstFrameSel

int Timeline::firstFrameSel
read

Returns the first selected frame number.

Returns
Returns the first selected frame number.

◆ numFrameSel

int Timeline::numFrameSel
read

Returns the number of selected the frame. If only 1 frame is selected.

Returns
Returns the number of the selected frame.

◆ numLayers

int Timeline::numLayers
read

Returns the number of layers in the timeline.

Returns
Returns the number of layers in the timeline.

◆ numLayerSel

int Timeline::numLayerSel
read

Returns the number of selected layers.

Returns
Returns the number of selected layers.