Module MOHO

MOHO is the module that is a direct interface into Moho itself. The objects and functions in the MOHO module allow scripts to create and manipulate layers, vector artwork, bone systems, and more.

Notice that the LM Utilities file adds a number of methods to the MOHO module. You can find them listed here: LM Utilities.

Methods:

Name Returns Description Ver
FontPreview FontPreview(width, height) LM_FontPreview < 9.5
IsMohoPro IsMohoPro() bool Added in version 10 10.0
Localize Localize(str) char < 9.5
MeshPreview MeshPreview(width, height) LM_MeshPreview < 9.5
NewKeyframe NewKeyframe(channel) void < 9.5
Redraw Redraw() void Forces the Moho editing window to redraw itself < 9.5

Constants:

3D

Name Value Description Ver
MOHO.VECTOR3D_EXTRUDE 1 < 9.5
MOHO.VECTOR3D_INFLATE 3 < 9.5
MOHO.VECTOR3D_LATHE 2 < 9.5
MOHO.VECTOR3D_NONE 0 < 9.5

Blending modes

Name Value Description Ver
MOHO.BM_ADD 4 Additive blending < 9.5
MOHO.BM_COLOR 8 Color blending < 9.5
MOHO.BM_COLOR_BURN 13 Masked layers - turns off masking, but also the layers that would have been masked 14.2
MOHO.BM_COLOR_DODGE 11 Color Dodge 13.5.2
MOHO.BM_DIFFERENCE 5 Difference blending < 9.5
MOHO.BM_HUE 6 Hue blending < 9.5
MOHO.BM_LINEAR_DODGE 12 Masked layers - turns off masking, but also the layers that would have been masked 14.2
MOHO.BM_LUMINOSITY 9 Luminosity blending < 9.5
MOHO.BM_MULTIPLY 1 Multiply blending < 9.5
MOHO.BM_NORMAL 0 Normal blending < 9.5
MOHO.BM_OVERLAY 3 Overlay blending < 9.5
MOHO.BM_SATURATION 7 Saturation blending < 9.5
MOHO.BM_SCREEN 2 Screen blending < 9.5
MOHO.BM_SOFT_LIGHT 10 Soft Light 13.5.2

Bone binding

Name Value Description Ver
MOHO.FLEXI_BINDING 1 Flexible binding < 9.5
MOHO.REGION_BINDING 2 Region binding < 9.5

Camera following

Name Value Description Ver
MOHO.FC_CAMERA_FREE 4 Rotate on all axes as needed to face the camera < 9.5
MOHO.FC_CAMERA_X 1 Rotate on the X axis to face the camera < 9.5
MOHO.FC_CAMERA_Y 2 Rotate on the Y axis to face the camera (this is what the original option allowed) < 9.5
MOHO.FC_CAMERA_Z 3 Rotate on the Z axis to face the camera < 9.5
MOHO.FC_NONE 0 Don't rotate to face the camera < 9.5
MOHO.FC_PLANE_FREE 8 Rotate on all axes as needed to face the camera plane < 9.5
MOHO.FC_PLANE_X 5 Rotate on the X axis to face the camera plane < 9.5
MOHO.FC_PLANE_Y 6 Rotate on the Y axis to face the camera plane < 9.5
MOHO.FC_PLANE_Z 7 Rotate on the Z axis to face the camera plane < 9.5

Channel types

Name Value Description Ver
MOHO.CHANNEL_BOOL 4 A boolean (on/off) channel < 9.5
MOHO.CHANNEL_COLOR 3 A color channel < 9.5
MOHO.CHANNEL_STRING 5 A string (text) channel < 9.5
MOHO.CHANNEL_UNKNOWN 0 An unknown type of channel < 9.5
MOHO.CHANNEL_VAL 1 A single value (floating point) channel < 9.5
MOHO.CHANNEL_VEC2 2 A 2D vector channel < 9.5
MOHO.CHANNEL_VEC3 6 A 3D vector channel < 9.5

Curvature

Name Value Description Ver
MOHO.PEAKED 0 Make a corner in a curve as it passes through a point < 9.5
MOHO.PEAK_WEIGHT 9.9999997473788e-05 Added in version 14.2 14.2
MOHO.SMOOTH 0.30000001192093 Make a curve smooth as it passes through a point < 9.5

Curve type

Name Value Description Ver
MOHO.CURVE_INTERP_LEGACY 0 Legacy curve type < 9.5
MOHO.CURVE_INTERP_V7 1 Curve type from version 7 and up < 9.5

Dialog messages

Name Value Description Ver
MOHO.MSG_BASE -40000 The starting message code for use by Moho scripts < 9.5
MOHO.MSG_CANCEL -1008 The user clicked Cancel or pressed escape < 9.5
MOHO.MSG_OK -1007 The user clicked OK or pressed enter < 9.5

Gradients

Name Value Description Ver
MOHO.GRADIENT_ANGLE 3 Added in version 14.0 14.0
MOHO.GRADIENT_LINEAR 0 Added in version 14.0 14.0
MOHO.GRADIENT_RADIAL 1 Added in version 14.0 14.0
MOHO.GRADIENT_REFLECTED 2 Added in version 14.0 14.0

Group mask

Name Value Description Ver
MOHO.GROUP_MASK_HIDE_ALL 2 Turn on masking, initially hiding all sub-layers < 9.5
MOHO.GROUP_MASK_NONE 0 No masking < 9.5
MOHO.GROUP_MASK_SHOW_ALL 1 Turn on masking, initially showing all sub-layers < 9.5

Image sampling

Name Value Description Ver
MOHO.SM_BILINEAR 1 Bilinear sampling < 9.5
MOHO.SM_NEAREST 0 Nearest neighbor sampling < 9.5

Interpolation modes

Name Value Description Ver
MOHO.INTERP_BEZIER 9 Bezier interpolation < 9.5
MOHO.INTERP_BOUNCE 10 Bounce interpolation (added in version 10) 10.0
MOHO.INTERP_CYCLE 5 Cycle interpolation < 9.5
MOHO.INTERP_EASE 2 Ease in/out interpolation < 9.5
MOHO.INTERP_EASE_IN 7 Ease in interpolation < 9.5
MOHO.INTERP_EASE_OUT 8 Ease out interpolation < 9.5
MOHO.INTERP_ELASTIC 11 Elastic interpolation (added in version 10) 10.0
MOHO.INTERP_LINEAR 0 Linear interpolation < 9.5
MOHO.INTERP_NOISY 4 Noisy interpolation < 9.5
MOHO.INTERP_POSE 6 Reference an action < 9.5
MOHO.INTERP_SMOOTH 1 Smooth interpolation < 9.5
MOHO.INTERP_STEP 3 Step interpolation < 9.5

Key selected

Name Value Description Ver
MOHO.KEY_SELECTED 1 < 9.5

Layer display quality

Name Value Description Ver
MOHO.LDQ_ANTIALIASING 256 general antialiasing 9.5
MOHO.LDQ_BRUSHES 512 line brushes 9.5
MOHO.LDQ_FILLS 4 vector fills 9.5
MOHO.LDQ_GRAY_UNSELECTED 4096 gray out non-selected layers 9.5
MOHO.LDQ_IMAGES 16 images 9.5
MOHO.LDQ_IMAGES_HQ 32 high quality images 9.5
MOHO.LDQ_LABELS 2048 labels (like bone names) 9.5
MOHO.LDQ_MASKED_LAYERS 32768 masked layers - turns off masking, but also the layers that would have been masked 14.2
MOHO.LDQ_MASKING 64 masking effects 9.5
MOHO.LDQ_OUTLINES 8 vector outlines 9.5
MOHO.LDQ_SHAPE_EFFECTS 1024 fill and line effects 9.5
MOHO.LDQ_TRANSPARENCY 128 transparency 9.5
MOHO.LDQ_WIREFRAME 2 construction curves, bones, etc. 9.5

Layer Types

Name Value Description Ver
MOHO.LT_3D 8 3D layer type < 9.5
MOHO.LT_AUDIO 9 Audio layer type < 9.5
MOHO.LT_BONE 4 Bone layer type < 9.5
MOHO.LT_GROUP 3 Group layer type < 9.5
MOHO.LT_IMAGE 2 Image layer type < 9.5
MOHO.LT_NOTE 7 Note layer type < 9.5
MOHO.LT_PARTICLE 6 Particle layer type < 9.5
MOHO.LT_PATCH 10 Patch layer type < 9.5
MOHO.LT_SWITCH 5 Switch layer type < 9.5
MOHO.LT_TEXT 11 Text layer type < 9.5
MOHO.LT_UNKNOWN 0 Unkown layer type < 9.5
MOHO.LT_VECTOR 1 Vector layer type < 9.5

Layers Window Search Context

Name Value Description Ver
MOHO.LAYERWND_SEARCHCONTEXT_ALL 0 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_COMMENTSCONTAIN 9 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_COMPCONTAINS 3 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_GROUPNAMECONTAINS 2 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_KINDCONTAINS 4 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABELIS 5 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_NAMECONTAINS 1 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_TAGSCONTAIN 8 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_TIMELINEVISIBILITYIS 7 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_VISIBILITYIS 6 Added in version 12.2 12.2

Layers Window Search Context Label Color

Name Value Description Ver
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_BLUE 5 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_CADETBLUE 10 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_CORAL 11 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_GRAY 0 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_GREEN 4 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_ORANGE 2 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_PINK 8 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_PURPLE 6 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_RED 1 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_TAN 7 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_TURQUOISE 9 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_LABEL_YELLOW 3 Added in version 12.2 12.2

Layers Window Search Context Visibility

Name Value Description Ver
MOHO.LAYERWND_SEARCHCONTEXT_VIS_ISNOTVISIBLE 1 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_VIS_ISORISNOTVISIBILE 2 Added in version 12.2 12.2
MOHO.LAYERWND_SEARCHCONTEXT_VIS_ISVISIBLE 0 Added in version 12.2 12.2

Liquid Shapes

Name Value Description Ver
MOHO.COMBO_ADD 1 Added in version 14.0 14.0
MOHO.COMBO_INTERSECT 3 Added in version 14.0 14.0
MOHO.COMBO_NORMAL 0 Added in version 14.0 14.0
MOHO.COMBO_SUBTRACT 2 Added in version 14.0 14.0

Masking modes

Name Value Description Ver
MOHO.MM_ADD_MASK 2 Add to the current mask < 9.5
MOHO.MM_ADD_MASK_INVIS 4 Add to the current mask, but keep invisible < 9.5
MOHO.MM_CLEAR_ADD_MASK 6 Clear the current mask, then add this layer < 9.5
MOHO.MM_CLEAR_ADD_MASK_INVIS 7 < 9.5
MOHO.MM_MASKED 0 Normal masking < 9.5
MOHO.MM_NOTMASKED 1 No masking < 9.5
MOHO.MM_SUB_MASK 3 Subtract from current mask < 9.5
MOHO.MM_SUB_MASK_INVIS 5 Subtract from current mask, but keep invisible < 9.5

Ming

Name Value Description Ver
MOHO.MING_VIEW_CAMERA 2 < 9.5
MOHO.MING_VIEW_DIRECTOR 1 < 9.5
MOHO.MING_VIEW_PANEL 3 < 9.5

Render styles

Name Value Description Ver
MOHO.RS_FILL_BACKGROUND 2 < 9.5
MOHO.RS_FILL_BACKGROUND_SHOWTHROUGH 3 < 9.5
MOHO.RS_FILL_CHALK 7 < 9.5
MOHO.RS_FILL_CRAYON 4 < 9.5
MOHO.RS_FILL_HATCHED 5 < 9.5
MOHO.RS_FILL_NONE 1 < 9.5
MOHO.RS_FILL_NORMAL 0 < 9.5
MOHO.RS_FILL_PEN 6 < 9.5
MOHO.RS_LAYER_CUTOUT 2 < 9.5
MOHO.RS_LAYER_HEAVY_OUTLINE 1 < 9.5
MOHO.RS_LAYER_NORMAL 0 < 9.5
MOHO.RS_LINE_BLACK 2 < 9.5
MOHO.RS_LINE_CHALK 6 < 9.5
MOHO.RS_LINE_CRAYON 4 < 9.5
MOHO.RS_LINE_NONE 1 < 9.5
MOHO.RS_LINE_NORMAL 0 < 9.5
MOHO.RS_LINE_PEN 5 < 9.5
MOHO.RS_LINE_SKETCHY 3 < 9.5
MOHO.RS_POSEBM_RELATIVETOCURRENT 2 < 9.5
MOHO.RS_POSEBM_RELATIVETODEFAULT 1 < 9.5
MOHO.RS_POSEBM_STANDARD 0 < 9.5

Shading

Name Value Description Ver
MOHO.SHADING_EXTRUDED_EDGE 4 Added in version 11 11.0
MOHO.SHADING_HATCHED 2 < 9.5
MOHO.SHADING_NONE 0 < 9.5
MOHO.SHADING_TOON 1 < 9.5