1.12. Virtual Camera

The virtual camera makes it possible to easily create camera pan, zoom and rotation effects in your animation without having to move all the figures. Instead you move a camera viewport, which when in its default position is aligned with the boundary of the animation. What you see when you play or export the animation is the area contained within the camera viewport, but transformed back to the animation area. Shrinking the camera viewport will therefore create a zoomed in effect, while moving it to the right will pan animation objects to the left. Use the preview frame feature (Ctrl+P) to quickly see how the frame will look from the perspective of the camera.
Note that key frame thumbnails shown in the timeline are from the perspective of the camera so that they show what you would see when playing the animation.
The camera viewport positioned in the frame editing canvas (left) and the result when the frame is previewed (right)
The grey onion skin of the camera viewport from the previous frame is visible in its default position (left)

Showing / Hiding the Camera Viewport

The camera viewport is not visible unless the 'Show Virtual Camera' option is selected in the View menu. This option is stored so that it is persists after closing and re-opening Pivot Animator. The keyboard shortcut Ctrl+K can be used to quickly toggle the option on or off.
The camera viewport will always be shown when editing a key frame in which the camera is not in its default position, even if 'Show Virtual Camera' is unselected, although the viewport will be faded out and you won't be able to position it.

Positioning the Camera Viewport

The camera viewport can be moved, scaled or rotated by dragging the square handles at the corners of the rectangle. The center of the viewport is shown with a red cross. Note that rotation and scaling of the viewport is always around the center. The aspect ratio of the viewport always matches that of the animation.
Moving, rotating and scaling of the camera viewport by dragging the square handles.
Either of the indicated handles can be used for scaling (right).
The camera viewport can be restored to its default position (aligned with the animation area) by clicking 'Reset Virtual Camera' in the View menu or by using the keyboard shortcut Ctrl+Alt+K. This is similar to the 'Reset Figure Pose to Default' option in the Edit menu (Ctrl+Alt+P).
The camera viewport can also be copied by selecting 'Copy Virtual Camera' from the View menu or by using the keyboard shortcut F11. The viewport can then be copied to another frame or another animation by selecting 'Paste Virtual Camera' from the View menu or by using F12.
The camera viewport can also be aligned with the current Canvas pan and zoom by selecting 'Align Virtual Camera with Canvas' in the View menu or by using the keyboard shortcut F10. This will result in the camera viewport being fitted to the current canvas area. This can sometimes be easier than moving the viewport with the handles because the canvas can be navigated more easily using the mouse wheel. It should be noted that any existing rotation of the camera viewport will be kept. If you would like to align the virtual camera with the canvas area and reset the the rotation then use the Reset Virtual Camera option first (Ctrl+Alt+K). This feature can also be applied to multiple selected frames.
The current pose of the camera is shown in the status bar at the bottom of the main window when 'Show Virtual Camera' is selected.
  The camera viewport can also be positioned accurately by using the arrow keys, while the mouse cursor is positioned over a handle, to move that handle in 1 pixel increments. The cursor won't move with the handle, but the arrow keys will continue to move that handle until the cursor is moved. Even finer positioning using the arrow keys can be achieved by first zooming in. For example, zooming to 400% and pressing an arrow key while the cursor is over the orange handle is equivalent to moving the viewport by a quarter pixel.
The camera viewport can be moved only horizontally or only vertically by holding the Ctrl key while starting to dragging the orange position handle. The direction is determined by the initial drag direction.
  The camera viewport can be aligned to match its pose in the previous frame using the L key (or L+Shift to align to the next frame) while the cursor is positioned over one of the camera handles. Using the L key over the orange handle will align the center of the viewport without changing rotation or scale. Likewise, using the L key over the rotation or scale handles will change only rotation or scale without affecting anything else.
  The camera viewport can also be set to any set of position values using 'Input Camera Values' in the Edit menu, which will appear after clicking a camera handle. You can also use the 'I' key while the cursor is over a camera handle. This works similar to the input for figure positioning and allows you to set the angle, scale and position to specific values. When scale is 1, the camera viewport matches the animation dimensions. The position is relative to the center of the camera viewport.
Any movement of the camera viewport can be undone in the usual way by clicking 'Undo Move Camera' in the Edit menu or using the keyboard shortcut Ctrl+Z.

Positioning in Multiple Frames

The camera viewport pose can be updated in multiple frames at once. Firstly select the frames in the timeline and then move, rotate or scale the camera by dragging the handles. A message box will appear asking if you want to apply the change to all selected frames. The changes are applied relative to the current camera pose in each frame, so they will be offset by the same amount that the camera was offset in the frame being edited. This means that if the camera poses are all different in the selected frames, then they will remain all different after the update, but will all be offset from their previous poses. Pasting the camera or resetting the camera can also be applied to multiple selected frames.

Centering the Camera to the Selected Figures

The camera viewport can be set to align with the selected figure or figures in the frame. This option is available from the View menu or by using the keyboard shortcut F8. The center of the camera viewport will then align with the center of the smallest bounding box containing the figures. The rotation and scale of the camera will be unchanged. This can also be applied to multiple frames, which makes it possible to set the camera to follow a figure or group of figures in a sequence of frames, as long as the figure IDs are consistent throughout the selected frames.
Note that it may be the case that you would like the camera to follow a figure but offset instead of centered over it. This can be done by firstly centering over the figure in multiple frames and then moving the camera viewport and applying that offset to the frames.

Applying the Camera to the Figures

This feature can be accessed from the View menu or by using the keyboard shortcut F9. The figures in the frame will be transformed so that they appear as they do from the virtual camera when the animation is played. The virtual camera will also be reset to default. The frame should look the same when the animation is played or the frame is previewed. However, this is not the case if the frame uses a gradient or image background. This is because backgrounds cannot be moved. It is recommended to use only solid colour backgrounds when using this feature. This feature can also be applied to multiple selected frames.
A possible use for this feature is if you would like to include static elements such as subtitles to your animation that includes camera movements. You would first create the animation with camera movements and then apply the camera to all the frames containing the subtitles to reset the camera without altering the appearance of the frame. You can lastly add the subtitle text object to the frames, using multi-frame selection for efficiency.

Camera Inbetweening

The camera can be inbetweened in the same way as figures to easily create smooth pan or zoom effects with two or more key frames. Auto-easing can also be used for smoother transitions between key frames and to create acceleration effects.
Note that when inbetweening between different camera scales the objects in the camera view can appear to speed up or slow down. This is because a change in scale has a bigger effect when the camera viewport is smaller compared to when it is larger. However, auto-easing can be used to prevent this effect. For example, when zooming in from a scale of 1 to 0.25 you can use 3 key frames instead of 2 and set the scale to 0.5 for the middle key frame. The scale will then change by a constant multiple (0.5) between key frames so that objects in the camera view increase size at a constant rate. If changing the camera position at the same time, then the position must also be set with non equal offsets.
Creating a pan and zoom sequence using 2 key frames (left) and 3 key frames with auto-easing (right)
The camera scales on the left are 1 and 0.25. The scales on the right are 1, 0.5 and 0.25
The inbetweens values are 14, -1 on the left and 7, 7, -1 on the right
The resulting looping animations showing the acceleration effect with 2 key frames (left)
and constant speed with 3 key frames (right)

Including Areas Outside the Animation

It's possible to position the camera viewport however you like, even to include areas that are outside the animation area. For example, moving or rotating the viewport from its default position will include areas outside the animation area (apart from a rotation of 180°). How these areas look when the animation is played or exported will depend on the type of background used.
Solid backgrounds, such as the default white background, will fill areas outside the animation area with the same solid colour.
Gradient backgrounds will extend the gradient to fill areas outside the animation area.
Image backgrounds will fill areas outside the image with solid black. If the aspect ratio of the image is not equal to the aspect ratio of the animation then some portion of the image will be visible to the right or bottom of the animation area.
Note that when inbetweening the camera viewport there may be cases in which the viewport is fully inside the animation area in all key frames but contains areas outside the animation in the generated inbetween frames.