The Rendering > RotoTracking effect
The RotoTracking effect is first of all a cut-out effect like the Chromakey, Colorkey or Lumakey effect. It can also be used to animate drawings in ways comparable to those you can encounter in vector based animation softwares.
Here is the principle of this effect : the RotoTracking use one or several closed splines (called B-splines) and allows you to change their shape in time, thanks to the keyframe system of the FX Stack.
Once the effect is applied, the area inside or outside the spline becomes transparent.
• Two examples
This effect is very useful when the other keying effects are unable to cut-out a picture or a movie sequence properly.
On the picture below, we see a red squirrel walking on red and brown leaves. As the leaves colors are very close to the squirrel color, the common keying effects will not allow you to cut-out the squirrel correctly. In that case, it is advised to use the rototracking effect
RotoTracking splineApplied result
The RotoTracking also allows you to draw and animate quickly. The control points of the spline can evolve softly from a position to another one. As a consequence, the shape of the whole spline will evolve in time too.
In the FX_Inlay_Texture_example_2 project shown below, a dolphin has been drawn with the rototracking effect.
The control points are colored in red and the B-spline itself is colored in yellow.
Every key dot can be animated in time. So it is for the whole spline and thus the dolphin.
He can for example move his tail to swim.
RotoTracking B-splines created for the first and the last image of the animation layer.
Resulting pictures once the effect is applied.
Resulting animation once the effect is played.
Here is the main difference between the rototracking and a selection created with the main panel tools : Our B-splines can evolve and change their shape in time.
• The control panel
Let's now study the control panel in detail : here is the control panel as it appears when you add the Rototracking effect in the FX-stack. (see below)
At the top of the panel, the Spline popup menu is used to create, rename, duplicate or delete B-splines.
Once a first B-spline is created, some new buttons and menus appear. (The Point and Blending Mode menus)
The effect can use several B-splines at the same time.
The header of the menu contains the name of the B-spline for which the options are displayed in the panel.
Enable the HUD and check the Preview boxes of your FX-stack. Once the first point is drawn on the project window, new parameters related to the points drawn in the screen appear (position, edge, sharp).
To close the spline that you just began to draw, you only have to click on the first point displayed on the screen.
Do you remember Bézier splines ? We encountered them in lesson 2 when we studied the drawing tools. B-splines and Bézier splines are mathematically linked.
Try not to confuse those two kind of splines : Bézier splines go through their control points while B-splines don't.
• Managing the opacity
Once the B-spline is closed, the opacity of the pixel area outside the spline becomes transparent after applying the effect. The pixel area inside the spline stay the same.
This being the case, the two opacity parameters allows you to modify the opacity of any of those two areas.
The numeric field on the top of the control panel allows you to set the opacity of the pixel area inside the B-spline. The numeric field on the bottom of the panel allows you to set the opacity of the pixel area outside the B-spline.
The invert button allows you to invert the effect : the area of pixels outside the B-spline will remain unchanged while the area of pixels inside the B-spline will become transparent.
NormalWith the invert button checked
First opacity parameters set to 50%Second opacity parameters set to 50%
• Let's now study the icons under the spline popup menu.
From left to right :
The first icon allows you to place the control points of your B-spline at your convenience.
This icon is selected by default each time you create a new B-spline.
You only have to use the left mouse button on the project window to lay your control points.
Once a control point is created, the point menu displays its number and its coordinates. (see below)
If you need to re-open a closed B-spline, you only have to select the icon again.
This second icon allows you to move a control point interactively on the project window. (don't forget to display the HUD).
To do this, just click and drag the control point. This may also be done by using the numeric fields and associated mini-sliders shown above.
It is also possible to move several points at the same time :
To do this, simply use your left mouse button to draw a rectangle while pressing the [Ctrl] key. You will then be able to move at the same time all the points located in the rectangular area.
By clicking on the little padlock buttons, it is possible to « lock » your control points in space so that they cannot be moved along the axis (or axes) of your choice. This enables, in particular, avoiding untimely movement.
The locked points may be subject to FX Stack keyframes and intermediate points in time may be created from the locked points.
The third icon allows you to add new control points on the B-spline.
Once activated, you will note that if you drag your mouse near the B-spline, a small cross appears. (see below) It means that you can create a new control point.
The fourth icon allows you to delete the control points of your B-spline. You only need to use the left mouse button on the point of your choice to do so.
The fifth icon allows you to modify the value of the edge of a point.
To do so, you only have to select this icon and drag'n drop a control point of your spline.
You can also use the numerical field of the edge parameter. (see below)
Modifying the edge parameter for a control point allows you to change the frontier that the B-spline define.
An opacity gradient will follow the B-spline (see below). This is very convenient to cut a picture more softly (as the tail of the squirrel below)
The positive values create an opacity gradient outside the B-spline and the negatives values create opacity gradients inside the B-spline.
Edge parameter equal to 0Edge parameter negativeEdge parameter positive
On the opposite screenshot, the edge parameters was used to cut out the tail of the squirrel.
Once the edge parameter is changed, the HUD shows a blue spline. The opacity gradient is located between the yellow and the blue spline and follow the shape of those two splines.
The sixth icon allows you to adjust the sharpness of each point. (the numeric field and the associated mini-slider can replace the interactive HUD)
Modify the sharpness is like changing the distance between the spline and the selected control point.
A value of 100 for the sharpness parameter will turn the spline into a pointed one.
The B-spline will follow the angle given by the vertex. (see below)
This allows you to adjust the curvature of the B-spline
On the left picture, the sharpness parameter of the right-top point of the spline is set to 0.
On the right picture, the sharpness parameter of the right-top point of the spline is set to 100.
The seventh and last icon turn on the display of a control box which allows you to do a lot of modifications directly on the project window (see below)
You may contract, stretch, rotate or translate the current B-spline as a whole by using the handles of the box. (don't forget to activate the HUD)
You can drag and drop the points to translate the whole B-Spline
• The master controllers
You could find annoying to create FX Stack keyframes for every spline and every point of a spline. (for example, a five points spline need almost 30 FX Stack keyframes to be created if you want to move it from a place to another one.)
That's the reason why the FX Stack keyframe controllers have been added in the panel. They are black encircled in the picture opposite.
The FX Stack keyframe controller near the spline popup menu allows you to create a FX Stack keyframe for each parameter of the spline : points, opacity, ... by using only one mouse click.
The FX Stack keyframe controller near the points popup menu allows you to create a FX Stack keyframe for each parameter of the point : position, sharpness, edge, ... by using only one mouse click.
• Working with several B-splines
It is possible to use several B-splines.
To create a new B-spline, proceed in this way :
- Select New B-spline in the popup menu
- Display the HUD and check the preview box
- Add control points on the screen and close the B-spline.
- Set the position, edge and sharpness parameters for each points.
• The blending modes
The last popup menu of the RotoTracking effect panel is called blending mode. It is useful when you manage more than one B-spline
If you use two splines (this is also true for more than two splines) :
- The add mode will add the opacity of the two area of pixels.
- The sub mode will subtract the opacity of the current shape from the second one.
In those two last examples, the edge and sharpness parameters are taken into account.
• Some ideas to make your B-spline move on the screen
Let's take a common B-spline.
The coordinates x and y of a control point define its position on the screen.
Three options are available in the interpolation menu : spline, linear or polynomial. This affects the path of the control point in time.
If you use the tool menu, its coordinates may follow the path of your choice. You should of course use the pixel recorder, pixel tracker, etc ... which constitute an excellent way to manage the movement of control points in time.
Once the effect is applied, its shape and parameters will go from one location to another one.