A short post about manipulating the rotation point of shape layers!


Related resources to this post are in the box below:

As a demonstration, draw a polygon layer — i’m just going for a square here. Now as you may expect, changing the value for Rectangle Shape > Rotation off the bat, will turn the shape around its centre point. Entering a positive angle turns the shape anti-clockwise, and a negative angle turns it clockwise.

But, how do we set a custom rotation point? There’s actually a dedicated tool for this in Cavalry, called the Pivot Tool. As a keyboard shortcut, you can press y to access it.

pivot point examples in cavalry

Here the pivot point is in the default position (left) and rotated on a corner node (right).

Using this tool, you can drag the anchor icon from the centre of the shape to anywhere you please. Note that by dragging near one of the rectangle’s nine node points, the tool will snap to them; which means you can easily rotate from a corner or mid-point.

You can also go for precision and forgo the tool entirely, by going to Rectangle Shape > Pivot and manually inputting x and y values.

Rotating multiple layers

Let’s say that we wish to have a few shape layers rotating around a single point. I’ve found that the easiest method to achieve this is to use a Null layer.

Draw your initial shapes and then press Cmd/Ctrl+. and search for ‘null’. Double-click on the resulting option which will add a new Null layer to the scene.

A Null is not visually present in your exports, but they can be used to influence and simplify the animation of multiple layers.

Going to your layer stack, you need to drag the shapes you have drawn into the Null layer. You will know if they have been nested as the layer names will have an indentation compared to their parent layer (in this case, the Null).

null rotation layer stack

Here you can see the indented layer names of the child layers. On a Mac your cursor will change to a green circle containing a white plus symbol, when you are dragging to the right point.

Double click on the Null layer to edit the attributes, and go Null > Rotation and you will notice that upon manipulating this property, the child shapes will rotate together, around the same point.

Two shape layers orbiting a null.

—
A useful video to watch is Animation Systems in Cavalry by Cavalry