Introduction to ConnectFX - Autodesk Smoke Essentials: Autodesk Official Press (2014)

Autodesk Smoke Essentials: Autodesk Official Press (2014)

Chapter 8. Introduction to ConnectFX

In this chapter, you’ll create your first simple composite using ConnectFX, the powerful node-based compositing tool integrated tightly within Autodesk® Smoke® software. When you need to do something more complicated than what can be easily accomplished using timeline effects, ConnectFX (CFX) provides an environment within which you can create intricately detailed multilevel composites. In addition, there are many more effects tools available within the CFX editor that you can use to fix problems and create visual magic.

Topics in this chapter include the following:

· Applying ConnectFX to a clip

· Understanding the CFX editor

· Looping and extending clips using the MUX node

· Dealing with log-encoded media in CFX

· Assembling a process tree

· Match moving with the 2D Transform node

· Rotoscoping with the GMask node

· Changing the Blend mode and adding blur

Applying ConnectFX to a Clip

In this section, you’ll take the first step toward putting together a composite using ConnectFX. You will accomplish this by editing together the principal clips you want to use onto the timeline and then sending all of them to the ConnectFX editor as the starting point of your node tree:

1. Launch Smoke, and open the Opening Scene sequence that you worked on in Chapter 7.

2. Before you do anything else, delete the two transitions that are on either side of the third clip in the timeline, since these will interfere with this exercise. You’ll put these back in later.

3. Press Option+2 to put the viewer into Source-Sequence mode, and then select the EyeInterface clip to open it in the source viewer, as shown in Figure 8.1. (It’s in the Opening Graphics Elements folder of the Office Media folder inside the Office Scene Library.)

Figure 8.1 The EyeInterface clip that you’ll be using to create an animated contact lens effect

Source: Design and animation by Brian Olson

image

4. Play through the EyeInterface clip from the beginning, and mark an in point where the graphic zooms up to its full size.

5. Move the positioner in the timeline to the third clip and the focus to track V1.1, and then press X to set in and out points to match the third clip. Remember, you can move the focus up and down by dragging it directly in the timeline, by clicking the video track indicator button all the way to the right in the timeline patch panel area, or by pressing Page Up or Page Down.

6. Press Page Up to move the focus to track V1.2, and press F10 (or click the Overwrite Edit button) to edit the EyeInterface clip into clip V1.2. It’s not long enough to cover the entire duration of the third clip, but that’s OK; you’ll deal with this later.

7. Now Shift+click both the third clip in track V1.1 and the superimposed clip you just edited into the timeline to select them both. Then click the FX button to open the pop-out Video Effects menu, make sure that the Generate Composite check box is checked, and click the Create ConnectFX button.

The ConnectFX editor opens, and the two clips you selected appear within — automatically assembled into a node tree within the ConnectFX Schematic that creates a simple composite that’s equivalent to what was in the timeline. This tree can be seen in Figure 8.2.

Figure 8.2 Creating a ConnectFX effect using two selected clips in the timeline

image

In the following sections, you’ll use these two clips to create the effect of the animated contact lenses, which provide a heads-up computer display for this character throughout the rest of the movie.

Understanding the CFX Editor

The ConnectFX editor is divided into several sections, some of which were briefly discussed in Chapter 2. In this section, you’ll get a more detailed view of the different areas of the CFX editor that you’ll be using to create and refine effects in Smoke.

The Viewport

By default, the viewport at the top contains the ConnectFX Schematic on the left and a viewer on the right that shows the CFX output result. Both of these are within a 2-Up display. You can drag any border between each viewer in the display to resize it. For example, dragging the border shown here lets you create more room for nodes at the expense of shrinking the viewer (see Figure 8.3).

Figure 8.3 The ConnectFX Schematic and CFX output viewer in a 2-Up view

image

The Viewport Layout pop-up menu at the bottom-left of the viewport lets you choose among several multipaned layouts (see Figure 8.4).

Figure 8.4 Different options available for the viewport

image

You can alter the contents of any pane by clicking within it to select it and then choosing another option from the View pop-up menu that’s at the bottom-right of the viewport. An accompanying zoom control lets you resize the currently selected pane. If you’re creating a complex node tree or doing 3D compositing, it can help to have multiple schematics and viewers showing different angles of the composition, but the exercise in this chapter can be easily accomplished using the default 2-Up view.

The same keyboard shortcuts that let you choose different viewer layouts also let you choose different viewport layouts in the CFX editor. Option+1 through Option+4 let you choose the 1-, 2-, 3-, and 4-Up layouts.

FX Node Bins

Underneath the viewport are the FX node bins (see Figure 8.5), which contain every type of node that’s available for doing compositing and effects work. The first tab contains every single node that’s available for use in the ConnectFX Schematic, but other tabs expose subsets of these nodes that are specific for a particular use.

Figure 8.5 The ConnectFX nodes

image

Create your own tab containing a custom subset of nodes by clicking the + button at the right of the existing tabs; you are immediately prompted to name the tab. Drag whatever nodes you want to add to it from other tabs onto the tab you created.

If anything else is being displayed at the bottom of the CFX editor, you can always show the FX nodes again by clicking the FX Nodes button underneath the viewport to turn it back on. Turning it off reveals the parameters of the currently selected node in the ConnectFX or Action Schematic.

The I/O Node Tab

The I/O tab to the left of the node bins, shown in Figure 8.6, contains three types of nodes, each of which serves a very different purpose.

Figure 8.6 The I/O node bin

image

These nodes are special in that they provide the source of the image-processing pipeline described by the node tree of the ConnectFX Schematic. Following is a description of each node:

You can double-click any Read File node that’s currently selected in the ConnectFX Schematic to relink it if it’s disconnected or to choose a completely different clip for that node to read into the composite.

Read File Read File nodes add clips to the CFX processing pipeline, not from the Media Library (like a typical clip node) but directly from the filesystem. Since Read File node clips reference files in the Finder directly, overwriting files in the Finder results in those clips being automatically updated within your CFX composite. Clips that you add to a CFX composite from the Media Library are clip nodes, and they reference the linked media that you’ve imported into Smoke.

MUX Adding a MUX node to a clip node lets you create freeze frames, as well as provide options to extend the beginning and end of clips using freeze frames or ping-pong looping (which you’ll use in the next exercise).

Back Clip Adding a Back Clip node to the beginning of a node tree provides a way of reading in whatever clips are in the timeline underneath the clip, with the current ConnectFX composite applied to it. This is useful if you want to access the contents of the timeline when a clip being composited in ConnectFX is superimposed over another clip that might change, or when you’re applying ConnectFX to a gap as an adjustment segment that works as an otherwise blank layer that applies its adjustment to all clips falling underneath it. (Some applications refer to this as anadjustment layer.)

Node Parameter Editor

The bottom area of the CFX editor changes based on the node you’ve selected within the ConnectFX or Action Schematic. For example, if you double-click the Resize node, you’ll see the parameters shown in Figure 8.7.

Figure 8.7 The Parameter editor

image

Additionally, a row of buttons at the left of this area (see Figure 8.8) lets you expose different editors that can be used to alter other aspects of your composited effect.

Figure 8.8 Buttons that let you open additional CFX editors

image

To access any of these additional sets of controls, click the corresponding button to turn it on. To go back to displaying the node parameters of the currently selected node or the FX node bins, click that button again to turn it off.

CFX Prefs and Node Prefs

The CFX Prefs button provides access to Rendering settings for enabling proxies and hardware acceleration, environmental preferences governing which panes of the viewport output audio, the range of the timebar, and the operation of schematics.

The Node Prefs button gives you access to the operational preferences of nodes, such as the Action node, that have them. For example, when an Action node is selected, you have access to the resolution and bit depth of that Action node’s internal compositing environment: its rendering, anti-aliasing, and motion blur settings. You also have access to node-specific preferences, as well as to adaptive degradation settings that let you specify which processor-intensive operations to disable temporarily when making interactive adjustments. For more information on Action node preferences, see Chapter 9, “Using the ConnectFX Action Node.”

Animation Editor

The Animation editor is a curve editor that you can use to graphically edit keyframes that have been applied to different node parameters for creating animated effects.

You don’t have to use the Animation editor to animate effects, because the Node Parameter editor exposes keyframing controls that let you place effect keyframes within the CFX scrubber, located underneath the transport controls. However, if you are keyframing an effect, the Animation editor gives you a much more precise environment for making careful adjustments.

Timing Editor

Clicking the Timing button shows you a miniature timeline containing only the clips that are used in the current CFX composite in a stack that lets you adjust each clip’s temporal offset relative to the current composite. This lets you see the current duration of the CFX composite, shown by the in and out points, as well as the overall duration of unused clip media falling outside this duration.

Additionally, you can do some simple editing using Trim mode to make individual clips shorter or longer and Slide mode to change the range of each clip’s media that appears within the composite.

Looping and Extending Clips Using the MUX Node

If you play through the entire composite using the available transport controls or their keyboard equivalents, you should notice that the animated contact lens graphic cuts off near the end, leaving only the underlying close-up of the woman’s eyes. You need the graphic to be the same length as the actor’s close-up for this composite to work. To deal with this, you’ll need to use the MUX node, found in the I/O tab, to extend its length by looping it using a ping-pong operation:

1. First, drag the nodes in the ConnectFX Schematic to space them out a bit, since the default node tree that was automatically created is a bit messy. In particular, create a space between the EyeInterface Clip node and the Resize node immediately to its right. When working, it’s always a good idea to keep your nodes tidy and organized.

2. Click the FX Nodes button, if necessary, to open the node bins.

3. Drag a MUX node out of the I/O tab and into the ConnectFX schematic, dropping it onto the red link line that connects the EyeInterface node to the Action node, as shown in Figure 8.9.

Figure 8.9 Connecting the MUX node to a Clip node using the Option key

image

The node is inserted between the Clip node and the Resize node, which means that the MUX node intercepts the EyeInterface animation being read in, processes it, and feeds the result to all of the other nodes in the schematic.

4. Double-click the MUX node to expose its parameters at the bottom of the CFX editor. Turn on the Active button in the FX Range group.

The FX Range controls let you set up whether anything appears before the beginning or after the end of the current range of image data being imported for that clip.

5. Drag the positioner within the timeline to the last frame where the EyeInterface graphic is visible. Then drag the To parameter’s slider to the left, moving the out marker for the looping effect you’re about to create to coincide with the last frame of the animation (this should be frame 82).

Using the From and To parameters, you can choose a specific range of media to loop using the MUX node’s Before and After options.

6. Click the After pop-up menu, and choose Ping Pong+. The settings should appear as they do in Figure 8.10. Now if you play through the entire range of the composite, you can see that the EyeInterface animation plays forward, and when it reaches the end, it starts to play backward to cover the gap left by the end of the animation.

Figure 8.10 The MUX node’s parameters

image

Ping Pong plays the last frame of a clip being looped forward, then backward, and then forward again twice, which could cause that frame to appear to stutter. Ping Pong+ eliminates this duplicate stutter frame, providing smooth, continuous playback.

Now that you’ve found a creative way of matching the duration of the graphic to that of the woman’s close-up, it’s time to start compositing these elements together.

Dealing with Log-Encoded Media in CFX

All of the media in this program is log-encoded, which makes the clips themselves appear to be low contrast and colorless. So far, you’ve dealt with this by setting the different viewers in Smoke to display in Log mode, which normalizes the image to appear as it should in the sRGB of your monitor or the Rec.709 colorspace of an external monitor connected via an AJA or Blackmagic video interface.

However, when you’re compositing in ConnectFX, you’ll often want to normalize the image data itself so that various processes work better. For example, you may get better results from the stabilizer or from the Master Keyer nodes if you use them on media with higher contrast and a wider range of color. This can be set up in the clips that need it.

1. Double-click the Clip node of the woman’s close-up to open its parameters at the bottom of the CFX editor.

2. Click the RGB LUT button at the left of the screen, choose Log To Lin from the Conversion LUT Type pop-up menu, as shown in Figure 8.11, and click the Activate button to turn this effect on.

Figure 8.11 Using the RGB LUT options in a Clip node to normalize a log-encoded clip for CFX compositing

image

From this point forward, the image data of the woman is not log encoded, and you can work with it as you would any other video image. However, if the ultimate goal is to export a log-encoded version of the finished program, then you’ll want to select the CFX node to show its parameters and set its Conversion LUT Type pop-up menu to Lin To Log to change the final composite to Log. This converts the image data of the clip so that it matches the rest of the sequence.

Assembling a Process Tree

The process tree, or node tree, as shown in Figure 8.12, which was created by Smoke to combine the two clips you had superimposed in the timeline, is a standard way of creating a composite.

Figure 8.12 A ConnectFX process tree

image

Pretty much every node tree works from left to right, with Clip nodes adding media to the composite. Then a progression of nodes, connected via links (the lines with arrows pointing to the right), apply specific adjustments to process the image being propagated along each branch of the tree. In this example, the EyeInterface clip is processed by the MUX node and then processed by the Resize node.

When two or more nodes need to be combined to create a new image, a multi-input node, such as the Action or Blend & Comp node, is used. In Figure 8.12, you can see that the post-resized EyeInterface clip and the woman’s close-up are both fed into the Action node.

Once you’ve added all of the nodes necessary to create the final effect, the end result is linked to the CFX node, which is what feeds the final result back to the Smoke timeline as a clip. If the CFX node is not connected, there will be no effect.

However, the Action node is one of the more complicated and processor-intensive ways of combining two images. In the following exercise, you’ll use the simpler Blend & Comp node to integrate the EyeInterface animation and the woman’s close-up to composite them together.

1. To disconnect the Action node that you don’t want, click and drag to draw a red line across the green, blue, and red lines connected to the Action and media1 nodes, as shown in Figure 8.13. Then draw another red line across the link connecting the Action node to the CFX node.

Figure 8.13 Severing link lines to disconnect nodes by drawing a line across them

image

2. To delete the Action node and its accompanying media1 input, Shift+click the Action node to select it and all nodes attached to it, and then do one of the following:

· Select a node, and press the Delete key.

· Right-click one of the selected nodes, and choose Delete.

· Drag one of the selected nodes down to the bottom of the screen until the trashcan cursor appears and drop it.

Now that you’ve removed the unwanted Action node (which will be covered in greater detail in Chapter 9), it’s time to add its replacement, in this case the Blend & Comp node.

3. Turn on the FX Nodes button; then hover the pointer over the node bin and press the B key. All nodes that don’t start with the letter B are grayed out, making the Blend & Comp node easier to see (see Figure 8.14).

Figure 8.14 Highlighting nodes starting with the letter B by pressing the B key

image

4. Drag the Blend & Comp node into the ConnectFX Schematic pane of the viewport, and drop it onto the space left by the deleted Action node. Before going any further, we’re going to examine the node connections that appear in Figure 8.15 in more detail.

Figure 8.15 Inputs and outputs of the Blend & Comp node

image

Each node has a set of input tabs on the left and a set of output tabs on the right. Each of these inputs and outputs is color-coded:

Red Tabs Front, the image data you’re passing from one node to the next.

Blue Tabs Matte, a channel containing transparency data created by a GMask or a curve, although any grayscale high-contrast image can be used as a matte.

Green Tabs Back, a special image channel that appears as a layer behind all of the front channel layers. The Back channel also serves as the channel to be tracked when using Stabilization within the Action node.

Yellow Tabs Nodes output image data via a yellow output tab. Many nodes also output a separate blue Matte tab as well, so that one node processes both the Image and Matte channels.

Gray Tabs Some nodes, such as the Depth of Field node, have additional special inputs that are colored gray. In the case of Depth of Field, the middle gray tab lets you input a z-channel depth matte for use in defining artificial camera defocusing based on distance from camera.

Hovering your pointer above a node’s tab displays a tooltip explaining exactly what the tab does. In the case of the Blend & Comp node, there are five input tabs: Front and Matte, Front2 and Matte2, and Back. These inputs let you layer one image with its matte on top, a second image and its matte underneath, and a third back image appearing at the very bottom, compositing up to three images together in total.

5. Connect the EyeInterface node’s yellow output tab to both the top Front and Matte input tabs of the Blend & Comp node, and then connect the yellow output tab from the woman’s close-up to the green Back input tab of the Blend & Comp node using any of the four following techniques:

a. Click the output tab of one node, and then click the input tab of another node to create a link automatically (see Figure 8.16).

Figure 8.16 Clicking two tabs to create a link, before and after

image

b. Drag a link from one node’s output tab onto another node’s input tab (see Figure 8.17).

Figure 8.17 Dragging a link from one tab to another

image

c. Hold the Option key down while dragging a node, and touch that node’s output tab to another node’s input tab to “kiss” the nodes, creating a link (see Figure 8.18).

Figure 8.18 “Kissing” two nodes while holding the Option key to create a link

image

d. While dragging a node, press Shift+Option to display a connection “arm” that makes it easier to connect one specific node’s input to another node’s output. Holding Option and pressing Shift repeatedly toggles this handle among a node’s Front, Back, and Matte inputs.

It’s very important that you connect each image’s output tab to both the Front and Matte input tabs; otherwise, the Blend & Comp node won’t work properly. This may seem strange until you bear in mind that the Blend & Comp node (as well as other nodes, such as the MasterK keyer node) requires the matte of the image, even if it’s completely opaque, to be calculated into the composite being made. However, if you really don’t want to have to connect the matte input, you can turn off the matte of either input using the Blend & Comp node’s controls.

6. Connect the Blend & Comp node’s yellow output tab to the red CFX input tab, and then move the positioner to the first frame of the timeline. When you’re finished, the node tree and result viewer should look something like Figure 8.19.

Figure 8.19 The EyeInterface graphic composited against the woman’s close-up using the Blend & Comp node

image

Match-Moving with the 2D Transform Node

So now you have your composite. However, the EyeInterface animation needs to be match-moved to follow the camera’s motion so that it looks like it’s actually attached to the woman’s face and then transformed to fit inside the woman’s eye before you can create a convincing effect. This can all be accomplished using the 2D Transform node.

1. First, drag a 2D Transform node into the ConnectFX Schematic; then hold the Option key down and touch its red and blue front input tabs to the yellow output tab of the woman’s close-up node to create a link.

2. Double-click the 2D Transform node to open its parameters at the bottom of the CFX editor, and then click the Stabilization tab to expose the stabilizer parameters and controls.

3. Click the Enter Stabilizer button to open the stabilizer, and then choose Fit from the viewer’s Zoom pop-up menu so that you can see the entire image.

4. Drag the two tracker boxes to the inner corners of the woman’s eyes.

5. Make sure that the positioner is at the beginning of the timeline and click Analyze. The tracker boxes should follow along with the woman’s eyes as the camera pans across her face, leaving a series of tracking points that form a motion path, as shown in Figure 8.20.

Figure 8.20 The motion path formed by the tracking points created by stabilization

image

You should notice that there are dips in the motion path that correspond to every time the woman blinks. Scrubbing along the timeline should confirm this. These could cause unwanted twitches in the track, but fortunately they’re easy to remove.

6. Click the Animation button at the left to open up the Animation editor. A series of hierarchical disclosure triangles inside of the light-gray graph in the middle show every parameter available to the current scene.

7. Click the triangles to the left of tracker1 and tracker2 to view the parameters within, and then click the triangles to the left of the Shift parameters for tracker1 and tracker2 to reveal the graphs for each tracker.

8. At this point, the unwanted bumps in the graph can be hard to see, so do the following to resize and pan around the data:

· Hold Control+Option down and drag with the pointer in the Animation editor to zoom and resize the graphs. Drag up to zoom into the Y-axis to make it easier to see the bumps.

· Hold Control+Command down and drag with the pointer to pan around the Animation editor, moving the data around.

You should zoom and pan around the graph until it looks something like Figure 8.21.

Figure 8.21 The Shift parameter in the Animation editor lets you see the tracker’s results.

image

9. Now that you can see the bumps in the tracking data, choose Delete from the Tools pop-up menu underneath the viewer, and then click the Shift parameter in the Animation list to select that curve and drag a bounding box around the clump of control points at each bump to delete them (seeFigure 8.22).

Figure 8.22 Deleting tracking points from each selected Shift graph using the Delete tool

image

10. Do this for the Shift parameters of tracker1 and tracker2, and you’ll end up with a smoother graph where the motion data is automatically interpolated wherever you deleted the unwanted tracking data (see Figure 8.23).

Figure 8.23 A smoother motion path after deleting unwanted tracking data

image

11. Click the Animation button again to go back to the Stabilizer controls, and then click the RETURN button to go back to the CFX editor.

12. Break the link connecting the 2D Transform node to the woman’s close-up, and then drag and drop it on top of the red link between the Resize node and the Blend & Comp node to insert it into the EyeInterface branch of the process tree. Connect the Resize node’s yellow output tab to the 2D Transform node’s blue Matte input, and connect the 2D Transform node’s blue output tab to the Matte input of the Blend & Comp node.

You may need to rearrange the node tree again to keep things neat. When you’re finished, the node tree should look something like Figure 8.24.

Figure 8.24 Moving the 2D Transform node into the schematic

image

13. With the 2D Transform node’s parameters open to the controls in the Stabilization tab, click the Invert Stabilization button to transform the EyeInterface animation to follow along with the camera motion that you analyzed in the previous steps.

With Invert Stabilization off, Stabilization transforms the image to eliminate motion in the frame. With Invert Stabilization on, Stabilization works as a Match Move operation instead.

At this point, if you don’t see both input images composited in the viewer at the right, select the right-most pane and choose CFX Result from the View pop-up menu (or press the 0 key).

Use keyboard shortcuts to activate different views in the currently selected viewport pane. Press F4 to see the currently selected node’s result, press 0 to see the CFX node result, and press Control+Escape to see the ConnectFX Schematic.

14. To position the graphic to be better lined up with the woman’s eyeball, you need to transform the EyeInterface animation a second time. Open the FX node bins, and drag a second 2D Transform node into the graph, connecting it to the left of the first 2D Transform node so that the red and blue links go from the Resize node to the Front and Matte input tabs of the new 2D Transform node, which connects to the Front and Matte input tabs of the 2D Transform node that has the tracking data (see Figure 8.25).

Figure 8.25 Adding a second 2D Transform node to reposition and scale the EyeInterface graphic

image

Technically, you could do both of these operations within a single 2D Transform node, but there’s a good reason for keeping the track separate from the offset transform you’re about to do, which you’ll see shortly.

15. Click the new 2D Transform node to open its parameters, and use the Position, Rotation, and Scale controls to position the EyeInterface animation to match Figure 8.26 so that it looks like the animation is right on top of the woman’s iris.

Figure 8.26 Transforming the EyeInterface animation

image

Now, if you scrub through the timeline, the graphic should follow along.

What Is the Purpose of the Resize Node?

You’ll recall that when editing a clip into a sequence, if the clip has a different frame size or bit depth than the sequence, a Resize effect is added. When that clip was selected in the timeline to create a ConnectFX composite, the Resize effect appeared as a node.

At this point, you may be wondering why you need to add the 2D Transform node when there’s already a Resize node. That’s because the Resize node only alters the overall resolution and bit depth of an image; it’s not for rescaling or repositioning an image to a specific set of coordinates in the composite.

Some nodes that have multiple inputs require that each linked image have the same resolution and bit depth. For this reason, Smoke automatically adds Resize nodes to make the resolution of every image being read in identical.

Rotoscoping with the GMask Node

Now that the graphic is following along with the woman’s eye movement, the challenge is to make it look like it’s actually inside her eyelid. This is not necessarily simple, because she is blinking, so any solution you use must be animated as well. Fortunately, Smoke has a powerful rotoscoping and mask-drawing tool in the GMask node.

1. Click the FX Nodes button and hover the pointer over the All Nodes bin; then press G to isolate all nodes that start with G, and drag the GMask node into the ConnectFX Schematic underneath where the second 2D Transform and Blend & Comp nodes connect. You’re going to link the GMask node between these nodes, and you’ll probably want to drag the Blend & Comp and CFX nodes to the right to make some room.

At this point, the node tree is getting a bit big. Fortunately, the two methods of zooming and panning you used in the Animation editor also work in any pane of the viewport:

· Hold Control+Option down, and drag with the pointer to zoom in and out. Drag right to zoom in, and drag left to zoom out.

· Hold Control+Command down, and drag with the pointer to pan around.

You can zoom and pan schematics, viewers, graphs, and even the timeline using these keyboard modifiers, so they’re good to remember.

When rearranging nodes, Shift+clicking a node selects both that node and all upstream nodes to the left of it, making it easier to drag long branches of nodes around the schematic.

2. Connect the GMask node so that it fits between the second 2D Transform node and the Blend & Comp node, as shown in Figure 8.27, by creating the following links in the node tree:

Figure 8.27 Attaching the GMask node

image

a. Link the 2D Transform node’s Matte output tab to the GMask node’s Matte input tab.

b. Link the yellow output tab of the woman’s close-up to the GMask Front input tab. (You can link a single output to as many inputs as you like, but you can attach only one link to an input.)

c. Link the GMask output tab to the top blue Matte input tab of the Blend & Comp node.

Here’s the reason you’re connecting the GMask in this way. By attaching the image of the woman’s close-up to the GMask’s Front input, you’re setting up a reference image to trace while drawing the mask. Meanwhile, attaching the matte from the 2D Transform, through the GMask, to the Blend & Comp node enables the GMask you’re creating to modify the matte that defines the transparency of the EyeInterface animation.

Basically, you’re using the woman’s close-up to draw the mask while applying it to the EyeInterface layer. This ability to use each of the separate color and matte channels propagated through the Smoke node tree for a different purpose is one of the great advantages of node-based compositing.

3. To prepare for drawing a mask where you want it, make sure the positioner is at the beginning of the timeline. Then click the GMask node to show its controls, click the viewer pane, and choose GMask Inputs Front (F1) to view the Front input while drawing using the GMask tools. It’s also a good idea to Control+Option drag in the viewer to zoom into the woman’s camera-left eye to make it easier to trace it in detail.

Be aware that the controls for creating and animating masks (as shown in Figure 8.28) appear only when a viewer is selected. If a schematic is selected, these controls will be hidden. Furthermore, you can see mask shapes and control points only when you’re viewing the GMask inputs (to trace a Front input image) or GMask results (to modify a GMask relative to its final effect).

Figure 8.28 The GMask object controls appear only when a viewer is selected in the viewport.

image

4. To begin drawing a mask, do one of the following:

· Click the Add button (see Figure 8.28) to add a new draw object.

· Choose Draw Shape from the Tools pop-up menu underneath the viewport.

· Press Shift+C.

5. Click to add points to trace the inside of the woman’s eyelid. Smoke uses familiar Bezier drawing controls for creating masks:

· Click to add a new control point with an automatically calculated curve relative to the last point you drew.

· Click and drag to add a control point and adjust its curvature using Bezier handles.

· Click the first point you created to close a mask.

· Drag control points to modify the shape, or drag any point’s Bezier handles to customize the curve.

· Add or delete points, or modify Bezier handle tangents, using alternate tools found in the Tools pop-up menu underneath the viewport.

· Alternatively, pressing and holding the Shift key lets you draw a freehand shape. Draw all the way back to the first point you drew to close shapes drawn in this way. You can also draw freehand sections while drawing shapes the conventional way.

When you’re finished, the mask should look something like Figure 8.29. Keep in mind that whenever you draw a mask that will need to be animated, it’s good to use the fewest number of control points that you can get away with. Also, you’re principally concerned with where the eyelid will move over the EyeInterface animation.

Figure 8.29 The initial mask

image

This is a good start, but now that you have the initial state of the mask drawn, you’ll take advantage of the fact that the eye doesn’t really change shape (except for three blinks) to save some time using motion tracking. The GMask node is one of several with built-in Stabilizer controls for match-moving masks to follow a moving target, and you’ll use that feature now.

6. Click the Stabilizer button, drag the tracker box over the inner corner of the woman’s camera-left eye, and click the Analyze button, just as you did in the previous exercise. There’s no camera rotation, so one tracking point will be just fine. Click RETURN when it’s done.

Play through the clip, and you’ll see that the mask you just drew is now tracking nicely to follow the camera’s motion. Now all you need to take care of are the frames where the woman blinks, easily accomplished using the GMask’s keyframing tools, as shown previously in Figure 8.28.

7. For maximum efficiency, tackle this simple rotoscoping job in the following steps:

a. Move the positioner to the frame just before each blink starts, and click the Set Key button to create a keyframe. Then move the positioner to the frame just after each blink ends, and click the Set Key button to create another keyframe. At the end, you should have two keyframes defining the first frame before and the last frame after each blink, at which the mask should remain at its initial position. Keyframes appear as light blue lines within the timeline (see Figure 8.30).

Figure 8.30 Creating two mask keyframes at the beginning and end of each blink

image

b. Now turn on the Auto Key button. This puts Smoke into a mode where every adjustment you make creates a new keyframe. Be very careful what you do when Auto Key is turned on.

c. Move the positioner to the frame of each blink where the eye is most closed. (Her eye is never quite closed on camera, because the blinks are so fast.) Drag the mask control points to shorten the top of the mask to follow the movement of the eyelid (see Figure 8.31). You’ve just created an animated change from the open-eye mask keyframe to the closed-eye mask keyframe.

Figure 8.31 Adjusting the mask to follow the blink

image

d. Move the positioner frame by frame through the blink, and readjust the mask wherever there’s a gap between the mask and the contour of the upper eyelid. It’s a good rule of thumb to “divide by two.” In other words, start out placing new keyframes halfway between every two keyframes, which you’ve already created, to see if Smoke’s shape interpolation will take care of the rest.

e. Do this for each of the three blinks in this clip. When you’re finished, you should have keyframes in the timeline that look something like Figure 8.32.

Figure 8.32 Placing the fewest number of keyframes you can to animate the mask to match each blink

image

8. You should now be finished with the eye mask, so turn off the Auto Key button.

Leaving Auto Key accidentally on is one of the most common mistakes you can make; there’s nothing like placing an unwanted keyframe to make you wonder what you’re doing wrong. Always turn off Auto Key when you’re finished keyframing an effect.

9. With the viewer selected in the viewport, press 0 to set the View pop-up menu to the CFX Result so that you can see the overall composite, and choose Fit from the Zoom pop-up menu to see the entire frame.

With the positioner at the first frame of the timeline, you’re now seeing the exact opposite of what you want the matte to do (and it looks a bit spooky, actually). To set up the GMask so that it correctly masks out the edges of the EyeInterface animation to fit inside the woman’s eyelid, you need to turn on the Outside button and change the Colour parameter to 0, as shown in Figure 8.33.

Figure 8.33 Changing how the mask interacts with the matte that defines image transparency

image

Three controls define how each mask object interacts to define image transparency:

Outside This control determines whether a matte is created outside or inside the mask you’ve drawn.

Colour This control determines whether the mask creates a region that’s transparent or opaque.

Opacity This control determines how transparent or opaque the feathered edges of a mask are.

10. Finally, the edge where the GMask cuts off the graphic is a bit hard. Raise or lower the Offset parameter to offset the softness of the mask, softening this edge until it looks right. When you’re finished, the composite should look something like Figure 8.34.

Figure 8.34 The composite after using a mask to rotoscope the woman’s eyelid

image

Changing the Blend Mode and Adding Blur

At this point, the EyeInterface animation follows along with the woman’s eye, sitting inside her eyelid very convincingly. However, it still looks like a computer graphic rather than an integrated part of the scene. To finish the illusion, you’ll use the controls of the Blend & Comp node, as well as a Blur node, to create a more organic effect.

1. Click the Blend & Comp node to show its controls. There are three sets of controls corresponding to Input 1 (currently connected to the EyeInterface branch of the node tree), Input 2 (currently disconnected), and Result Output, which is currently set to Blend With the Back input (currently connected to the woman’s close-up).

The Blend & Comp node is an extremely powerful node; not only does it let you composite three images together all at once, but it also provides a multitude of Blend mode (or Transfer mode) options, individual color-correction controls for each layer, and color-correction controls affecting the overall output. In other words, it gives you a lot of bang for the buck.

2. Click the Blend Mode pop-up menu corresponding to the Result Output group, and choose Overlay (see Figure 8.35).

Figure 8.35 The Result Output’s Blend Mode pop-up menu

image

Each Blend mode is a different way of mathematically combining the different inputs to blend with one another. Overlay is a particularly useful Blend mode, because it multiplies everything below 50 percent lightness and screens everything above 50 percent lightness. The result combines both the dark and light portions of two images in a way that seems very natural for a variety of situations, such as when trying to give the illusion of a reflection or a material that’s semi-opaque.

3. This looks good, but the effect is still a bit in-your-face, so drag the Transp (transparency) slider to the left to around 40 percent to make the Overlay effect even more translucent.

4. Now, to give a bit of color to the contact lens effect, drag the Input 1 color-balance control toward the blue edge of the wheel, until the Gain parameters read something like Red = 82, Green = 103, Blue = 130.

The color-balance control, or color wheel, of each input is meant to let you add subtle color adjustments for making two composited layers match more convincingly. Here, though, it’s a useful creative tool. At this point, the effect as shown in Figure 8.36 is looking quite nice. But there’s just one more thing you need to do to nail the effect.

Figure 8.36 The contact lens effect after using the Overlay, Transparency, and color-correction features of the Blend & Comp node to customize the composite

image

The last aspect of the EyeInterface animation that gives it away as being artificial is that it’s a bit too sharp, and it doesn’t go out of focus along with the rest of her face when the camera moves. Adding a Blur node lets you take care of both issues at once.

5. Click the FX Nodes button, and hover the pointer over the All Nodes bin. Then press B to isolate all nodes that start with B, and drag the Blur node onto the red link connecting the last 2D Transform node’s yellow output tab and the Blend & Comp node’s top Front input tab. However, you also need to blur the matte output from the 2D Transform node and connected to the GMask node, as shown in Figure 8.37.

Figure 8.37 Connecting the Blur node to both the Front and Matte links

image

If you don’t also run the matte through the Blur node, the RGB channels of the image will blur inside the hole left by the matte, which would remain sharp.

6. Double-click the Blur node in the ConnectFX Schematic to open its parameters. By default, the Blur node is set to Gaussian, which creates a soft, smooth blur effect. Drag the Width slider to the right to increase the amount of blur from 1.00 to 2.00, just enough to knock the edge off the graphic’s sharpness.

If you need more room for the ConnectFX Schematic, you can set the Media Library’s View Mode pop-up menu to Hidden.

7. To get a before-and-after look at the effect that the blur node is having on the image, click the Bypass button (at the right of all of the parameters) off and on again. Every node has a Bypass button that can be used to disable a node’s functionality without deleting it from the node tree.

The Blur node is extremely flexible. By default, the width and height of the blur are locked proportionally, and the matte is also locked to the same value. Turn off Proportional or Lock To Front to adjust these parameters independently. Furthermore, there are separate parameters to blur the X and Y dimensions of the red, green, and blue channels individually. You can also switch among different types of blur.

8. Choose Defocus from the Type pop-up menu, and drag the Width slider left to about 6.00. The Defocus blur simulates an optical blur with bokeh characteristics, as seen through a camera’s lens. Additional controls cover the size, shape, and rotation of simulated bokeh and the type and amount of simulated blooming. They can provide a more natural-looking effect when matching genuine lens blur.

Adding just a bit of blur makes the effect seem more like part of the scene, but the shallow depth of field in this shot causes different regions of the image to go out of focus when the camera pans. You can simulate this by keyframing the Blur node.

9. Scrub the positioner through the timeline until you reach frame 12:30:20+09, and then stop. This is the point at which the woman’s camera-left eye starts to go out of focus. Click the Animation button to view the Animation Graph, and click the Set Key button to place a keyframe.

10. Scrub the positioner forward to frame 12:30:21+14, which is when the woman’s camera-right eye just comes into focus, turn on the Auto Key button, and turn off the Animation button to see the blur parameters again. Raise the Front Width parameter to around 12. Now the simulated contact lens goes out of focus as the camera pans over.

Playing the Effect

At this point, the effect is a bit too processor-intensive to play in real time, so you’ll need to render it to see it play back.

1. First, select the CFX node to show its parameters, click the RGB LUT button, and choose Lin To Log from the Conversion LUT Type pop-up menu. This will result in a log-encoded render being output back to the timeline, so it matches all of the other clips.

2. Click the Render button, and when the progress bar concludes, click the EXIT CFX button to go back to the timeline.

3. Play through this clip in the timeline to see how it looks.

The Essentials and Beyond

While this chapter merely scratches the surface of what’s possible using ConnectFX, the techniques shown here are the foundation upon which everything else that you’ll do rests. It’s important to master the basics of node-based compositing before you move on to more complicated exercises.

Additional Exercises

· The exercises in this chapter create a contact-lens effect in one eye. Use the same techniques, applied using the same EyeInterface graphic, to apply another animated contact lens to her other eye.

Here are some tips:

· Don’t import another EyeInterface layer; pull another link out of the yellow output tab of the EyeInterface node and connect it to another MUX node.

· Also, see which nodes you can duplicate to save yourself some effort.

· Finally, connect the second animated contact lens branch of the node tree to the as-yet unused Front2 and Matte2 input tabs of the Blend & Comp node.