Add camera animator tool to tabs (#131) authored by NorthernSeaCharting's avatar NorthernSeaCharting
...@@ -22,6 +22,7 @@ via the `Window` menu entry. ...@@ -22,6 +22,7 @@ via the `Window` menu entry.
* [Color Gradient](#color-gradient) * [Color Gradient](#color-gradient)
* [Distance Measurement](#distance-measurement) * [Distance Measurement](#distance-measurement)
* [Defined Camera Positions](#defined-camera-positions) * [Defined Camera Positions](#defined-camera-positions)
* [Camera Animator](#camera-animator)
----- -----
...@@ -253,3 +254,71 @@ and it is easier to identify the purpose of said position. This name can be chan ...@@ -253,3 +254,71 @@ and it is easier to identify the purpose of said position. This name can be chan
pencil icon on the item. pencil icon on the item.
This tool also allows deleting a previously saved position via the trash-can icon on the element. This tool also allows deleting a previously saved position via the trash-can icon on the element.
### Camera Animator
This tool allows animating the camera of the [viewer](#viewer) directly from within the application.
The tool window displays the animations already defined so that they can be edited, and
allows adding new animations. If no animations exist, the only option and the first step to create an animation is to click on the `Add New Animation` button.
This will bring up a dialog asking for a name for the animation. The chosen name should be
self-describing and also unique, although there are no restrictions on the name. After the animation
has been created (or if there were already existing animations) the rest of the animation functionality
should become available.
The following picture shows a sample view of the animation tool when an animation has been created
(in this example, the animation has been named `Animation`):
![Camera Animator Tool](../assets/imgs/tabs-camera-animator.png "Camera Animator Tool")
There are several elements within the view:
1. `Add New Animation` button
2. `Animation` list (Drop-Down)
3. `Remove Current Animation` button
4. `Player` category with a variety of control elements
5. `Animation Editor` category with:
1. `Keyframe` view / timeline
2. `Add Keyframe (Camera Point)` button
3. `Generate Keyframes (Rotation)` button
4. `Remove All KeyFrames` button
#### 2. Animation
This is a drop-down menu that keeps track of the animations that have been created. The name of the currently selected animation is displayed directly on the menu. Only the selected animation can be edited at any given time, so any option in the tool view, except for creating new animations, will only affect the selected animation.
#### 3. Remove Current Animation
Its function is to remove (i.e. delete) the animation currently selected by the [animation element](#2-animation).
#### 4. Player
This category contains various controls used to control the animation itself.
The play button in the middle of the element will start playing an animation if the necessary keyframes have been added
(see [Animation Editor](#5-animation-editor)). The resulting animation can then be previewed in the [viewer](#viewer).
To the left and right of the play button, there are buttons that move the cursor of the timeline to the left or right.
At the far left and right ends of the element are buttons that move the view to the beginning and end of the timeline, respectively.
All of these elements work only if keyframes are defined for the animation.
#### 5. Animation Editor
The first and one of the most important elements of the `Animation Editor` is the `Keyframe timeline`.
In this timeline, each keyframe defined can be viewed and moved. The keyframes can be moved by simply clicking on the desired keyframe and then dragging the mouse.
When you release the primary mouse button, the keyframe is placed at the cursor's position (if it is on the timeline).
It is also possible to remove existing keyframes by right-clicking on the keyframe. This will bring up a right-click menu. Select `Remove` from this menu to delete the keyframe.
There are two ways of adding a keyframe to the timeline differing in the type of movement performed:
`Add Keyframe (Camera Point)`:
This button adds a keyframe based on a saved camera defined in the [Defined Camera Positions](#defined-camera-positions) tool.
The keyframe will contain the position and rotation given to the camera in this tool. If this keyframe is combined with a keyframe that starts at a different position and/or rotation,
the resulting animation will move the camera from one view to the next. This is the easiest way to create complex animations which changes both
the camera's position and its orientation.
`Generate Keyframes (Rotation)`:
The second option for generating keyframes is only capable of performing camera rotations.
It provides fine-grained control over the rotation performed by the camera.
Clicking the button opens a dialog that allows you to set the amount by which the camera will rotate around the three axes, as well as the duration of the animation.
This will automatically generate the required keyframes on the timeline. The resulting animation will always perform
a full rotation with the camera (meaning the start and end rotation will be the same).
The `Remove All Keyframes` button can be used to quickly delete every keyframe that has been created for an animation.
\ No newline at end of file