Roto Node
The Roto node can be used to generate a spline-based mask to assist with operations such as automatic feature tracking. After creating a Roto node, it can be attached to any other node that has a purple indicator on an input label.
Connecting a mask node in such a manner will activate the mask on the clip to which it has been attached. One Mask node can be connected to multiple indicators if required, with the same mask activated on each clip.
Masks files can also be imported from third-party applications such as SilhouetteFXTM and Mocha ProTM.
Usage
The Roto node supports two different types of splines: Bezier splines are used for the Bezier Roto, Rectangle, Ellipse and Lasso mask types. X-Splines are used for the X-Spline Roto and Colour X-Spline masks.
Colour X-Spline masks are similar to X-Spline Roto masks, but the actual mask boundary is defined by the colour differences between the inner and outer roto edges: Pixels that are more similar to the inner edge are assumed to be part of the object, and pixels that are more similar to the outer edge are assumed to be part of the background.
The image below shows an example where the actor's outline has been painted using using the Colour X-Spline and converted into an X-Spline mask:
(Footage courtesy of http://www.hollywoodcamerawork.com/green-screen-plates.html)
Each Roto node can contain several top-level mask, each of which can have several child masks. Each child mask can be animated independently and combined with the top-level mask using a Boolean operation.
Masks can be moved in the list using drag-and-drop to change their parenting.
Inner and Outer Splines
Both Bezier and X-Spline masks can have either soft or hard edges, represented by an inner and outer boundary spline. For hard edged masks, both the inner and outer splines are identical. When moving mask vertices, the Edit Inner and Edit Outer buttons can be used to control which of the inner or outer splines are adjusted.
When both buttons are pushed, both the inner and outer splines will be adjusted at the same time. When only one button is pushed, only the corresponding spline will be adjusted. This allows the inner or outer edges to be adjusted independently of each other, producing a soft mask between the two boundaries.
For X-Spline masks, the position of the inner boundary is controlled by a white handle at each vertex. This can be used to adjust the distance between the outer and inner boundaries.
The Roto Thickness edit box can be used to set the distance between outer and inner boundaries for all vertices at the same time.
Vertex Groups
Vertices can be grouped together and moved as a single entity if required.
Once created, a vertex group can be moved as a whole by selecting it in the mask list and then clicking and dragging one of its vertices with the left mouse button.
Boolean Operations
After a top-level mask is created, creating additional masks will add them as children of the top-level mask. The way that child masks affect the overall shape of the parent can be modified using Boolean operations. Booleans are changed by right-clicking in the Boolean column of the mask lists.
Add - adds the child mask shape to the parent mask.
Subtract - subtracts the child mask shape from the parent mask.
Intersect - only the region of the child mask shape that is intersecting the parent will be masked.
Exclude - only the region of the child mask shape that is not intersecting the parent will be masked.
Animating Splines
To animate a mask as a whole, select it from the mask list and press and hold the Control key to display the transformation widget. Masks can be translated, scaled or rotated as a whole, as well as individual vertices be moved.
For Bezier roto splines, right-clicking on a roto vertex in the Cinema window will display a context menu allowing the vertex to be changed from Bezier to Linear or back again.
Frames where a mask has been keyframed are displayed with yellow markers in the scrub bar. The K- and K+ buttons can be used to quickly move to the previous or next frame that contains a keyframed vertex.
Tracking Masks
As well as hand-animating a mask throughout a clip, Roto and X-Spline masks can also be tracked from frame-to-frame.
Note that the mask transformation obtained by tracking is independent of that produced by keyframing vertex positions. This means a mask can be tracked and then its vertices keyframed independently, without the need to adjust a vertex position in every frame.
When tracking starts, the tracking template (i.e. the image pixels contained inside the mask) are matched from frame-to-frame, and the tracking transformation is updated. By default, Incremental Tracking is enabled which means the tracking template will be updated in each frame. This allows the tracking to adapt to small changes in the image content, but also means that the mask may drift during tracking.
To improve tracking accuracy when the mask becomes occluded by another object, Robust Tracking can be enabled. This will attempt to identify pixels that are not part of the object and ignore them during tracking. The number of these 'outliers' can be adjusted using the Outliers % edit box.
Controls
Create
X-Spline Roto: Draw an X-Spline roto mask. Click with the left mouse button in the Cinema window to place vertices. To close the mask, click on the first vertex again. X-Spline handles are available to control the tension and thickness at each control point.
Colour X-Spline: Draw a Colour X-Spline mask. Click and drag with the left mouse button to paint the outline around the object in question. Press the Escape key to finish painting and convert the boundary into a Colour X-Spline.
Bezier Roto: Draw a Bezier roto mask. Click with the left mouse button in the Cinema window to place vertices. To create a vertex with Bezier handles, click and drag with the left mouse button to extend the handles. To close the mask, click on the first vertex again.
Rectangle: Draw a Rectangle mask by clicking and dragging in the Cinema window with the left mouse button.
Ellipse: Draw an Ellipse mask by clicking and dragging in the Cinema window with the left mouse button.
Lasso: Draw a Lasso mask. Click and drag with the left mouse button in the Cinema window to draw the lasso boundary. To close the mask, click with the left mouse button on the first vertex point.
Import: Clicking this button will open a file browser where Silhouette Shape or Mocha Nuke6.2 Roto files can be imported.
Tracking
<<, <, >, >>: Track selected masks forwards or backwards. Clicking >> or << will track backwards or forwards by multiple frames, and clicking < or > will track backwards or forwards by one frame.
R-, Remove Tracking Key, R+: Remove the tracking transformation from all earlier frames (R-), from the current frame only (Remove Tracking Key), or from all later frames (R+).
Tracking Mode: The mask tracking mode. This defines the type of motion that will be tracked for each mask. Combinations of translate, rotate and scale can be specified, along with Affine and Planar Perspective motion.
Use Pixels %: The percentage of pixels used to estimate the tracking transformation. Decreasing this value will speed up the tracking process, but decreasing it by too much may mean important image information is lost, reducing tracking accuracy.
Outliers %: The approximate number of outlier pixels (i.e. pixels that are not actually part of the layer) when using the Robust tracking tracking mode described below.
Compensate for illumination: Compensate for small changes in image brightness during tracking. Note that the compensation for brightness is assumed to be the same for all pixels inside the mask.
Use robust tracking: When enabled, it is assumed that some of the pixels contains inside the mask are not actually part of the object being tracked, and should therefore be ignored during tracking. The approximate percentage of these 'bad' pixels is controlled using the Outliers % edit box described above.
Use incremental tracking: When enabled, the tracking template (i.e. the image that is being matched in each frame) will be updated at every frame. This is equivalent to using the < or > buttons to repeatedly track the mask over one frame at a time.
Edit Tracking ROI: Adjust the region of interest (ROI) that defines which pixels in the image will be used for tracking. The ROI is displayed as a magenta rectangle in the Cinema window and can be adjusted by clicking and dragging with the left mouse button.
Editing
K-, K+: Move to the previous or next frame that contains a keyed vertex.
R-, Remove Key, R+: Remove vertex keyframe positions from the mask. R- will remove all earlier keyframes, and R+ will remove all later keyframes. Remove Key will remove keyframes at the current frame only.
In: Set the in-point of the mask to the current frame. The in-point can also be changed using the edit box. The R button resets the in-point to the start of the clip.
Out: Set the out-point of the mask to the current frame. The out-point can also be changed using the edit box. The R button resets the out-point to the end of the clip.
Insert: When enabled, clicking with the left mouse button in the Cinema window will insert new vertices into the selected mask boundary.
Edit Inner: When enabled, the inner boundary vertices of a mask can be edited using the left mouse button.
Edit Outer: When enabled, the outer boundary vertices of a mask can be edited using the left mouse button.
Roto Thickness: The distance between the inner and outer boundaries of roto masks, and can be used to quickly adjust the boundary positions for Colour Roto masks.
Edge Threshold: The threshold to control how pixels in between the inner and outer boundaries of a Colour X-Spline mask are assigned to the object. This value can be increased to assign more pixels to the mask. Decreasing this value will mean more pixels are assigned to the background (and hence are not part of the mask).
Cut: Copy selected masks into the clipboard and delete it from the mask list.
Copy: Copy selected masks into the clipboard, so they can then be pasted into a different Roto node.
Paste: Paste masks stored in the clipboard into the current Roto node.
Duplicate: Duplicate all selected masks.
Group: Create a group containing the selected vertices. Vertex groups are listed below each mask in the mask list. To remove a vertex from a group, right-click on the vertex in the Cinema window and choose Group>None from the popup menu. When a group is created, selecting that group in the mask list and adjusting one vertex will move all other vertices in the group in the same manner.
Invert: Invert the entire mask.
Delete: Delete all selected masks, or vertex groups, from the list. If a mask is deleted, it will no longer contribute to any node operations.
All/None: Select all or none of the masks in the list.
Lock/Unlock: Lock or unlock all selected masks. Locked masks cannot be edited.
Marquee: When enabled, clicking and dragging with the left mouse button in the Cinema window will select vertices from a mask. Holding the Shift key whilst drawing will ensure that previous selections are kept. Holding the Control key will allow a lasso selection to be used instead of a rectangle.
Colour and Opacity: Display a colour chooser dialog that allows the default colour of new mask splines to be changed. The opacity edit box can also be used to adjust the overall mask opacity, allowing more or less of the background image to show through. Note that mask opacity does not affect how much each pixel is masked: it is used only for display purposes.
Vertex context menu
Right-click on a vertex in the Cinema window to display the menu.
Group: Select the vertex group this vertex should belong to.
Delete: Delete the vertex.
Keyboard Shortcuts
Keyboard shortcuts can be customised in the Preferences.
Display the mask animation widget | Control |
X-Spline | Shift+X |
Colour X-Spline | Shift+C |
Bezier Roto | Shift+R |
Rectangle | Shift+N |
Ellipse | Shift+E |
Lasso | Shift+L |
In | Shift+I |
Reset In | Control+I |
Out | Shift+O |
Reset Out | Control+O |
Insert Points | Shift+P |
Edit Inner | Shift+T |
Edit Outer | Control+T |
Track Backwards | [ |
Track Backwards Frame | Shift+{ |
Track Forwards Frame | Shift+} |
Track Forwards | } |
Remove Earlier Tracking Keys | Shift+( |
Remove Tracking Key | Shift+* |
Remove Later Tracking Keys | Shift+) |
Remove Earlier Keys | ; |
Remove Key | ' |
Remove Later Keys | # |
Move To Previous Keyframe | K |
Move To Next Keyframe | L |
All/None | Shift+S |
Cut | Control+X |
Copy | Control+C |
Paste | Control+V |
Invert | Shift+V |
Marquee | Shift+M |
Group | Shift+G |
Duplicate | Shift+U |
Delete | Del |
SilhouetteFX is a trademark of SilhouetteFX, LLC.
Mocha Pro is a trademark of Imagineer Systems Ltd.
NUKE is a trademark of The Foundry Visionmongers Ltd..