Using Shake's shape-based Morphing node, you can easily create Morphing effects by warping source and targe images to match one another using tools very similar to those used by the RotoShape node. Using shapes, you can deform two images to conform to shapes you draw in the Viewer, and then dissolve between them to create the illusion of the source image turning into the target image.
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. As a result, memory usage may become an issue when warping and morphing large images with multi-threaded processing enabled. In this situation, 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:
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.
The Morpher 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.

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.
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."
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."
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.
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 or morph not only affecting the intended subject, but also the surrounding background.
This aspect of the Shake Morpher 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 or morph 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.
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.
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.
When a Morpher node is selected, the following buttons appear in the Viewer Shelf.
The Morpher nodes has the following controls.
The biggest difference between drawing shapes with the RotoShape node and the Morpher node 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.
Click the Parameter control of the 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 morph.
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:

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.
Once you've created a shape, there are several ways you can modify it. These techniques also work for keyframing shapes used for animated morphing 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.
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:
When the selected points are hilighted, rearrange them as necessary by doing one of the following:
Using the transform control without the Shift key pressed modifies the entire shape, regardless of how many points are selected.
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.
Select the point or points you want to remove.
Those points disappear, and the shape changes to conform to the remaining points.
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.
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.



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:

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 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.
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.
Click the Visibility toggle control in the Viewer Shelf that corresponds to the shape type you want to hide.
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.
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.
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.
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.
The pasted shape appears just like any other newly created closed shape, and you can modify or duplicate it as necessary.
To create the actual morph 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.
Click the Connect Shapes Mode button.
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.
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.
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 morph effect. You can also add more connection lines to increase the amount of control you have over the morph effect.
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.
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.
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.

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.
Do one of the following:
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.
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.
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."
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.
Click the guiSettings disclosure control to open the guiSettings parameters.
To access different shape customization controls, do one of the following:
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.
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.
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:
The Morpher node blends two images together to create the effect of one subject changing shape to turn into another. The Morpher node does this by performing two warping operations, one on the source image to warp it into the shape of the target image, and another warping operation to warp the target image from the shape of the source back to its own shape. Once both warping operations match the shapes of the source and target images to one another, a built-in cross-fade dissolves from the first warp to the second, providing the illusion that the first image is changing into the second.
Successful warps benefit from planning ahead during the shoot. Ideally, the positions of the source and target images match relatively well. If they need adjustment, resizing, or repositioning to help them match better, you can make these adjustments in your node tree prior to adding the Morpher node.
If the source and target subjects are moving, their movements should match one another so that the warping targets you set for both can line up properly. If the motions line up but the timing is off, you can select the offending clip's FileIn node and use the Timing tab parameters to remap its speed so that the motion lines up. For more information, see the "Retiming" section of Chapter 3 of the Shake Reference Guide.
Since morphing warps images the same way the Warper node does, it is essential to isolate the subjects you're morphing prior to adding the Morpher node. This way, the background won't change as the source image morphs into the target, nor will the warp being applied to the subject of each image affect the background incorrectly.
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. Warp nodes with more source/target shape pairs defined would have more shapeName and connectionName parameters listed.
Create a Morpher node in the Node View, and attach two images to the Morpher node. The source image connects to input 1, and the target image connects to input 2.

In this example, we're creating the effect of the woman's face turning into that of the man. The image of the woman is the source, connected to the morpher1.In knot of the Morpher node. A composite of the man's face and the woman's head is used as the target, which is connected to morpher1.Target knot.


Note: Images courtesy of "Doppelganger."
If the images need to be manipulated to make them line up, do this first. In this example, a series of transform nodes have been inserted between the FileIn and Morpher nodes to move, scale, and track the target image to align properly with the source image. This is essential to creating a smooth morphing effect.
If it is necessary to isolate the subject of the source and target images by keying or rotoscoping, you may want to insert these nodes prior to the Morpher node also. In this example, the source image will be keyed. The target image has been rotoscoped to isolate just the face, and the isolated face has been composited with the woman's head to create the desired effect.
First, move the Playhead to the first frame of the clip where you want the morph effect to take place, set the Viewer to look at the Source image, and draw all Source shapes necessary to match the features of the subject, just as you would for the Warper. If necessary, animate your shapes to follow the animation.
You can quickly jump to the Source image by pressing F1 .
The more features you identify with source shapes, the more detailed the morphing effect will be. You should remember that warping affects the entire region of the image surrounding each source/target shape pair. While it's important to create shapes for each significant feature of the image, you don't have to go overboard creating shapes for every tiny feature of the subject image, unless it will enhance the effect you're trying to achieve.
When picking features to manipulate, keep in mind that the source shapes you define are pushing and pulling the corresponding image features into the shape of the target. Pick features that have a direct path to similar features in the target image if at all possible to avoid unwanted artifacts in the image.

Once you've created all the source shapes you think you need, set the Viewer to display the target Image. You can quickly jump to the Target image by pressing F2 .
To create a set of target shapes to connect to the source shapes you created in step 3, do one of the following:

Tip: It may also help to turn off the Enable/Disable Shape Transform Control in the Viewer Shelf, to avoid accidentally dragging Transform controls that overlap the shape you're trying to adjust.
When readjusting the target shapes you've created, the sheer number of shapes needed to create your morphing effect may make the Viewer a little crowded, making it difficult to adjust individual shapes. You may find it's easier if you hide every shape except the one you want to work on. You can hide all of the target shapes by right-clicking in the Viewer and choosing Hide All Shapes from the shortcut menu. Afterwards, right-click again and choose the first target shape you want to work on to show it again. Continue hiding and showing individual shapes as necessary until you've adjusted them all.

If necessary, animate the target shapes you've just created to match any motion in the target image.
The overallDisplacement parameter controls how much warp is applied to push the pixels from the source shapes to the target shapes you've defined, and operates on all source/target shape pairs in the node simultaneously.

To animate the morphing effect, keyframe the overallDisplacement parameter. To see the morphing effect in the Viewer as you adjust the overallDisplacement slider, you must choose Morphed Image in the Select Display pop-up menu of the Viewer Shelf. You can also set the Viewer to display the Morphed Image by pressing F3 .
To add a new keyframe, move the playhead to a frame where you want to make an adjustment, click the auto-keyframing control for the overallDisplacement parameter in the Parameters tab, and adjust the overallDisplacement slider.
A value of 0 in both the overallDisplacement and overallDissolve parameters results in an unmorphed source image. A value of .5 produces a morph that's halfway in-between the source and target images, and a value of 1 results in the end of the morph, the final target image.
While you adjust these parameters, 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, instead of viewing the actual warp effect. 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.
As with the Warper, you may adjust the individual displacement of each source/target shape pair using the connectionDisplacement and connectionDissolve parameters nested within each connectionName parameter in the Parameter tab. Keyframing these with separate timings is one of the keys to creating an organic looking Morph effect, and usually creates a more sophisticated-looking effect than if you simply used the overallDisplacement to animate every shape pair at once.
If you want, you can keyframe the overallDissolve parameter separately from the overallDisplacement parameter to create different effects. Adjustments to the overallDissolve parameter control how the source image fades into the target image--this works exactly like a Mix node.
By default, the overallDissolve parameter is linked to the overallDisplacement parameter, so keyframing one will automatically keyframe the other to the same value. Keyframing the overallDissolve parameter will break this link.
Test the resulting effect to see how well it works. If you see problems, toggle the Viewer between the Source Warped image and Target Warped image to see how successfully the warped source and target images are matching. Viewing each image independently makes it easier to spot unwanted artifacts stemming from poorly placed or inadequate numbers of source/target shape pairs.
If you see problems, either adjust the position and shape of the source and target shapes as necessary, or identify additional features to create source/target shape pairs for to increase the amount of control you have over the effect
image Morpher(
image In,
image Target,
const char * version,
const char * displayImage,
float overallDisplacement,
float overallDissolve,
float overallWeight,
float tension,
const char * alpha,
int oversampling,
const char * viewerInformation,
int connections,
const char * encodedInformation,
);
image Morpher(
In,
Target,
"version",
"displayImage",
overallDisplacement,
overallDissolve,
overallWeight,
tension,
"alpha",
oversampling,
"viewerInformation",
connections,
encodedInformation,
);