The MohoLayer class is the base class for all Moho layer types. All actual layers in Moho are sub-classes of MohoLayer (vector layers, image layers, group layers, etc.), but the MohoLayer class provides some basic properties that they all have in common.
Member Functions
int LayerType()
Use this function to find out what type of layer you're dealing with. See the layer type constants.
Return value (int): a layer type identifier
bool IsGroupType()
Test whether a layer is a group layer, or sub-type of group layer (bone, particle, or switch).
Return value (bool): true if a group sub-type, otherwise false
bool IsBoneType()
Test whether a layer is a bone layer, or sub-type of bone layer (switch).
Return value (bool): true if a bone sub-type, otherwise false
string Name()
Returns the name of the layer.
Return value (string): name of the layer
void SetName(name)
Sets a layer's name.
Return value: none
name (string): the new name
void ShowConstructionCurves(b)
Toggle whether to display construction curves for this layer.
Return value: none
b (bool): true to display construction curves, false to hide them
void UpdateCurFrame(extended)
Recalculates animated properties for this layer. Use this when you've made a lot fo changes that need to be re-processed.
Return value: none
extended (bool): perform an extended update
LM_Vector2 Origin()
Get the origin point of the layer.
Return value (LM_Vector2): the origin point of the layer
void SetOrigin(origin)
Set the origin point of the layer.
Return value: none
origin (LM_Vector2): the origin point of the layer
GroupLayer Parent()
Get the layer's parent layer (if any).
Return value (GroupLayer): the layer's parent (nil if the layer is a top-level layer with no parent)
int LayerParentBone()
Get the id number of the layer's controlling parent bone.
Return value (int): id number of bone, -1 for none, or -2 for flexi-binding
void SetLayerParentBone(id)
Set the id number of the layer's controlling parent bone.
Return value: none
id (int): id number of bone, -1 for none, or -2 for flexi-binding
void DeleteParentBone(boneID)
Call this function before deleting a bone in a parent bone layer.
Return value: none
boneID (int): the id of the bone you're about to delete
bool IsRenderOnly()
Return value (bool):
void SetRenderOnly(b)
Return value: none
b (bool):
bool IsEditOnly()
Return value (bool):
void SetEditOnly(b)
Return value: none
b (bool):
bool HasScaleCompensation()
Return value (bool):
void SetScaleCompensation(b)
Return value: none
b (bool):
bool DoesRotateToFollow()
Return value (bool):
void SetRotateToFollow(b)
Return value: none
b (bool):
bool DoesFaceCamera()
Return value (bool):
void SetFaceCamera(b)
Return value: none
b (bool):
int MaskingMode()
Get the layer's masking mode. See the masking mode constants.
Return value (int): the layer's masking mode
void SetMaskingMode(mode)
Set the layer's masking mode. See the masking mode constants.
Return value: none
mode (int): the layer's masking mode
int BlendingMode()
Get the layer's blending mode. See the blending mode constants.
Return value (int): the layer's blending mode
void SetBlendingMode(mode)
Set the layer's blending mode. See the blending mode constants.
Return value: none
mode (int): the layer's blending mode
bool IsImmuneToCamera()
Return value (bool):
void SetImmuneToCamera(b)
Return value: none
b (bool):
bool IsImmuneToDof()
Tests whether the layer is immune to depth of field effects.
Return value (bool):
void SetImmuneToDof(b)
Sets whether the layer is immune to depth of field effects.
Return value: none
b (bool):
string HsvImage()
Returns a file path to the layer's HSV modifier image.
Return value (string): file path
void SetHsvImage()
Sets the file path to the layer's HSV modifier image.
Return value: none
path (string): file path
void GetLayerTransform()
Gets the layer's transformation at a given frame. The layer transform includes things like layer scale, rotation, and translation.
Return value: none
frame (int): frame number
matrix (LM_Matrix): transform matrix to fill in
doc (MohoDoc): the document object
void GetFullTransform()
Gets the layer's complete transformation at a given frame, including the effects of its parent layers.
Return value: none
frame (int): frame number
matrix (LM_Matrix): transform matrix to fill in
doc (MohoDoc): the document object
void GetParentTransform()
Gets the parent layer's transformation at a given frame.
Return value: none
frame (int): frame number
matrix (LM_Matrix): transform matrix to fill in
doc (MohoDoc): the document object
string CurrentAction()
Returns the name of the current action being edited.
Return value (string): the name of the current action
void ActivateAction(name)
Activates an action for editing. If the named action does not exist, it is first created.
Return value: none
name (string): the name of the action to edit
void InsertAction(name, frame, byReference)
Inserts an action into the main timeline.
Return value: none
name (string): the name of the action to insert
frame (int): which frame to insert it at
byReference (bool): true if by reference, false if by copy
Member Variables
fTranslation (AnimVec3)
the layer's translation animation channel
fScale (AnimVec3)
the layer's scale animation channel
fRotationX (AnimVal)
the layer's X rotation animation channel
fRotationY (AnimVal)
the layer's Y rotation animation channel
fRotationZ (AnimVal)
the layer's Z rotation animation channel
fFlipH (AnimBool)
the layer's horizontal flip animation channel
fFlipV (AnimBool)
the layer's vertical flip animation channel
fShear (AnimVec3)
the layer's shear animation channel
fVisibility (AnimBool)
the layer's visibility animation channel
fBlur (AnimVal)
the layer's blur animation channel
fAlpha (AnimVal)
the layer's alpha animation channel
fLayerShadow (AnimBool)
the layer's shadow on/off animation channel
fShadowAngle (AnimVal)
fShadowOffset (AnimVal)
fShadowBlur (AnimVal)
fShadowExpansion (AnimVal)
fShadowColor (AnimColor)
fLayerShading (AnimBool)
the layer's shading on/off animation channel
fShadingAngle (AnimVal)
fShadingOffset (AnimVal)
fShadingBlur (AnimVal)
fShadingContraction (AnimVal)
fShadingColor (AnimColor)
fMotionBlur (AnimBool)
the layer's motion blur on/off animation channel
fMotionBlurFrames (AnimVal)
fMotionBlurSkip (AnimVal)
fMotionBlurAlphaStart (AnimVal)
fMotionBlurAlphaEnd (AnimVal)
fMotionBlurRadius (AnimVal)