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, QScriptValue options=QScriptValue())
 Inserts frames at the selected frame number. More...
 
bool remove (int atFrame, int nbFrames, QScriptValue options=QScriptValue())
 Deletes frames starting from the selected frame number. More...
 
void setCurrent (int frame)
 Allows you to change the current frame. More...
 
void setNumberOf (int nbFrames)
 Allows you to change the number of frames in the scene. More...
 
Timeline Markers (Deprecated)
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.

Deprecated:
Use of the TimelineMarker interface is preferred.
Parameters
framecurrent frame

◆ insert

bool frame::insert ( int  atFrame,
int  nbFrames,
QScriptValue  options = QScriptValue() 
)
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
optionsThis optional parameter should be an object with the desired behaviours for when the frames are inserted
// This example will insert 7 new frames at frame 3, ripple the scene markers afterwards, and extend the exposures.
var options = { ripple_markers : true,
extend_exposure : true };
frame.insert(3, 7, options);
Option Default Value Effect
ripple_markers false Move the scene markers down the scene when inserting frames.
extend_exposure false Extend the exposure of existing drawings when inserting frames.
Returns
True if the number of frames given is valid.

◆ 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,
QScriptValue  options = QScriptValue() 
)
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
optionsThis optional parameter should be an object with the desired behaviours for when the frames are removed
// This example will remove 3 frames at frame 7, and ripple the scene markers afterwards.
var options = { ripple_markers : true };
frame.remove(7, 3, options);
Option Default Value Effect
ripple_markers false Trim and/or delete the scene markers when removing frames.
Returns
True if the number of frames given is valid.

◆ setCurrent

void frame::setCurrent ( int  frame)
slot

Allows you to change the current frame.

Parameters
frameThe new current frame

◆ setNumberOf

void frame::setNumberOf ( int  nbFrames)
slot

Allows you to change the number of frames in the scene.

Parameters
nbFramesThe number of frames in the scene

◆ timelineMarkerLength

int frame::timelineMarkerLength ( int  frame)
slot

Returns markers length.

Deprecated:
Use of the TimelineMarker interface is preferred.
Parameters
framecurrent frame

◆ timelineMarkerNote

String frame::timelineMarkerNote ( int  frame)
slot

Returns markers text.

Deprecated:
Use of the TimelineMarker interface is preferred.
Parameters
framecurrent frame

◆ timelineMarkerStart

int frame::timelineMarkerStart ( int  frame)
slot

Returns markers start frame.

Deprecated:
Use of the TimelineMarker interface is preferred.
Parameters
framecurrent frame