MOHO Constants

The following constants are defined in the MOHO namespace. To use one of these constants, be sure to prepend

MOHO.

to the constant's name. For example,

MOHO.CHANNEL_COLOR

is valid, while

CHANNEL_COLOR

is not complete.

Message Codes

The following constants are used when setting up messages for user interface elements. Any messages you use in your custom controls should be greater than or equal to the MSG_BASE constant so as not to interfere with other GUI elements in Moho. For example you could use the following messages in a dialog you create: MSG_BASE, MSG_BASE + 1, MSG_BASE + 2, etc.

MSG_BASE

The starting message code for use by Moho scripts

Channel Types

The following constants are used to describe the different types of animation channels.

CHANNEL_UNKNOWN

An unknown type of channel

CHANNEL_VAL

A single value (floating point) channel

CHANNEL_VEC2

A 2D vector channel

CHANNEL_VEC3

A 3D vector channel

CHANNEL_COLOR

A color channel

CHANNEL_BOOL

A boolean (on/off) channel

CHANNEL_STRING

A string (text) channel

Interpolation Modes

The following constants are used to define the interpolation style between keyframes.

INTERP_LINEAR

Linear interpolation

INTERP_SMOOTH

Smooth interpolation

INTERP_EASE

Ease in/out interpolation

INTERP_STEP

Step interpolation

INTERP_NOISY

Noisy interpolation

INTERP_CYCLE

Cycle interpolation

INTERP_POSE

Reference an action

Layer Types

The following constants identify the type of a Moho layer.

LT_UNKNOWN

Unkown layer type

LT_VECTOR

Vector layer type

LT_IMAGE

Image layer type

LT_GROUP

Group layer type

LT_BONE

Bone layer type

LT_SWITCH

Switch layer type

LT_PARTICLE

Particle layer type

LT_NOTE

Note layer type

LT_3D

3D layer type

Blending Modes

The following constants define the blending mode for a Moho layer.

BM_NORMAL

Normal blending

BM_MULTIPLY

Multiply blending

BM_SCREEN

Screen blending

BM_OVERLAY

Overlay blending

BM_ADD

Additive blending

BM_DIFFERENCE

Difference blending

BM_HUE

Hue blending

BM_SATURATION

Saturation blending

BM_COLOR

Color blending

BM_LUMINOSITY

Luminosity blending

Masking Modes

The following constants are used to define a layer's masking mode.

MM_MASKED

Normal masking

MM_NOTMASKED

No masking

MM_ADD_MASK

Add to the current mask

MM_SUB_MASK

Subtract from current mask

MM_ADD_MASK_INVIS

Add to the current mask, but keep invisible

MM_SUB_MASK_INVIS

Subtract from current mask, but keep invisible

MM_CLEAR_ADD_MASK

Clear the current mask, then add this layer

Group Masking

The following constants are used to define the masking that happens within a group.

GROUP_MASK_NONE

No masking

GROUP_MASK_SHOW_ALL

Turn on masking, initially showing all sub-layers

GROUP_MASK_HIDE_ALL

Turn on masking, initially hiding all sub-layers

Curvature

When setting the curvature through a vector point, the following constants can be used to set standard smooth or sharp corners.

SMOOTH

Make a curve smooth as it passes through a point

PEAKED

Make a corner in a curve as it passes through a point

Bone Binding

For the default binding style, a bone layer can use either flexible or region binding. The following constants define which mode a bone layer will use.

FLEXI_BINDING

Flexible binding

REGION_BINDING

Region binding

Animation Channels

Each type of animation channel is identified by a unique code.

CHANNEL_LAYER_T

layer translation

CHANNEL_LAYER_S

layer scale

CHANNEL_LAYER_ROT_Z

layer Z rotation

CHANNEL_LAYER_ROT_Y

layer Y rotation

CHANNEL_LAYER_ROT_X

layer X rotation

CHANNEL_LAYER_FLIP_H

layer horizontal flip

CHANNEL_LAYER_FLIP_V

layer vertical flip

CHANNEL_LAYER_SH

layer shear

CHANNEL_LAYER_VIS

layer visibility

CHANNEL_LAYER_BLUR

layer blur

CHANNEL_LAYER_ALPHA

layer alpha

CHANNEL_LAYER_SHADOW

layer shadow

CHANNEL_LAYER_SHADING

layer shading

CHANNEL_LAYER_MB

layer motion blur

CHANNEL_POINT

point motion

CHANNEL_POINT_SEL

point motion (selected points)

CHANNEL_CURVE

curvature

CHANNEL_CURVE_SEL

curvature (selected points)

CHANNEL_FILL

fill color

CHANNEL_FILL_SEL

fill color (selected shape)

CHANNEL_LINE

line color

CHANNEL_LINE_SEL

line color (selected shape)

CHANNEL_BONE

bone rotation

CHANNEL_BONE_SEL

bone rotation (selected bone)

CHANNEL_BONE_T

bone translation

CHANNEL_BONE_SEL_T

bone translation (selected bone)

CHANNEL_BONE_S

bone scale

CHANNEL_BONE_SEL_S

bone scale (selected bone)

CHANNEL_BONE_LOCK

bone lock

CHANNEL_BONE_SEL_LOCK

bone lock (selected bone)

CHANNEL_SWITCH

switch setting

CHANNEL_PARTICLE

particles on/off

CHANNEL_CAMERA_TRACK

camera track

CHANNEL_CAMERA_ZOOM

camera zoom

CHANNEL_CAMERA_ROLL

camera roll

CHANNEL_CAMERA_PANTILT

camera pan/tilt

/*** Anim Channels ***/
 
#define CHANNEL_UNKNOWN
#define CHANNEL_VAL
#define CHANNEL_VEC2
#define CHANNEL_COLOR
#define CHANNEL_BOOL
#define CHANNEL_STRING
#define CHANNEL_VEC3
 
#define INTERP_LINEAR
#define INTERP_SMOOTH
#define INTERP_EASE
#define INTERP_STEP
#define INTERP_NOISY
#define INTERP_CYCLE
#define INTERP_POSE
#define INTERP_EASE_IN
#define INTERP_EASE_OUT
#define INTERP_BEZIER
 
#define KEY_SELECTED
 
/*** Moho Layer ***/
 
#define LT_UNKNOWN
#define LT_VECTOR
#define LT_IMAGE
#define LT_GROUP
#define LT_BONE
#define LT_SWITCH
#define LT_PARTICLE
#define LT_NOTE
#define LT_3D
#define LT_AUDIO
#define LT_PATCH
#define LT_TEXT
 
#define LM_MASKED @ MM_MASKED
#define LM_NOTMASKED @ MM_NOTMASKED
#define LM_ADD_MASK @ MM_ADD_MASK
#define LM_SUB_MASK @ MM_SUB_MASK
#define LM_ADD_MASK_INVIS @ MM_ADD_MASK_INVIS
#define LM_SUB_MASK_INVIS @ MM_SUB_MASK_INVIS
#define LM_CLEAR_ADD_MASK @ MM_CLEAR_ADD_MASK
#define LM_CLEAR_ADD_MASK_INVIS @ MM_CLEAR_ADD_MASK_INVIS
 
#define LM_BM_NORMAL @ BM_NORMAL
#define LM_BM_MULTIPLY @ BM_MULTIPLY
#define LM_BM_SCREEN @ BM_SCREEN
#define LM_BM_OVERLAY @ BM_OVERLAY
#define LM_BM_ADD @ BM_ADD
#define LM_BM_DIFFERENCE @ BM_DIFFERENCE
#define LM_BM_HUE @ BM_HUE
#define LM_BM_SATURATION @ BM_SATURATION
#define LM_BM_COLOR @ BM_COLOR
#define LM_BM_LUMINOSITY @ BM_LUMINOSITY
 
// different modes for a layer to face the camera
#define LM_FC_NONE @ FC_NONE // don't rotate to face the camera
#define LM_FC_CAMERA_X @ FC_CAMERA_X // rotate on the X axis to face the camera
#define LM_FC_CAMERA_Y @ FC_CAMERA_Y // rotate on the Y axis to face the camera (this is what the original option allowed)
#define LM_FC_CAMERA_Z @ FC_CAMERA_Z // rotate on the Z axis to face the camera
#define LM_FC_CAMERA_FREE @ FC_CAMERA_FREE // rotate on all axes as needed to face the camera
#define LM_FC_PLANE_X @ FC_PLANE_X // rotate on the X axis to face the camera plane
#define LM_FC_PLANE_Y @ FC_PLANE_Y // rotate on the Y axis to face the camera plane
#define LM_FC_PLANE_Z @ FC_PLANE_Z // rotate on the Z axis to face the camera plane
#define LM_FC_PLANE_FREE @ FC_PLANE_FREE // rotate on all axes as needed to face the camera plane
 
#define LM_RS_FILL_NORMAL @ RS_FILL_NORMAL
#define LM_RS_FILL_NONE @ RS_FILL_NONE
#define LM_RS_FILL_BACKGROUND @ RS_FILL_BACKGROUND
#define LM_RS_FILL_BACKGROUND_SHOWTHROUGH @ RS_FILL_BACKGROUND_SHOWTHROUGH
#define LM_RS_FILL_CRAYON @ RS_FILL_CRAYON
#define LM_RS_FILL_HATCHED @ RS_FILL_HATCHED
#define LM_RS_FILL_PEN @ RS_FILL_PEN
#define LM_RS_FILL_CHALK @ RS_FILL_CHALK
 
#define LM_RS_LINE_NORMAL @ RS_LINE_NORMAL
#define LM_RS_LINE_NONE @ RS_LINE_NONE
#define LM_RS_LINE_BLACK @ RS_LINE_BLACK
#define LM_RS_LINE_SKETCHY @ RS_LINE_SKETCHY
#define LM_RS_LINE_CRAYON @ RS_LINE_CRAYON
#define LM_RS_LINE_PEN @ RS_LINE_PEN
#define LM_RS_LINE_CHALK @ RS_LINE_CHALK
 
#define LM_RS_LAYER_NORMAL @ RS_LAYER_NORMAL
#define LM_RS_LAYER_HEAVY_OUTLINE @ RS_LAYER_HEAVY_OUTLINE
#define LM_RS_LAYER_CUTOUT @ RS_LAYER_CUTOUT
 
#define LM_POSEBM_STANDARD @ RS_POSEBM_STANDARD
#define LM_POSEBM_RELATIVETODEFAULT @ RS_POSEBM_RELATIVETODEFAULT
#define LM_POSEBM_RELATIVETOCURRENT @ RS_POSEBM_RELATIVETOCURRENT
 
/*** Mesh Layer ***/
 
#define Mc_VECTOR3D_NONE @ VECTOR3D_NONE
#define Mc_VECTOR3D_EXTRUDE @ VECTOR3D_EXTRUDE
#define Mc_VECTOR3D_LATHE @ VECTOR3D_LATHE
#define Mc_VECTOR3D_INFLATE @ VECTOR3D_INFLATE
 
/*** Image Layer ***/
 
#define LM_NEAREST_SAMP @ SM_NEAREST
#define LM_BILINEAR_SAMP @ SM_BILINEAR
 
/*** Group Layer ***/
 
#define GROUP_MASK_NONE
#define GROUP_MASK_SHOW_ALL
#define GROUP_MASK_HIDE_ALL
 
/*** Mesh3D Layer ***/
 
#define Mc_SHADING_NONE @ SHADING_NONE
#define Mc_SHADING_TOON @ SHADING_TOON
#define Mc_SHADING_HATCHED @ SHADING_HATCHED
 
/*** Vector Mesh ***/
 
#define Mc_DEFAULT_CURVATURE @ SMOOTH
#define Mc_PEAK_CURVATURE @ PEAKED
#define Mc_CURVE_INTERP_LEGACY @ CURVE_INTERP_LEGACY
#define Mc_CURVE_INTERP_V7 @ CURVE_INTERP_V7
 
/*** Skeletons and Bones ***/
 
#define Mc_FLEXI_BINDING @ FLEXI_BINDING
#define Mc_REGION_BINDING @ REGION_BINDING