RotoShape

The RotoShape node can create multiple, spline-based shapes that be used as an alpha channel for an element, or to mask a layer or an effect.

The RotoShape node is a newer, faster, more flexible, and more able rotoscoping tool that replaces the QuickShape node (that turned out to be not so quick).

RotoShape has the following advantages over QuickShape:

 

Add Shapes Mode Versus Edit Shapes Mode

When the RotoShape node is active, the associated tools appear on the Viewer toolbar.

There are two modes in RotoShape: The Add Shapes mode and the Edit Shapes mode.You draw your initial shape and add shapes in Add Shapes mode, and modify or animate the shape in Edit Shapes mode mode.

To add a shape:

In Add Shapes mode, the shape does not render until you complete and close the shape. In splines mode, the tangent always attempts to close itself with the first point, so there is some curvature around the end points. You can edit previously-placed points and tangents.

When you are in Build mode, the shape will not draw (and will therefore not affect later nodes). When you click on a blank spot, it will append a new knot there. The tangent will always be trying to close itself with the first knot, so there will therefore be some curvature around these end points. You can edit previously-placed knots and tangents.

The shape is filled, and the Edit Shapes mode is automatically activated.

Click a blank spot and drag to select a group of points. Drag to select a new group of points, Shift-drag to add to the group of active points, or Ctrl-drag to remove from the active group of points.

Note: To drag-select the control points of a shape when multiple onscreen controls (from different nodes) are displayed in the Viewer, first move the cursor over the shape you want to edit. Next, drag-select the points. This behavior applies to RotoShape, QuickPaint, and QuickShape objects. For example, you can display the onscreen controls for the shapes of two different RotoShape nodes by loading the parameters of one node into the Parameters1 tab, and Shift-clicking on the right side of the second node to display the parameters in the Parameters2 tab. Also, if the points you want to drag-select are within a DOD bounding box, move the cursor over the shape inside of the DOD, and then drag-select the points.

 

Inserting and Modifying Points and Tangents

Hold Ctrl and drag on the end... ...to break a tangent.

 

Creating and Modifying Shapes

To create additional shapes, click Add Shapes . Click in the Viewer to add another shape.

You can modify a shape in several ways. In the transform tool, the small knobs that go up and to the left are the Y and X scale parameters, respectively. The diagonal knob scales both X and Y. The longer knob to the right rotates the shape, and the center of the controls moves the shape.

To move the transform tool without modifying the shape, hold down Ctrl.

If you right-click on a point, additional controls become available. The first option, the Bounding Box Toggle, yields a box that can be transformed to move and scale the shape.

You can also right-click a point and select Delete Shape to delete the shape.

When animating shapes, to set keyframes for the current shape only, set Key Current Shape/All Shapes to Key Current Shape . To set keyframes for all shapes, toggle to Key All Shapes .

For information on making a shape black, or changing the order of multiple shapes, see “Right-Click Controls,” below.

 

The Point Modes

The following table describes the four point modes

Icon Name Hot Key Notes
Group Mode F1 Moves the main shape point and its associated edge point.
Main Mode F2 Only allows you to move main shape points. Edge points are not modified.
Edge Mode F3 Only moves edges. You can therefore move the edge away from the shape.
Any Mode F4 Allows you to pick either type of point.

 

Be careful with the soft edges. If you make a shape where the lines overlap each other, you may get rendering artifacts. To clean up minor artifacts, apply a slight blur with the Blur node.

 

Right-Click Controls

To access several additional functions, right-click a point or transform control.

To specify a shape as black, right-click on a point and select Black. The black shape can then be used to punch a hole in other shapes.

Currently, the black holes will not punch a hole in RotoShape's alpha mask. This should be fixed for the maintenance release. Therefore, if using this as a mask, either use the one of the RGB channels as the mask, or reorder the luminance into the alpha when using it with Inside or Outside. This can be done with Reorder - rgbl or a LumaKey at default settings.

Use the Move functions (Move To Back, Move Back, Move Forward, and Move to Front) on the right-click menu to switch the order of the shapes.

When you right-click on the transform control, you can set up a skeleton relationship between your shapes. Right-click and select Add Child, and click on the transform control of the shape you want as a child of the current shape. To remove the link, right-click and select Remove Parent.

Once a link has been established, modifying a shape will affect its children:

 

Right Mouse menu on Transform Tool:

Item Something
Bounding Box Toggle Toggles on and off the Bounding Box control for a shape
Move to Back Moves the shape to be behind all other shapes.
Move Back Moves the shape back one position in shape order.
Move Forward Moves the shape forward one position in shape order.
Move to Front Moves the shape in front of all other shapes.
Select All Selects all points on the shape.
Duplicate Shape Duplicates the current shape.
White Renders the shape with a white interior.
Black Renders the shape with a black interior and can therefore punch holes in other shapes. The alpha remains white.
Re-Center Re-centers the transform tool to be the center of the shape - Ctrl+drag can modify it without moving the shape.
Add Child Click the transform tool of a second shape to make it a child of the current shape.
Remove Parent Removes the current shape from the skeleton hierarchy.
Attach Tracker To Shape This calls up a list of pre-created trackers that may be used as an offset to the shape.

 

Right Mouse menu on Points:

Item Something
Bounding Box Toggle Toggles on and off the Bounding Box control for a shape
Move to Back Moves the shape to be behind all other shapes.
Move Back Moves the shape back one position in shape order.
Move Forward Moves the shape forward one position in shape order.
Move to Front Moves the shape in front of all other shapes.
Select All Selects all points on the shape
White Renders the shape with a white interior.
Black Renders the shape with a black interior and can therefore be made to punch holes in other shapes it is in front of.
Reset Softedge Re-positions the edge knot on top of the main knot.
Delete Shape Deletes the current shape.

 

Viewer Buttons:

Item Something
Add Shapes Mode/Edit Shapes Mode. Click Add Shapes Mode to draw a shape. Click Edit Shapes Mode to edit a shape. Closing a shape automatically activates the Edit Shapes Mode. RotoShape only renders when Edit Shapes Mode is active.
This can quickly toggle on and off the rendering of the shape.
These control the tangent visibility. When in Pick mode, only the active knot will display a tangent. None will hide all tangents, and All will display all tangents.
Lock/Unlock tangents toggle.
Spline/Linear toggle. New knots will be created either as splines or as linear points. Selecting knots and toggling this will specify them as a certain type of knot.
A really annoying on-screen control to pan the entire collection of shapes. It is off by default.
Delete current knot(s)
Determines what knots can be grabbed. Group mode means both the main shape and the edge knot are grabbed. Main mode means only the main shape knots are grabbed. Edge mode will only select edge knots, and Any mode will allow you to pick either main or edge knots.
Key Current Shape/Key All Shapes toggle. When animating, select Key Current Shape to keyframe only the current rotoshape. Select Key All Shapes to keyframe all shapes.
If the main on-screen transform tool is turned on , this toggles the visibility of the animation path. Doesn't have a purpose if this tool is turned off. It serves no purpose if this tool is turned off.

 

Function

Parameters
Type
Defaults
Function
width
int
GetDefaultWidth() width of the image
height
int
GetDefaultHeight() height of the image
bytes
int
1 bit depth, 1, 2, or 4 bytes/channel
x/yPan
float
0, 0 A global pan applied to the entire shape.
angle
float
0 A global rotation applied to the entire shape - points will be properly interpolated according to the rotation.
x/yScale
float
1, 1 A global scale applied to the entire shape.
x/yCenter
float
width/2, height/2 The center of transformation for the angle and x/yScale parameters
motionBlur
float
0 This is the quality setting for the motionBlur. A quality of 0 turns off the blur. Unlike the normal blur, you can boost this past 1.
shutterTiming
float
1 The duration of the blur exposure. Default is .5, or half a frame.
shutterOffset
float
0 The starting frame relative to the current frame. Default value is 0, meaning the beginning of the current frame.
shapeKeys
float
N/A This is not to be modified by the user. It is just a placeholder

 

Synopsis

image RotoShape( 
  int width, 
  int height, 
  int bytes,
  float xPan,
  float yPan,
  float angle,
  float aspectRatio,
  float xScale,
  float yScale,
  float xCenter,
  float yCenter,
  float motionBlur,
  float shutterTiming,
  float shutterOffset,
  [cv data]

);


Script

image = RotoShape( 
  width, 
  height, 
  bytes, 
  xPan,
  yPan,
  angle,
  aspectRatio,
  xScale,
  yScale,
  xCenter,
  yCenter,
  motionBlur,
  shutterTiming,
  shutterOffset,
  [cv data]
);


Command Line

not really command-line compatible

See Also
QuickShape