File lm_utilities.lua is included in Moho installation and provides a number of useful utilities you can use in your scripts.

Properties:

MOHO.disabledCursor = LM.GUI.Cursor("ScriptResources/disabled_cursor", 8, 8)
MOHO.moveCursor = LM.GUI.Cursor("ScriptResources/move_cursor", 1, 1)
MOHO.scaleCursor = LM.GUI.Cursor("ScriptResources/scale_cursor", 1, 1)
MOHO.rotateCursor = LM.GUI.Cursor("ScriptResources/rotate_cursor", 1, 1)
MOHO.crosshairCursor = LM.GUI.Cursor("ScriptResources/crosshair_cursor", 7, 7)

(see also LM.GUI.Cursor )


Methods:

MOHO.bit(p)

MOHO.hasbit(x, p) -- Typical call: if hasbit(x, bit(3)) then ...

MOHO.setbit(x, p)

MOHO.clearbit(x, p)

MOHO.RunUpdateTable(moho)

MOHO.RandomRange(min, max)

MOHO.MultiplyColor(color, amount)

MOHO.LayerBounds(moho, layer, frame)

MOHO.SelectedPointList(mesh) -- returns a table containing a list of all the selected points in the specified mesh

MOHO.DeleteSelectedPoints(mesh)

MOHO.BuildGroupMenu(menu, mesh, baseMsg, dummyMsg)

MOHO.BuildBoneMenu(menu, skel, baseMsg, dummyMsg)

MOHO.BuildBoneChoiceMenu(menu, skel, baseMsg, exclude)

MOHO.WeldPoint(moho, layer, mesh, weldCurveID, weldPointID, view, layerMatrix)

MOHO.WeldFullCurve(moho, layer, mesh, weldCurveID, view)

MOHO.ReduceCurve(moho, mesh, curveID) -- This function Reduces points in a curve while maintaining shape

MOHO.AngleBetween(CenterVec, VecA, VecB)

MOHO.DrawToolSizeCircle(moho, view, centerVec, radius, fill)

MOHO:SplitSelectedSegments(mesh, splitCount, frame)

MOHO.SimplifyEpsilon(userValue) -- converts a user value from 0..100 to a curve simplification epsilon value