Switch Layers

Switch layers are used to group together multiple layers, much like Group layers. However, switch layers have an interesting twist: only one of their sub-layers can be displayed at a time.

One reason you might want to do this is for lip-sync animation. In this case, each of the sub-layers would correspond to a mouth shape for a particular sound ("A", "O", "TH", etc.). To control which sub-layer gets displayed at which frame in an animation, you can to assign a "switch data file" to the switch layer. An excellent way to create this data file is by using a lip-sync program. Two great lip-sync programs are Magpie and Pamela. Both Magpie and Pamela can be configured to output a file that can be used directly in a Moho switch layer. (Pamela has the benefit of being available for free, and was written specifically to work with Moho.)

You can also create a switch data file by hand. To do this (or if you're configuring Magpie's custom export feature), the data file should look like this:

MohoSwitch1
1 A
2 A
10 B
22 A
37 C
40 C

The first line is a header that just tells Moho that the file is a switch data file. The following lines contain two items each: the first item is a keyframe. The second item is the name of one of the switch group's sub-layers. (In this example, the switch layer should have three sub-layers, named "A", "B", and "C".) In Magpie's export notation, the first line is the "Header text", and the two items on each following line are the "Frame" and the "MouthName". For a detailed description of how to set up Magpie for use with Moho, see the Appendix.

If you make changes to the switch data file outside of Moho, and you want to incorporate those changes, you will need to re-load the data file. To do this, double-click the Switch layer in the Layers panel, and in the dialog that opens up, go to the Switch tab, press "Source Data" and re-select the data file.

You don't have to use a data file to work with Switch layers - you can also control them manually from within Moho. To control which sub-layer is displayed at any frame in your animation, just right-click on the Switch layer in the Layers panel. A pop-up menu will appear that lets you choose which sub-layer to display.

Moho includes several sample mouth sets for doing lip-sync with Magpie or Pamela - take a look at those files to see how a switch layer should be set up. Also, check out the lip-sync tutorials included in this manual.

Switch layers have a feature that allows for "smooth" switching. To use this feature, all the sub-layers need to be Vector layers, and they need to have the same number of control points. Then, when switching, Moho can smoothly transition between sub-layers. To enable this feature, turn on "Interpolate sub-layers" in the Switch layer's properties dialog. An example of using this feature is included in one of the mouth sets mentioned above.

Finally, switch layers can be set up with skeletons, just like bone layers. More accurately, a switch layer is a bone layer, just a specialized one. If you add bones to a switch layer, you can use them (for example) to change the shape of a mouth as it speaks, bending it into a smile or a frown.

Don't feel restricted to lip-sync animation with switch layers. They have a lot of potential uses (controlling eyes, syncing to music & sound effects, switching between different hand gestures, etc.) - get creative!