Masking is an essential technique to learn, so let’s quickly explore how to do so in Cavalry.


Related resources to this post are in the box below:

Create your base shapes in the scene. Here I have three Capsule shapes, and I want another colour to fill them coming from the left. Group your shapes together and call it Base Group.

three grey capsules

The Base Group

Duplicate Base Group by selecting it and pressing Cmd/Ctrl+D. Name it Colour Group and make sure it is on top. Give the shapes within a different fill colour or gradient. This second group will be revealed by the mask.

three coloured capsules

The Colour Group, which is to be masked in.

Now create a Rectangle layer and then add an Align behaviour — this makes the scaling of the shape originate from the direction we want, so edit the attributes of this Align layer. Set X to -1.0 and then adjust the Strength value to suit.

Next, keyframe an animation so at the end, the rectangle covers up the artwork below. Applying some Easing to this will look much better.

Now go Rectangle Shape > Layer and drag Colour Group into where it says Clipping Masks.

connecting the clipping mask

Creating the clipping mask.

Play your animation and the mask is complete!

The final export.

You can also flip this idea around so that the mask is static and the content moves into it. You often see this with titles.

—
A more advanced masking process is described in Animate a Battery Using Masks in Cavalry App by First Keyframe