Class ScriptInterface

Version added: before 9.5
The ScriptInterface class is a script's way of interacting with the Anime Studio application itself. When a script is invoked (by a mouse click, a key press, or a menu command), it is provided with an object called "moho" - this object is an instance of the ScriptInterface class.

Methods:

Name Returns Description Version added
AddPointKeyframe void Adds a point motion keyframe to all the currently selected vector points before 9.5
AlignLayers void Added in version 11.1 11.1
AppDir char before 9.5
AppVersion char Added in version 9.5 - Gets the AS version number as a text string 9.5
BeginFileListing void before 9.5
BindingKeyName char Added in version 11 11.0
ChannelAsAnimBool AnimBool Added in version 12 12.0
ChannelAsAnimColor AnimColor Added in version 12 12.0
ChannelAsAnimString AnimString Added in version 12 12.0
ChannelAsAnimVal AnimVal Added in version 12 12.0
ChannelAsAnimVec2 AnimVec2 Added in version 12 12.0
ChannelAsAnimVec3 AnimVec3 Added in version 12 12.0
CheckIfLocked bool before 9.5
Click void Play a little clicking sound before 9.5
ClipboardText char Added in version 9.5 9.5
Copy void before 9.5
CopyAlternate void before 9.5
CopyColor void Added in version 9.5 9.5
CopyText void Added in version 9.5 9.5
CountAudioLayers int32 before 9.5
CountBones int32 Returns the number of bones in the current bone layer before 9.5
CountCurves int32 Returns the number of curves in the current vector layer before 9.5
CountEdges int32 Returns the number of edges in the current vector layer before 9.5
CountFilledShapes int32 Added in version 12 12.0
CountPoints int32 Returns the number of points in the current vector layer before 9.5
CountSelectedBones int32 Returns the number of selected bones in the current bone layer before 9.5
CountSelectedCurves int32 before 9.5
CountSelectedEdges int32 Returns the number of selected edges in the current vector layer before 9.5
CountSelectedFilledShapes int32 Added in version 12 12.0
CountSelectedPoints int32 Returns the number of selected points in the current vector layer before 9.5
CountSelectedShapes int32 Returns the number of selected shapes in the current vector layer before 9.5
CountShapes int32 Returns the number of shapes in the current vector layer before 9.5
CreateNewLayer MohoLayer Creates a new layer, inserts it directly above the currently selected layer in the Layers window, and makes it the selected layer before 9.5
CreateShape int32 Creates a shape based on the currently selected vector points before 9.5
CreateTextObject void before 9.5
CurrentEditStyle M_Style Added in version 9.5 9.5
CurrentTool char Added in version 12 12.0
DeleteLayer void before 9.5
DeleteMultipleLayers void before 9.5
DeselectShapes void Added in version 11 11.0
DestroyDocument void before 9.5
DisableDrawingTools bool before 9.5
DocToPixel real When the user specifies things like line width, blur radius, and shadow offset in Anime Studio, they enter a value in pixels before 9.5
DrawingMesh M_Mesh Added in version 11 11.0
DrawShape void Added in version 10 10.0
DuplicateLayer MohoLayer Duplicates the given layer, placing the new copy above the old one and making it the selected layer before 9.5
EditLayerSettings void before 9.5
ExporterPath char Added in version 12 12.0
FileClose void Added in version 11 11.0
FileImport void before 9.5
FileNew void before 9.5
FileOpen void before 9.5
FileRender void Render current frame before 9.5
FileSave void before 9.5
FileSaveAs void before 9.5
FillInFontList void Fills in an LM_TextList interface object with the list of available fonts on the system before 9.5
GetAudioLayer AudioLayer before 9.5
GetNextFile char before 9.5
ImportEPS void Import an EPS or Adobe Illustrator file into Anime Studio, creating a new vector layer to hold it before 9.5
InsertText void Deprecated. Use the new InsertText method instead. before 9.5
InsertText void Creates a new text object before 9.5
IsCopyable bool before 9.5
IsPasteable bool before 9.5
IsPlaying bool before 9.5
IsPro bool Added in version 10 10.0
LayerAs3D Mesh3DLayer Converts a generic layer object into a 3D layer before 9.5
LayerAsAudio AudioLayer before 9.5
LayerAsBone BoneLayer before 9.5
LayerAsGroup GroupLayer Converts a generic layer object into a group layer before 9.5
LayerAsImage ImageLayer Converts a generic layer object into an image layer before 9.5
LayerAsNote NoteLayer before 9.5
LayerAsParticle ParticleLayer Converts a generic layer object into a particle layer before 9.5
LayerAsSwitch SwitchLayer Converts a generic layer object into a switch layer before 9.5
LayerAsVector MeshLayer before 9.5
LayersWindowGetSearchContext LayersWindowSearchContext Added in version 12.2 12.2
LayersWindowGetSearchContextValue char Added in version 12.2 12.2
LayersWindowSetSearchContext void Added in version 12.2 12.2
LayersWindowSetSearchContextValue void Added in version 12.2 12.2
LoadDocument MohoDoc before 9.5
Mesh M_Mesh Returns the 2D mesh associated with the currently active layer before 9.5
Mesh3D M_Mesh3D Returns the 3D mesh object associated with the current layer before 9.5
NewKeyframe void Tells the timeline window to display a new keyframe in the specified animation channel before 9.5
NewShapeFillColor rgb_color Added in version 9.5 9.5
NewShapeLineColor rgb_color Added in version 9.5 9.5
NewShapeLineWidth real Returns what the line width would be for a new shape before 9.5
NewShapeProperties M_Shape before 9.5
NoiseVector LM_Vector3 Generates a semi-random vector before 9.5
OpenPoserPalette void before 9.5
ParentSkeleton M_Skeleton Returns the skeleton object associated with the parent layer of the current layer before 9.5
Paste void before 9.5
PasteAlternate void before 9.5
PickStyleProperties void before 9.5
PixelToDoc real When the user specifies things like line width, blur radius, and shadow offset in Anime Studio, they enter a value in pixels before 9.5
PlaceLayerBehindAnother void Moves one layer behind (or below) another in the layer ordering before 9.5
PlaceLayerInGroup void Moves a layer into a group before 9.5
PurgeTracingImage void Added in version 11 11.0
PushStyleProperties void before 9.5
Quit void before 9.5
RestoreTracingImage bool Added in version 11 11.0
SaveTracingImage void Added in version 11 11.0
SelectedShape M_Shape Returns the first selected shape, but starting in version 10 there may be multiple selected shapes. (This method added in version 10) 10.0
SetCurFrame void Set the current time before 9.5
SetNewShapeLineWidth void Added in version 11 11.0
SetSelLayer void Changes which layer is selected in the Layers window before 9.5
ShowLayerInLayersPalette void before 9.5
Skeleton M_Skeleton Returns the skeleton object associated with the current layer before 9.5
SnapToGrid void Takes a vector position and "snaps" it to the nearest grid intersection before 9.5
TraceWhitePixels int32 Added in version 10 10.0
UpdateBonePointSelection void Selects the points that are bound to the currently selected bone before 9.5
UpdateSelectedChannels void Updates the display of "selected" channels in the timeline before 9.5
UpdateUI void Force the user interface to redraw itself before 9.5
UserAppDir char before 9.5

Properties:

Name Type Description Version added
document MohoDoc The current document object open in Moho before 9.5
drawingFrame int32 Added in version 11 11.0
drawingLayer MohoLayer Added in version 11. This is the vector layer where drawn paths / shapes will be placed and, especially when using frame-by-frame, is not necessarily the layer that is shown as active in the Layers window 11.0
drawingLayerFrame int32 Added in version 11 11.0
frame int32 The current frame in the timeline before 9.5
gridOn bool True if the grid is turned on in the editing view, otherwise false before 9.5
gridSize real The size of one grid unit before 9.5
layer MohoLayer The currently selected layer in the Layers window before 9.5
layerFrame int32 the frame relative to the start of the layer (if the layer has not been moved in the sequencer this will be the same as the timeline frame) before 9.5
view MohoView The editing view before 9.5