Class: MohoDoc

The MohoDoc class represents the current Moho document object.

Member Functions


int CountLayers()

Returns the number of top-level layers in the document.

Return value (int): the number of top-level layers in the document
MohoLayer Layer(id)

Access an individual layer in the document.

Return value (MohoLayer): a layer in the document id (int): id number of the layer (0 is the lowest layer in the document)
void PrepUndo(layer)

Mark a point in editing that the user can "undo" to return to. Pass nil as the argument to mark a forthcoming operation as "not undoable".

Return value: none layer (MohoLayer): the layer that is about to be modified
void SetDirty()

Marks the document as "dirty" or modified, prompting the user to save if they try to quit.

Return value: none
int AnimDuration()

Returns the duration of the document's animation. This is basically the frame number of the last keyframe in the entire document. Depending on the animation, this can be much less or much more than the document's official end frame.

Return value (int): the duration of the document's animation
int Width()

Returns the pixel width of the final rendered output.

Return value (int): pixel width of the final rendered output
int Height()

Returns the pixel height of the final rendered output.

Return value (int): pixel height of the final rendered output
void SetShape(w, h)

Set's the pixel width and height of the final rendered output.

Return value: none w (int): width h (int): height
float AspectRatio()

Returns the aspect ratio of the final rendered output.

Return value (float): aspect ratio of the final rendered output
int StartFrame()

Returns the document's start frame (typically 1).

Return value (int): document start frame
void SetStartFrame(frame)

Sets the document's start frame.

Return value: none frame (int): document start frame
int EndFrame()

Return's the document's end frame.

Return value (int): document end frame
void SetEndFrame(frame)

Sets the document's start frame.

Return value: none frame (int): document end frame
float Fps()

Returns the frame rate of the document (frames per second).

Return value (float): document fps
bool IsOutsideViewEnabled()

Returns true if the user is orbiting the workspace, and not viewing the scene through the camera.

Return value (bool): true if orbiting, false if viewing through the camera
void GetOutsideViewMatrix(m)

Returns the transformation matrix for viewing the scene from the "orbit" view.

Return value: none m (LM_Matrix): orbit transform matrix
void DepthSort()

Performs a depth sort on all layers in the document.

Return value: none

Member Variables


fCameraTrack (AnimVec3)

the camera tracking animation channel


fCameraZoom (AnimVal)

the camera zoom animation channel


fCameraRoll (AnimVal)

the camera roll animation channel


fCameraPanTilt (AnimVec2)

the camera pan/tilt animation channel