About the Warper Node

Using Shake's shape-based Warper node, you can easily create specific warping effects using tools very similar to those used by the RotoShape node. Using shapes, you can deform parts of an image to conform to shapes you draw in the Viewer.

About Warper Memory Usage

The Warper and Morpher nodes use a lot of memory when processing high-resolution images--using four image channels of the full image buffer in float space for each processing thread used. Memory usage may become an issue when warping and morphing large images when multi-threaded processing is enabled. As a result, virtual memory usage may noticeably slow processing speed when the maximum available RAM is used.

For example, if you have 2GB of RAM in your computer, and Shake plus assorted OS operations use 300 MB, this leaves 1.7 GB of total memory left for image processing by the Warper or Morpher nodes for any given frame. You can calculate the RAM used for a frame at a given image size using the following formula:

4 * (image width * image height * 4) * (number of threads)

Using this formula yields the following memory usage table:

Number of
Threads

2K Image
Calculation

4K Image
Calculation

8K Image
Calculation

1

49 MB

195 MB

778 MB

2

97 MB

389 MB

1.6 GB

If you don't have enough RAM to handle the resolution you're working at, switch the maxThread parameter in the Globals tab to 1. This reduces the memory requirements for this operation.

Using Shapes to Warp

The Warper allows you to use animated shapes to control and animate the deformation of an image using four types of shapes that you draw. These shapes work together to define which parts of an image will be deformed to fit into shapes that you define.

Types of Control Shapes

  • Source Shapes: These are shapes you draw that conform to the subject of the source image you want to deform. They generally follow well-defined contour lines of the subject--examples might include the edge of a person's face, the contours of the eyes, eyebrows, nose, and mouth, or the outline of an arm or leg. Source shapes are light blue by default.
  • Target Shapes: These are shapes you draw that define the shape you want the deformed image to conform to. For example, if you want to warp the eyes of a cat to make them appear to bulge on cue, you would create animated target shapes defining the new shape of the eyes. Target Shapes are dark blue by default.
  • Connection lines: These are automatically created when you connect a source shape to a target shape, and indicate the correspondence of each point in a source shape to its destination on the target shape. It is by pairing source shapes with target shapes that Shake is able to create controlled deformations of an image. Although four connection lines are automatically created for each source/target shape pair, you can create additional ones to give you added control over the deformation. Connection lines are purple by default.
  • Boundary Shapes: The Warper and Morpher nodes can sometimes create unwanted deformations in areas surrounding the parts of the image you intend to manipulate. Boundary shapes are essentially shapes that are both Source and Target shapes, which is how they keep affected pixels from moving. You can use boundary shapes to minimize the effect of a warp on surrounding parts of an image, either by excluding whole regions of the source, or by "pinning down" specific areas that you don't want to be deformed. You can create as many boundary shapes as necessary, since it may take more than one to pin down an image completely. Boundary shapes are orange by default.
  • Displaced Target Shapes: These are not shapes you either create or modify directly. Instead, they're indicators that show the amount of displacement in that region of the image, based on the Displacement parameter for that source/target shape pair. They're designed to help you see what the deformation will be without having to render the entire image. Displaced target shapes are pink by default.

Note: The colors of each control shape type can be modified in the shapeColors group of the guiSettings section of the Globals tab.

Source shapes and target shapes may be drawn separately, or you can duplicate the source shape you create and modify it to quickly create a target shape. It's not necessary for the source and target shapes to have the same number of points, since the actual path that an animated deformation will follow runs along the connection lines that appear once you connect a source shape to a target shape.

In both the Warper and Morpher nodes, you may create as many Source/Target shape pairs as necessary to deform various parts of the subject. Unlike the RotoShape node, which only allows for the creation of closed shapes, the Warper and Morpher nodes allow you to create closed shapes, open-ended shapes, and single-point shapes. This flexibility allows you to create any kind of deformation you need.

Animating Control Shapes

Unless you're deforming a still image, it will probably be necessary to animate the source and target shapes you use to fit the motion of the subject you're deforming. For example, if you're creating a warp for an actor who's moving, you'll need to animate the source shape to conform to the outlines of the actor so that they follow his or her motion. You'll then need to animate the target outlines to follow the same motion.

Here's a shortcut that may save you some effort when you create a warp effect using an animated shape. First, animate the source shape that defines the area of the image you want to warp. Afterwards, you can duplicate and modify it as necessary to use as the target shape, without having to reanimate the entire shape.

For more information about keyframing shapes, see "Animating Shapes" in chapter 15 of the the Shake Reference Guide, "Painting, Rotoscoping, and Other Image Functions."

Using Motion Tracking to Animate Control Shapes

In addition to manually keyframing source and target shapes, you can attach Stabilize or Tracker nodes to either source or target shapes to aid you when rotoscoping moving features. This works identically to the way you attach Stabilize or Tracker nodes to shapes in the RotoShape node. For more information, see "Attaching a Tracker to a RotoShape" in chapter 15 of the Shake Reference Guide, "Painting, Rotoscoping, and Other Image Functions."

Controlling Warp Deformation Using Connection Lines

When you first connect a source shape to a target shape in the Viewer, four connection lines appear that run from the source to the target shapes. These control lines serve two purposes. First, they show you which segments of a source shape correspond to which segments of its connected target shape. Second, their angles define the path the pixels of the image will follow when warping from their original position to the target position you've defined.

 

The start and end points of control lines that are connected to the source and target shapes can be moved by dragging them back and forth along the shapes themselves. Changing the angle of the lines by moving the in or out point of a control line independently allows you to redefine the angle of deformation for all pixels in that area of the warp.

 

Control lines can be moved, and even animated, to control the way the speed and direction of deformation. Additional control lines may also be created to give you more precise control over the deformation itself.

Using Boundary Shapes to Limit Deformation in an Image

The Warper and Morpher both work by pushing and pulling the pixels of an image to move parts of the image defined by the source shapes to the region defined by the target shapes. When part of an image is warped, the surrounding area stretches to accommodate the change, as if the image is on a sheet of rubber being pushed and pulled to distort it.

The region affected by the resulting deformation is not limited to the area defined by the source/target shape pairs. In fact, you'll notice that a significant area of the image surrounding each source/target shape pair is also deformed. While there is a 100 percent displacement at the actual position of the source and target shapes, the total area of deformation lessens gradually with the distance from the shape pair. This may result in a warp not only affecting the intended subject, but also the surrounding background.

This aspect of the Shake warper is useful in that it helps to smooth the transition between the warped and unwarped parts of your image, resulting in a more realistic effect. It also means that sometimes it's not necessary to create as many source/target shape pairs as you might think--a single shape pair's area of influence may be enough to create the effect you want.

On the other hand, there are usually parts of an image that you don't want warped. For example, if you're warping someone's eyebrows, chances are you don't want his or her hair to be distorted as well. You exclude parts of an image from being affected by the Warper or Morpher nodes using boundary shapes.

It's important to understand that boundary shapes don't eliminate distortion from the surrounding image; they minimize it.

It may take more than one boundary shape to completely lock down an image. Fortunately, you can create as many boundary shapes as necessary to eliminate unwanted distortion in an image.

Warning: Target shapes should never cross boundary shapes. Doing so may create unwanted distortion and tearing in the resulting image.

There are many ways you can use boundary shapes to prevent parts of an image surrounding an area of deformation you've set up from being affected by a warp effect. One is to use a closed shape to surround a pair of source/target shapes, which minimizes their effect on the surrounding area of the image.

For example, if you warp a subject's eyes so that they bulge open, but you don't want the effect to overly stretch the rest of the face, you can create a boundary shape to isolate the source/target shapes around the eyes. Sometimes, you may have to use several concentric rings of boundary shapes to completely lock down an area of the image.

You can also use boundary shapes to "pin down" specific areas of an image that you don't want to be affected by a warping effect. For example, if you were creating a warp effect to manipulate an animal's face, you could use a combination of open and closed shapes and single-point shapes to prevent the eyes and nose from being affected by the warp you're applying to the eyebrow area.

Note: By default, the outer edge of the frame is used as a boundary shape. This behavior can be disabled by turning off the addBorderShape parameter in the Parameters tab for the Warper or Morpher node you're adjusting, but this may produce unexpected results.

Isolating the Subject of Deformation Prior to Warping or Morphing

Even when you use one or more boundary shapes to pin down areas surrounding a warp effect, you may find that some of the surrounding image is still affected, however slightly. For this reason, it may be useful to isolate the subject of the image prior to using either the Warper or Morpher nodes. Ideally, the subject of the warp effect was shot against blue or green-screen, and can be keyed. If not, you can always rotoscope the image using a RotoShape node.

In either case, the Warper and Morpher nodes affect the alpha channel of the image along with the RGB portion, so you can always add either to the end of a node tree you've created to isolate your subject. This way, you can add a clean background no matter how extreme the warping effect is.

Creating and Modifying Shapes

Many of the shape controls of the Warper and Morpher nodes are identical to those of the RotoShape node, and all share the same methods for creating tangents, closing shapes, inserting and deleting points, etc. If necessary, you may refer to the RotoShape documentation for more information on creating and modifying shapes.

The Warper Viewer Shelf

When a Warper or Morpher node is selected, the following buttons appear in the Viewer Shelf.

The Warper and Morpher nodes both have the following controls.

Button

Name

Action

  

Add New Shapes

Creates new shapes. Closed shapes are created by clicking on the first shape point you created. Open shapes and single-point shapes are created by double-clicking when creating the last point, or by right-clicking in the Viewer and choosing Finish Shape from the contextual menu.

 

Edit Shapes

Allows you to edit shapes.

 

Connect Shapes

Clicking this control allows you to create a Source/Target shape pair by clicking first on the shape you want to be the Source, and then clicking a second time on the Target shape you want to link it to.

To define a Boundary shape, click this control, then click twice on a shape you want to turn into a Boundary shape. This effectively makes a single shape into both a source and target shape.

 

Edit Connections

Once two shapes have been joined with the Connect Shapes button, the location and angle of each Connection Line that links source to target shapes may be edited by clicking this control. With this control turned on, select one or Shift-click to select both of the source and destination points of a Connection Line to move them along each shape.

 

Show/Hide Tangents

Toggles the Viewer among showing All shape tangents (the handles that allow you to manipulate Bezier curves), None, or Pick, which only shows the shape tangents of individually selected points.

 

Lock Tangents On/Off

Locks or unlocks all shape tangents in the Viewer. If locked, shape points may still be moved, but the tangents defining the angle of curvature remain locked.

 

Toggle Shape/Line Mode

Toggles selected points between being corner points and Bezier curves.

 

Delete Knot

Deletes selected points on a shape.

 

Keyframe Current Shape/All Shapes

Toggles between two shape keyframing modes. In All Shapes, all shapes are keyframed whenever any one shape is modified while auto-keyframing is on. In Current Shape, only the selected shape is keyframed while auto-keyframing is on.

 

Enable/Disable Shape Transform Control

When turned on, this control makes the Shape Transform controls for each shape visible in the Viewer. Each shape can be manipulated as a whole using this control. When turned off, all Shape Transform controls are hidden, and cannot be used.

 

Visibility Toggles

These buttons toggle the visibility of specific types of shapes in the Viewer. From left to right, they control:

  • Source Shape Visibility
  • Target Shape Visibility
  • Connection Visibility
  • Boundary (or lockdown) Shape Visibility
  • Unconnected Shape Visibility
  • Displaced Target Shape Visibility

Each control affects the visibility of all shapes of that type in the Viewer. Individual shapes may be made invisible using controls in the Parameters tab. However, the Visibility toggles in the Viewer Shelf supersede the Visibility settings in the Parameter tab.

Each setting in the Select Display pop-up menu of the Warper and Morpher allow these controls to be toggled independently. For example, in the Warper, the visibility settings of the Source image can differ from those used by the Target.

 

Shape Lock Toggles

These three buttons lock all Source, Target, and Boundary shapes in the Viewer, preventing them from being edited. Each control locks all shapes of that type in the Viewer.

Individual shapes may be locked using controls in the Parameters tab. However, the Lock controls in the Viewer Shelf supersede the Lock controls in the Parameter tab.

 

Select Display Image

The Source/Warped Image pulldown allows you to toggle the Viewer's display between the unmodified and modified images.

You may quickly jump between views by pressing:

  • F1 to view the original Source Image
  • F2 to view the original Target Image (Morpher only)
  • F3 to view the Warped Image

Drawing and Editing Shapes

The biggest difference between drawing shapes with the RotoShape node and the Warper and Morpher nodes is that while the RotoShape node only allows you to draw closed shapes, the Warper and Morpher nodes also allow you to create open shapes and single-point shapes. Open shapes make it very simple to define deformations for things like eyebrows, muscle outlines, and other contours that don't require a complete outline. Single-point shapes allow you to define deformations for small image details, and are also very effective as boundary shapes you can use to pin down parts of the image you don't want to be affected by nearby source/target shape pairs.

The Warper and Morpher nodes both warp the image using the same shape controls, and the methods used to create and edit shapes for use by each node are identical.

Drawing New Shapes

Drawing new shapes works the same whether you're creating a source, target, or boundary shape. In each case, you create a new, unassigned shape first, and you assign its type in a subsequent step. Unassigned shapes appear yellow, by default.

To create a new unassigned shape:

Click the Parameter control of the Warper or Morpher node you want to create a new shape with to load its parameters into the Parameter tab, and its controls into the Viewer Shelf.

In the Viewer Shelf, click the Add Shape button.

 

If necessary, zoom into the image in the Viewer to better trace the necessary features of the subject you want to warp.

In the Viewer, begin drawing a shape by clicking anywhere on the image to place a point.

Continue clicking to add more points to the shape. Click once to create a sharply angled point.

To create a point with tangent controls to make a Bezier curve, click and hold the mouse button down, and drag to one side of the point until the angled point becomes a curve.

The distance you have to drag before the angled point becomes a curve is customizable via the rotoTangentCreationRadius parameter in the shapeControls section of the guiSettings group in the Globals tab.

There are three ways you can end shape drawing to create different kinds of shapes:

  • To create a single point shape, right-click in the Viewer immediately after creating the first point and choose Finish Shape from the shortcut menu.
  • To create an open shape, either double-click when creating the last point of the shape, or right-click and choose Finish Shape from the shortcut menu after creating the last point of the shape.
  • To create a closed shape, click the first point of the shape you created.
  • You can only create single-point shapes and open shapes in the Warper and Morpher nodes. You cannot create these kinds of shapes in the RotoShape node.

Every time you create a new shape, an additional shape parameter appears in the parameter tab of the corresponding Warper or Morpher node. By default, each new shape parameter that's created is named "shape1Name," and the middle number is incremented with each new shape you draw. These names can be changed to more easily identify the specific parts of the subject you've isolated for individual manipulation later.

 

Editing Shapes

Once you've created a shape, there are several ways you can modify it. These techniques also work for keyframing shapes used for animated warping effects. For more information about keyframing shapes, see "Animating Shapes" in Chapter 15 of the Shake Reference Guide, "Painting, Rotoscoping, and Other Image Functions."

When editing shapes that are close to other shapes, it may be helpful to turn off the Enable/Disable Shape Transform control in the Viewer Shelf, to hide Transform controls from other shapes that may overlap the shape you're editing. After your source/target shape pairs have been defined it may also be helpful to turn off the visibility of shape types that you don't need to see. For example, turning off the visibility of all source shapes while you're editing their corresponding target shapes will prevent accidental adjustment of the wrong overlapping points. You can turn different groups of visibility controls on and off for each setting of the Select Display pop-up menu in the Viewer Shelf.

  • In order to edit Warper or Morpher shapes, it's important to make sure the Edit Shapes button is turned on.

To edit a shape:

Click the Parameter control of the Warper or Morpher node with the shape you want to modify to load its parameters into the Parameter tab, and its controls into the Viewer Shelf.

In the Viewer Shelf, click the Edit Shapes button.

 

Select one or more points you want to edit by doing one of the following:

  • Click on a single point to select it.
  • Shift-click additional points to add them to the selection.
  • Click in the Viewer and drag a bounding box over all the points you want to select.
  • Hold the Shift key down and drag to use another bounding box to add points to the selection.
  • Hold the Command or Control key down and drag to use another bounding box to remove points from the selection.
  • Move the mouse cursor over the edge, or the transform control, of a shape, and press Control or Command + A to select every point on that shape.

When the selected points are hilighted, rearrange them as necessary by doing one of the following:

  • To move one or more selected points, drag them where you want them to go.
  • To move one or more selected points using that shape's transform control, press the Shift key while you use the transform control.

Using the transform control without the Shift key pressed modifies the entire shape, regardless of how many points are selected.

To add a point to a shape:

Click the Edit Shapes Mode button.

Shift-click the part of the shape you want to add a control point to.A new control point appears on the shape where you clicked.

To remove one or more points from a shape:

Select the point or points you want to remove.

Do one of the following:

 
  • Press the Forward Delete key.

Those points disappear, and the shape changes to conform to the remaining points.

To convert angled points to curves, and vice versa:

Select the point or points you want to convert.

Click the Toggle Shape/Line Mode button to convert angled points to curves, or curves to angled points.

 

An optional step is to set the Show/Hide Tangents button to All or Pick to view tangents as they're created.

To change a curve by editing a point's tangent handles:

Make sure the Show/Hide Tangents button is set to All to view all tangents, or Pick to view only the tangents of points that you select.

Make sure the lock tangents control is turned off.

Do one of the following:

  • To change the angle of one of the tangent handles relative to the other, along with its length, press the Command or Control key while dragging a handle around the axis of the selected point. The selected tangent handle moves, but the opposing tangent handle remains stationary.
  • To keep the angle of both tangent handles at 180 degrees relative to one another, keeping the lengths of each side of the tangent identical, press the Shift key while dragging either of the tangent handles around the axis of the selected point. If you Shift -drag tangent handles that were previously angled, they are reset.

To edit a shape using its Transform control:

Make sure the Enable/Disable Shape Transform Control is turned on.

When you move, scale, or rotate a shape using its Transform control, each transformation occurs relative to the position of the transform control. To move a shape's Transform control in order to change the center point about which that shape's transformation occurs, press the Command or Control key while dragging the transform control to a new position.

To manipulate the shape, drag one of the transform control's handles:

  • Drag the X handle to resize the shape horizontally, or drag the Y handle to resize the shape vertically.
  • Drag the Rotate handle (to the right of the transform control) to rotate the shape about the axis of the transform control.

Showing and Hiding Shapes

Individual shapes may be hidden, if necessary, to help you isolate one or more shapes you want to make adjustments to. Hiding shapes simply makes them invisible. Hiding a shape has no affect on the resulting warp effect, all source/target shape pairs continue to warp the image as before.

When a Warper or Morpher node is selected in the Node View, each shape in that node is labeled in the Viewer. By default, each shape is numbered in the order that it was created. These names can be customized in that shape's corresponding parameter in the Parameter tab. These names help you to identify which shapes are which when you're changing their individual visibility.

To show or hide an individual shape directly in the Viewer:

Do one of the following:

  • Right-click anywhere in the Viewer to display the Viewer shortcut menu, then choose the Shape Visibility submenu, and select a label from the submenu that corresponds to the shape you want to show or hide. Shapes that are checked are shown, shapes that are unchecked are hidden.
  • In the Parameter tab, click the Visibility control of the shape parameter that corresponds to the Shape you want to show or hide. These controls are linked to the settings in the Shape Visibility submenu of the Viewer shortcut menu. Changes made to one automatically apply to the other.

You can also show or hide all shapes of a particular type using the Visibility Toggles in the Viewer Shelf. Each control affects the visibility of all shapes of that type in the Viewer. The Visibility Toggles supersede the Visibility settings in the Parameter tab.

Each setting in the Select Display pop-up menu in the Viewer Shelf of the Warper and Morpher allow these controls to be set independently. For example, in the Warper, the visibility settings set when displaying the Source image can differ from those set when displaying the Target image.

To show or hide all shapes of a particular type:

Click the Visibility toggle control in the Viewer Shelf that corresponds to the shape type you want to hide.

Duplicating Shapes

A fast and easy way to create corresponding target shapes once you've drawn a source shape is to duplicate it, and modify the duplicate. This is especially useful for instances where the general shape of the target shape you want to create is similar to the source.

To duplicate a shape:

Click the Edit Shapes Mode button to allow you to select shapes in the Viewer.

Move the mouse cursor over the edge, or the transform control, of the shape you want to duplicate so that it's hilighted, then right-click and choose one of the following commands from the shortcut menu:

After using the Duplicate and Connect Shape command, locking or hiding the source shape immediately insures you won't accidently modify it when making changes to the new duplicate.

Copying Shapes from a RotoShape Node

You can copy shapes from a RotoShape node and paste them into a Warper or Morpher node for use as a source, target, or boundary shape. This is especially useful in cases where you've already isolated the subject using a RotoShape node and you can use that shape as a starting point for your warp effect.

  • If you copy a shape with a soft edge from a RotoShape node, only the main center shape is pasted into a Warper or Morpher node. The Edge shape is not used.

To copy a shape from a RotoShape node:

With the mouse over the transform control of the shape you want to copy in the Viewer, do one of the following:

Note: When copying a shape, the mouse cursor must be directly on the shape you intend to copy. Otherwise you may not copy the correct shape.

Select the Warper or Morpher node you want to paste it into.

Do one of the following:

The pasted shape appears just like any other newly created closed shape, and you can modify or duplicate it as necessary.

Connecting Source and Target Shapes

To create the actual warp effect, you need to connect each source shape you've created to a corresponding target shape. You can do so by either drawing two shapes separately and connecting them afterwards, or by drawing the source shape and duplicating it to use it as a starting point for the target (two shortcut menu commands, Duplicate Shape, and Duplicate and Connect Shape make this easy). Regardless of your intended use for the shapes you've created, until they're connected to one another they remain unassigned.

To connect a separately drawn source shape to a target shape:

Click the Connect Shapes Mode button.

 

Click a source shape.

Immediately click the target shape you want to connect to the source shape you clicked in step 2.

After they've been connected, the source shape appears light blue, and the target shape appears dark blue to indicate that the connection has been made. Purple connection lines appear between the source and target shapes to show which parts of each shape are connected.

In the Parameters tab of the corresponding Warper or Morpher node, an additional connection parameter appears for the connection you established. By default, each new connection parameter that's created is named "connection1Name," with the middle number incremented as each new connection is created. These names can be changed to more easily identify each specific connection for individual manipulation later on.

 

To disconnect a source shape from a target shape:

In the Parameters tab of the corresponding Warper or Morpher node, click the Delete button of the connection parameter corresponding to the connection you want to break.

 

After disconnecting a source/target shape pair, both shapes become unassigned, and turn yellow by default.

Modifying Connection Lines

Once you've connected a pair of source/target shapes, connection lines appear to show the deformation path that pixels along the source shape will follow to conform to the target shape. These connection lines can be moved to change this path, and alter the look of the warp effect. You can also add more connection lines to increase the amount of control you have over the warp effect.

To move the start or end point of a connection line independently:

Click the Edit Connection Mode button.

Drag a connection point to another location on the shape. The connection point's movement is restricted to the contour of the shape.

To move the entire connection line at once:

Click the Edit Connection Mode button.

Drag a bounding box or Shift -click each point to select both the start and end points of the connection line you want to move.

With both points selected, dragging one of them will move both at the same time. Both ends of the connection line are restricted to moving along the contours of the source and target shapes, and you can't move a connection point past another connection point.

To add more connection lines to a source/target shape pair:

Click the Edit Connection Mode button.

 

Shift -click either a source or target shape at the location you want a new connection line to be created.

A new connection line is immediately created where you clicked. The other end of the new connection line is placed at the closest point of the corresponding shape in the pair.

Locking Source and Target Shapes

Once you've created one or more source or target shapes, you can lock them individually in a Warper or Morpher node's parameters tab, or all together using the Lock Source/Target Shapes buttons under the Viewer. This is useful if you're modifying source and target shapes that are very close together, and you want to make changes to one without accidentally moving the other.

To lock all source and/or target shapes in the currently selected node:

Do one of the following:

  • Click the Lock Source Shapes button to lock all source shapes.
  • Click the Lock Target Shapes button to lock all target shapes.
  • Click the Lock Boundary Shapes button to lock all boundary shapes.

You can also lock individual source and target shapes using the lock control to the left of each shape parameter in that node's parameter tab. However, the Lock Source/Target Shapes buttons under the Viewer always supersede these individual shape-locking parameter controls. See See Parameters in the Warper Node for more information.

Defining Boundary Shapes

You can use any open or closed shape or single-point shape as a boundary shape to pin down areas of the image you don't want to be warped, or to exclude whole areas of the image from being affected by the source/target shape pairs you've created. You can create as many boundary shapes as you need to lock areas of the image you don't want to be warped.

Since boundary shapes are essentially shapes that are both source and target shapes simultaneously, you also define them using the Connect Shapes button.

To make an unassigned shape into a boundary shape:

Select the Warper or Morpher node you're working on, then create a new shape outlining the region of the image you want to lock down.

To turn this shape into a boundy shape, do one of the following:

The shape turns orange by default to indicate that it's now a boundary shape, and a new connection parameter appears in the Parameters tab of the Warper or Morpher node. By default, each connection parameter that defines a boundary shape is named after the shape it corresponds to. For example, if the original shape was named "shape3," the connection parameter that defines it as a boundary shape is named "shape3_boundary."

 

Turning Boundary Shapes Into Unassigned Shapes

Once you've turned a shape into a boundary shape, the only way to turn it back into an unassigned shape is to delete the connection parameter that corresponds to it in the Parameters tab of the Warper or Morpher node using that parameter's Delete button.

Customizing Shape Controls

Several parameters in the guiSettings section of the Globals tab allow you to customize the color and behavior of shapes and shape controls in the Viewer.

To access the shape control parameters in the Globals tab:

Click the Globals tab.

Click the guiSettings disclosure control to open the guiSettings parameters.

To access different shape customization controls, do one of the following:

Shape Colors

By default, source shapes appear light blue, target shapes appear dark blue, connection lines appear purple, boundary shapes appear orange, and unassigned shapes are yellow. These colors can all be changed using the following parameters in the rotoShapeColors section of the guiSettings group of the Globals.

Parameter

Shape Type

Default Color

ShapeColor

Unassigned shapes

Yellow

sourceColor

Source shapes

Light Blue

targetColor

Target shapes

Dark Blue

connectionColor

Connection lines

Purple

boundaryColor

Boundary shapes

Orange

lockedColor

Locked shapes

Grey

displacedColor

Displaced Target shapes

Pink

To change the default color of a shape color parameter:

Click the color swatch of the shape color parameter you want to change.

Use the Color Picker tab to select a new color to use for that shape type.

All shapes of that type are now displayed with the new default color you selected.

Shape Editing Controls

Various behaviors for selecting points, creating Bezier curves, and adjusting each shape's transformation control may also be customized in the rotoShapeControls section of the guiSettings group of the Globals. You can modify how each of these controls works to better suit your working style or input method, for example, whether you use a graphics tablet or mouse.

Each parameter has a slider that adjusts the control's behavior:

  • rotoAutoControlScale: An option which, when enabled, increases the size of the transform controls of shapes, based on the vertical resolution of the image to which the shape is assigned. This makes it easier to manipulate a shape's transform control even when the image is scaled down by a large ratio.
  • rotoControlScale: A slider that allows you to change the default size of all transform controls in the Viewer. You can also resize every transform control appearing in the Viewer by holding the Command or Control keys down while dragging the handles of any transform control in the Viewer.
  • rotoTransformIncrement: This parameter allows you adjust the sensitivity of shape transform controls. When this parameter is set to lower values, transform handles move more slowly when dragged, allowing more detailed control. At higher values, transform handles move more quickly when dragged. A slider lets you choose from a range of 1-6. The default value is 5, which matches the transform control sensitivity of previous versions of Shake.
  • rotoPickRadius: This parameter lets you select individual points on a shape that fall within a user definable region around the cursor. This allows you to easily select points that are near the cursor which may be hard to select by clicking on directly. A slider allows you to define how far the cursor may be from a point to select it, in pixels.
  • rotoTangentCreationRadius: This parameter lets you define the distance you must drag the cursor when drawing a shape point to turn it into a Bezier curve. Using this control, you can make it easier to create curves when drawing shapes of different sizes. For example, you could increase the distance you must drag to avoid accidently creating Bezier curves, or you can decrease the distance you must drag to make it easier to create Bezier curves when drawing short shape segments.

Using the Warper Node

The Warper node is useful for creating targeted deformations to alter the shape of a subject in an image. Examples might include making someone's nose grow, making an animal's eyes widen in surprise, or causing a bump to grow on someone's forehead. The warper can be used to make a static change to a subject, or it can be animated to cause dynamic changes in the subject's shape.

Parameters in the Warper Node

A simple example of a Warp node used to warp an image with a single pair of source/target shapes would appear with the following parameters. For Warp nodes with more source/target shape pairs defined, there will be more shapeName and connectionName parameters listed.

  • displayImage: A pop-up menu that allows you to choose whether the Viewer displays the Source image or the Warped image. The Warped image will be neither displayed nor rendered if this pop-up isn't set to Warped image.
  • overallDisplacement: Defines the amount of displacement that is applied to all source/target shape pairs simultaneously. A value of 0 applies no displacement,.5 applies displacement halfway between the source and target shapes, and 1 applies the maximum displacement to match the target shape. It is also possible to set this parameter to a value greater than 1, although this results in an overlapping displacement which may not be desirable.
  • When creating a warp effect, you may achieve a more realistic or organic effect if you adjust the displacement of each individual source/target shape pair separately, rather than relying on this single control to animate the displacement of every shape pair in the node.
  • addBorderShape: A toggle control that allows you to use the border of the image as a control shape to limit the effect of the warping effect. By default this is turned on, and is the recommend setting for most cases. Turning this control off results in each source/target pair having a considerably more exaggerated effect on the image, and may necessitate the use of additional boundary shapes to control the effect.
  • overSampling: An integer value that represents the numbers of samples per pixel that are taken into account when performing a warp. This parameter is set to 1 by default, which results in faster rendering times. However, extreme warping effects may introduce aliasing artifacts that can be reduced or eliminated by increasing this value, up to a maximum value of 4. Increasing this parameter may cause render times to increase dramatically.
  • Although the slider is limited to a range of 1 to 4, you can enter larger values into this parameter's text field.
    • dodPad: A subparameter of overSampling. This slider lets you pad the DOD around the image affected by the Warper node by 0 to 100 pixels. The Warper node trys to automatically calculate a new DOD for the affected image, but in certain instances the resulting DOD may be too small. In these instances, the dodPad parameter lets you expand an incorrectly calculated DOD to avoid clipping.
  • shape1Name: In this example, the shape1Name parameter represents the source shape. Additional controls in all shape parameters allow you to turn the shape on or off, make the shape itself visible or invisible in the Viewer, Lock the shape to prevent any further changes to it, or delete the shape.
  • shape2Name: In this example, the shape2Name parameter represents the target shape. Each target shape has a corresponding shapeName parameter.
  • connection1Name: Connection parameters represent both connection lines that connect source shapes to target shapes, and boundary shapes that you've defined. Deleting a connection parameter deletes either the corresponding connection line, or turns a boundary shape back into an unassigned shape.
    • connection1Displacement: This subparameter of the connection1Name parameter defines the amount of displacement that is applied to the source/target shape pair defined by the connection1Name parameter. Each source/target shape pair has its own corresponding connectionDisplacement parameter, allowing you to animate each warp independently for a more organic, natural look. By default, each connectionDisplacement parameter is linked to the overallDisplacement parameter, so that they all animate together.

A Warper Node Example

The Warper node is extremely flexible, and can be used for a wide variety of image distortion or manipulation tasks. In this example, we'll use the warper to change a dog's facial features.

To warp an image:

Attach the Warper node to an image.

 

First, draw and, if necessary, animate your source shapes.

These shapes define the parts of the subject you want to warp. When you're ready to finish your shape, do one of the following:

  • Click on the first point if you want to create a closed shape.
  • Double-click when creating the last point to create an open shape.
  • To create a single-point shape, immediately after creating your first point right-click and choose Finish Shape from the shortcut menu.

To add additional source shapes to define additional areas of the subject to warp, click the Add Shape button. Each shape you create using the Morpher node is yellow, indicating that it's unassigned and does not yet have any effect on the image.

 

Next, you need to create a corresponding target shape for each source shape you created. Target shapes define the contour of deformation that the pixels identified by each source shape are moved to. You create target shapes using the same shape-drawing techniques you used to draw the source shapes in step 2.

Another technique you can use to create a target shape quickly is to duplicate the source shape by right-clicking it and choosing Duplicate Shape from the shortcut menu. You can also choose Duplicate and Connect Shape ( Control or Command + D ), in which case you can skip step 4. If you're using either of these options, you may want to be sure you animate the original source shape first, as the copied shape inherits the animation. This could save you some keyframing.

As you create target shapes for each source shape, they remain yellow to indicate that they're still unassigned, and have no affect on the image.

 

To create the actual warping effect, you have to connect the shapes you created a pair at a time. First, Click the Connect Shapes button.

 

Now, click a source shape that follows the actual position of the first feature you identified. Then, immediately click the corresponding target shape you created. After the second click the source/target shape pair is defined, the shape colors change, and a connectionName parameter appears in the Parameters tab. Since the overallDisplacement parameter defaults to 1, the effect is immediately seen.

Once connected, source shapes become light blue, target shapes become dark blue, and the connection lines between them become purple. These colors can be customized, if necessary.

 

If necessary, adjust the connection lines running between the source and target shapes by clicking the Edit Connections button.

 

Drag the source and target connection points and slide them along the shape to change the angle of deformation necessary to create the effect you need. In this example, the connection lines are straighted in the eyes.

 

If necessary, adjust the amount of warp by modifying the overallDisplacement parameter in the Parameters tab. You can also adjust the displacement of each source/target shape pair individually using the connectionDisplacement parameter in that pair's connectionName parameter.

A value of 0 in the overallDisplacement parameter results in an unwarped image. A value of.5 produces a warp that's halfway in-between the source and target shapes, and a value of 1 results in a warp that completely conforms to the target shape.

To see the actual warp effect, choose Warped Image from the Select Display pop-up menu in the Viewer Shelf (you can also press the F3 key).

Tip: In addition to viewing the actual warp effect, you can make the Displaced Target Shapes visible in the Viewer Shelf to view the actual position of the displacement targets as defined by the overallDisplacement and connectionDisplacement parameters. These indicators are designed to help you see what the deformation will be without having to render the entire image. Displaced target shapes are pink by default.

 

This example displays a characteristic of the warper--it works as if the image is made of a sheet of rubber and you're actually pushing the pixels of the image around, stretching the surrounding image. In the above image, the pixels of the eyebrow are moved up because they lie directly on the source shape which defines the warp. You'll also notice that the right edge of the eyebrow appears to stretch back to the original position of the eyebrow. This is because the pixels surrounding the eyebrow are stretching to fill in the areas of the image where the eyebrow used to be. If the effect is not what you want, try experimenting with a differently shaped source shape to redefine the area of the image being manipulated.

You'll notice that, in addition to the eye and eyebrow being warped, a significant area of the face surrounding the source/target shape pair is also affected, and the top of the head is pushed upwards. To limit the warping effect to the region immediately surrounding the eyes and eybrows, create one or more boundary shapes.

First, select the Source image from the Select Display Image pop-up menu in the Viewer Shelf. This allows you to draw your boundary shapes to match features in the original image. Draw more shapes identifying the areas of the source image you wish to lock down. Boundary shapes can be either open, closed, or single-point shapes, depending on how much of the image you want to lock down. In this instance, we want to exclude the entire image from the warp effect except for the eye, eyebrow, and surrounding region, so a closed shape is drawn surrounding this area. After it's drawn, it remains yellow to indicate that it's still unassigned and has no effect.

Control or Command -click the shape you just created, and choose Set to Boundary Shape from the shortcut menu. This effectively sets this shape to be both a source and target shape, which pins that area of the image down.

 

Now, you'll probably need to make adjustments to refine the effect you're trying to achieve. It'll probably be helpful to use the visibility and lock toggles to assist you when manipulating the shapes, to make sure you don't accidentally adjust the wrong points when two shapes overlap. You can use the controls in the Viewer Shelf to change the visibility and locking of all shapes of a given type simultaneously, or you can set the visibility and locking of each shape individually in the Parameters tab.

Using the Parameters tab controls for each individual shape, you may rename the shape, enable it, toggle its visibility, lock the curve so it is visible but can't be modified, or delete it. Additional parameters also appear for each connection line and boundary shape definition you've set up.

To create an animated effect, keyframe the overallDisplacement parameter to animate every source/target shape pair simultaneously. You can also animate the displacement caused by each source/target shape pair you've defined individually. Click the disclosure control next to a connectionName parameter to reveal its connectionDisplacement parameter. This can create a more organic-looking effect.

Warper Node Syntax

Synopsis

image Warper(
image In,
const char * version,
const char * displayImage,
float overallDisplacement,
const char,
int oversampling,
const char * viewerStateInformation,
int connections,
const char * encodedInformation,
);

Script

image Warper(
In,
"version",
"displayImage",
overallDisplacement,
oversampling,
"viewerStateInformation",
connections,
encodedInformation,
);

Command Line

This node is not appropriate for command line use.