Harmony
Scripting Interface Documentation
frame Class Reference

The frame JavaScript global object. Get the current frame or number of frames. Add or remove frames in your scene. Manipulate the timeline marker. More...

Public Slots

int numberOf ()
 Returns the number of frames in the scene. More...
 
int current ()
 Returns the number of the current frame. More...
 
bool insert (int atFrame, int nbFrames)
 Inserts frames at the selected frame number. More...
 
bool remove (int atFrame, int nbFrames)
 Deletes frames starting from the selected frame number. More...
 
void setCurrent (int frame)
 Allows you to change the current frame. More...
 
Timeline Markers
bool hasTimelineMarker (int frame)
 Returns if marker exists at this frame. More...
 
String timelineMarkerNote (int frame)
 Returns markers text. More...
 
int timelineMarkerStart (int frame)
 Returns markers start frame. More...
 
int timelineMarkerLength (int frame)
 Returns markers length. More...
 

Detailed Description

The frame JavaScript global object. Get the current frame or number of frames. Add or remove frames in your scene. Manipulate the timeline marker.

The frame global object can only be used in the Script Editor or the Master Controller node.

function sceneOpened()
{
// this part of the function launches the newScene function if
// the scene has only one frame
if (frame.numberOf() == 1)
newScene();
}
function newScene()
{
// this function opens a dialog box named Create New Scene, which
// allows users to enter the number of frames to add to the scene
var d = new Dialog;
d.title = "Create New Scene";
var nbFrames = new SpinBox;
nbFrames.label = "Number of Frames";
nbFrames.minimum = 1;
nbFrames.maximum = 300;
nbFrames.value = 60;
d.add(nbFrames);
if (d.exec())
{
var oldNbFrames = frame.numberOf();
frame.insert(0, nbFrames.value - oldNbFrames);
}
}

Member Function Documentation

◆ current

int frame::current ( )
slot

Returns the number of the current frame.

Returns
The current frame, the first frame is 1.

◆ hasTimelineMarker

bool frame::hasTimelineMarker ( int  frame)
slot

Returns if marker exists at this frame.

Parameters
framecurrent frame

◆ insert

bool frame::insert ( int  atFrame,
int  nbFrames 
)
slot

Inserts frames at the selected frame number.

atFrame = 0 -> insert before first frame. atFrame = n -> insert after frame n. atFrame = Application.frame.numberOf() -> insert at end.

Parameters
atFrameThe frame number at which the frames will be inserted. Frames are inserted after the frame indicated. Use 0 to insert frames before the first frame.
nbFramesThe number of frames to insert

◆ numberOf

int frame::numberOf ( )
slot

Returns the number of frames in the scene.

Returns
The number of frames in the scene.

◆ remove

bool frame::remove ( int  atFrame,
int  nbFrames 
)
slot

Deletes frames starting from the selected frame number.

atFrame = 0 -> delete at the beginning atFrame = n -> delete frames following the nth frame atFrame = Application.frame.nbFrames() -> won't delete anything

Parameters
atFrameThe frame number at which the frames will be removed. Frames are removed after the frame indicated. Use 0 to remove frames before the first frame.
nbFramesThe number of frames to remove
Returns
True if the number of frames give is valid.

◆ setCurrent

void frame::setCurrent ( int  frame)
slot

Allows you to change the current frame.

Parameters
frameThe new current frame

◆ timelineMarkerLength

int frame::timelineMarkerLength ( int  frame)
slot

Returns markers length.

Parameters
framecurrent frame

◆ timelineMarkerNote

String frame::timelineMarkerNote ( int  frame)
slot

Returns markers text.

Parameters
framecurrent frame

◆ timelineMarkerStart

int frame::timelineMarkerStart ( int  frame)
slot

Returns markers start frame.

Parameters
framecurrent frame