Shake Homepage.
Apple Computer, Inc. © 2005 Apple Computer, Inc. All rights reserved. Under the copyright laws, this manual may not be copied, in whole or in part, without the written consent of Apple. Your rights to the software are governed by the accompanying software license agreement. The Apple logo is a trademark of Apple Computer, Inc., registered in the U.S. and other countries.
distributed, then this README file must be included, with this copyright and no-warranty notice unaltered; and any additions, deletions, or changes to the original files must be clearly indicated in accompanying documentation. (2) If only executable code is distributed, then the accompanying documentation must state that this software is based in part on the work of the Independent JPEG Group.
1 Contents Preface 15 15 16 16 17 17 18 19 20 Shake 4 Documentation and Resources What Is Shake? Using the Shake Documentation Onscreen Help Contextual Help Apple Websites Keyboard and Mouse Conventions on Different Platforms Using a Stylus Using Dual-Head Monitors Chapter 1 23 23 24 27 28 30 31 35 38 45 72 78 81 82 88 90 An Overview of the Shake User Interface Opening Shake Overview of the Shake User Interface Making Adjustments to the Shake Window Navigating in the Viewer, Node View, and Curve Edit
102 104 104 enhancedNodeView Application Environmental Variables Script Environmental Variables Chapter 3 107 107 110 117 123 125 126 130 132 Adding Media, Retiming, and Remastering About Image Input Using the FileIn (SFileIn) Node Retiming The TimeX Node Manual Manipulation of Time Remastering Media Working With Extremely High-Resolution Images Using Shake With Final Cut Pro Chapter 4 137 137 139 141 144 148 150 163 164 Using Proxies Using Proxies Using interactiveScale Using Temporary Proxies Pe
Chapter 7 217 217 218 219 221 224 226 228 231 235 235 240 240 241 243 243 244 246 251 251 253 257 Using the Node View About Node-Based Compositing Where Do Nodes Come From? Navigating in the Node View Using the Enhanced Node View Noodle Display Options Creating Nodes Selecting and Deselecting Nodes Connecting Nodes Together Breaking Node Connections Inserting, Replacing, and Deleting Nodes Moving Nodes Loading a Node Into a Viewer Loading Node Parameters Ignoring Nodes Renaming Nodes Arranging Nodes Group
Chapter 10 291 291 294 298 300 316 Parameter Animation and the Curve Editor Animating Parameters With Keyframes Using the Curve Editor Navigating the Curve Editor Working With Keyframes More About Splines Chapter 11 323 323 323 324 325 325 326 330 331 The Flipbook, Monitor Previews, and Color Calibration Cached Playback From the Viewer Launching the Flipbook Flipbook Controls Viewing, Zooming, and Panning Controls Memory Requirements Creating a Disk-Based Flipbook Viewing on an External Monitor Moni
393 400 401 401 Environment Variables for Shake Interface Devices and Styles Customizing the Flipbook Configuring Additional Support for Apple Qmaster Chapter 15 405 405 405 408 414 417 421 437 Image Processing Basics About This Chapter Taking Advantage of the Infinite Workspace Bit Depth Channels Explained Compositing Basics and the Alpha Channel About Premultiplication and Compositing The Logarithmic Cineon File Chapter 16 451 451 452 453 470 Compositing With Layer Nodes Layering Node Essentials Co
539 540 542 Masking Filters The -mask/Mask Node Masking Using the Constraint Node Chapter 20 545 545 546 548 550 556 557 562 564 566 567 567 568 568 572 Rotoscoping Options to Customize Shape Drawing Using the RotoShape Node Drawing New Shapes With the RotoShape Node Editing Shapes Copying and Pasting Shapes Between Nodes Animating Shapes Attaching Trackers to Shapes and Points Adjusting Shape Feathering Using the Point Modes Linking Shapes Together Importing and Exporting Shape Data Right-Click Men
Chapter 23 611 611 612 615 617 620 625 627 627 631 635 637 646 659 674 Color Correction Bit Depth, Color Space, and Color Correction Concatenation of Color-Correction Nodes Premultiplied Elements and CG Element Correction Color Correction and the Infinite Workspace Using the Color Picker Using a Color Control Within the Parameters Tab Customizing the Palette and Color Picker Interface Using the Pixel Analyzer The PixelAnalyzer Node Color-Correction Nodes Atomic-Level Functions Utility Correctors Consolida
Chapter 27 807 807 807 821 830 845 854 Warping and Morphing Images About Warps The Basic Warp Nodes The Warper and Morpher Nodes Creating and Modifying Shapes Using the Warper Node Using the Morpher Node Chapter 28 861 861 861 864 Filters About Filters Masking Filters The Filter Nodes Chapter 29 895 895 899 900 902 Optimizing and Troubleshooting Your Scripts Optimization Problems With Premultiplication Unwanted Gamma Shifts During FileIn and FileOut Avoiding Bad Habits Chapter 30 905 905 907 9
986 989 993 993 994 996 996 1001 Image Macros Color Macros Relief Macro Key Macros Transform Macros Warping With the SpeedBump Macro Utility Macros Using Environment Variables for Projects Appendix A 1005 1005 Keyboard Shortcuts and Hot Keys Keyboard Shortcuts in Shake Appendix B 1015 1015 The Shake Command-Line Manual Viewing, Converting, and Writing Images Index 1031 Contents 13
Contents
Preface Shake 4 Documentation and Resources Welcome to the world of Shake 4 compositing. This chapter covers where to find help, how the keyboard and mouse work on different platforms, and how to set up Shake for use with a stylus. What Is Shake? Shake is a high-quality, node-based compositing and visual effects application for film and video.
Using the Shake Documentation There are several components to the documentation accompanying Shake, including printed user manuals and tutorials, onscreen documentation in PDF and HTML formats, and contextual help available directly from within the Shake interface. User Manual The Shake 4 User Manual is divided into two volumes: • Volume I—The Interface: Explains the basics of the Shake interface and provides instructions for working with media, file formats, nodes, and so on.
3 Click the folder icon next to the pdfBrowser Path parameter. The Choose Application window appears. 4 In the Choose Application window, browse to and select the Adobe Acrobat Reader application. To save your PDF browser settings in Shake: 1 Choose File > Save Interface Settings. The “Save preferences to” window appears. 2 In the “Save preferences to” window, save your settings to a defaultui.h file.
Shake Websites The following websites provide general information, updates, and support information about Shake, as well as the latest news, resources, and training materials. For more information about Shake, go to: • http://www.apple.com/shake To get more information on third-party resources, such as third-party tools and user groups, go to: • http://www.apple.com/software/pro/resources/shakeresources.
Note: This manual uses the term “right-click” to describe how to access shortcut menu commands. The following table lists the user manual notation system. Notation Example Hot keys/keyboard commands To break a tangent handle in the Curve Editor, Control-click the handle. Some hot keys/keyboard In the Node View, you can press Control-Option-click / Control-Altcommands vary depending on click to zoom in and out. the platform. The Mac OS X command appears first, followed by the Linux command.
When virtualSliderMode is enabled, the left button always uses the virtual sliders when when you click a value field. Normally, you have to press Control and drag. However, when virtualSliderMode is on, dragging left or right in a value field adjusts the value beyond normal slider limits. Note: The stylus does not allow you to use your desk space the same way as with a mouse; consequently, you have to enable virtualSliderMode.
Part I: Interface, Setup, and Input Part I presents information about the Shake graphical user interface as a whole, with detailed information about all the major interface components.
1 An Overview of the Shake User Interface 1 This chapter provides a fast introduction to all aspects of the Shake graphical user interface. It also provides indepth information about navigating the interface, and customizing it to suit your needs. Opening Shake When you open the Shake interface, a blank Shake script appears.
Overview of the Shake User Interface The Shake user interface is divided into five main areas: the Viewer, the Tool tabs, the Parameters/Globals tabs, the Node View/Curve Editor/Color Picker/Audio Panel/Pixel Analyzer tabs, and the Time Bar at the bottom. Node View One of many tabs that can be displayed here. The Node View displays the node tree, which defines the flow and processing of image data in your project. Viewer area Displays the image at the selected node in the node tree.
Tool Tabs The Tool tabs contain groups of nodes, organized by function. Nodes you click in these tabs are added to the node tree. For example, to add a Keylight node, click the Key tool tab, and click the Keylight node. The Keylight node then appears in the node tree. If you right-click a node in any of the Tool tabs, you can choose to insert that node into the node tree in a variety of different ways, using the shortcut menu. The Tool tabs area can also display the Curve Editor, Node View, or Time View.
Audio Panel The Audio Panel lets you load AIFF and WAV audio files for use by your project. Several different files can be mixed down to create a single file. The audio waveforms can be displayed inside the Curve Editor. Sound playback can be activated in the Time Bar playback controls (Mac OS X only). Note: Because audio playback is handled through the use of Macintosh-specific QuickTime libraries, you can only hear audio playback on Mac OS X systems. You can still analyze and visualize audio in Linux.
Making Adjustments to the Shake Window As you work with Shake, there are several methods for resizing and customizing the various areas of the Shake interface. m To resize any area of the interface: Position the pointer at any border between interface areas and drag to increase or decrease the size of that area. If you drag an intersection, you can resize multiple areas at once.
Navigating in the Viewer, Node View, and Curve Editor The Viewer, Node View, and Curve Editor are all capable of containing much more information than can be displayed at one time. You can pan and zoom around within each of these areas in order to focus on the elements you want to adjust in greater detail. Important: Shake requires the use of a three-button mouse—the middle mouse button is key to navigating the Shake interface.
To define a Favorite View: 1 Pan to a position in an area that contains the region you want to save as a Favorite View. If necessary, adjust the zoom level to encompass the area that you want to include. 2 Depending on the area you’re adjusting, you can save additional state information particular to that area.
Depending on the area, the originally saved position and zoom level are recalled, as well as the following state information: • In the Node View, the node or nodes that were loaded into the Viewer and Parameters tabs when you saved the Favorite View • In the Viewer, the node that was viewed when you saved the Favorite View • In the Curve Editor, the curves that were loaded and displayed when you saved the Favorite View • In the Parameters tab, the parameters that were being tweaked, as well as the node t
m To open a floating Tweaker window: Select the node you want to tune and press Control-T. A movable, floating Tweaker window for the node appears. Note: To save your window settings for later use, choose File > Save Interface Settings. OS Window Functions Shake responds to OS windowing, so you can resize the entire window, expand it to full screen, or stow it as an icon by clicking the standard buttons in the upper-right corner of the Shake Viewer title bar.
Shake Menu (Mac OS X Only) The following table shows the Shake menu options. The Shake menu appears only in the Macintosh version of Shake. Menu Option Description About Shake Displays the Shake version number and copyright information. Services Services provide a quick way to perform tasks with several applications. Hide Shake (Command-H) Hides Shake. To show Shake again, click the Shake icon in the Dock. Hide Others (Option-OptionCommand-H) Hides all running applications other than Shake.
Menu Option Description Recover Script (Shift-CommandO or Shift-Control-O) Loads the last autoSave script and is usually done when the user has forgotten to save a script and quits Shake, or when Shake has unexpectedly quit. The script is found under $HOME/nreal/ autoSave. (The $HOME directory is your personal Home directory, for example, the /Users/john directory.
Edit Menu The following table shows the Edit menu options. Menu Option Description Undo (Command-Z or Undoes previous commands; up to 100 levels of undo. Layout, Control-Z) viewing, and parameter changes are saved in the Undo list. You can Redo (Command-Y or Control-Y) also click the Undo/Redo button. You can change the amount of undo/redo levels in your ui.h file. See “Menus and the Title Bar” on page 31 for more information.
Viewers Menu The following table shows the Viewers menu options. Menu Option Description New Viewer Creates a new Viewer in the Viewer area, and automatically stretches it to fill the Viewer area. While in a Viewer, you can also right-click and select New Viewer, or press N. Spawn Viewer Desktop Launches a floating Viewer window that can be moved independently of the interface. The Viewer Desktop is ideal for dual-monitor setups. Render Menu The following table shows the Render menu options.
m To load or save a Shake script: Click Load or Save to open the Load Script window, or to save the current script with the same name. You can also press Command-S or Control-S to save the script quickly. If the script is not yet named, the Save Script window opens. m To save a script with a new name: Choose File > Save Script As, and enter a new file name in the Save Script window. m To reload the same script: Choose File > Reload. The script that appears in the Shake title bar is reloaded.
By default, there are 100 steps of undo and redo in Shake. Changing the Possible Levels of Undo To change the level of undos, enter the following line (with your desired number of undos in place of the “100”) in one of your ui.h files: gui.numUndoLevels = 100; For more information, see Chapter 30, “Installing and Creating Macros,” on page 905. Update The Update button controls what is updated in the Viewer, and when.
The File Browser The File Browser is an interactive browser that serves many purposes. It lets you navigate the local volumes (both fixed and removable media) on your computer, or remote volumes over your network. You use it to open or save scripts, load images via a FileIn node, and to load and save lookup files and expressions. Using the File Browser, image sequences can be listed either as a long list of individual files or as a single object. You can bookmark favorite directories.
The Browser opens. If you’re using Mac OS X, this window appears very different from the standard file navigation sheet, but it has much of the same functionality, and includes additional options that are particularly useful to Shake projects. Navigating in the File Browser There are several ways you can navigate to the directory you need using the File Browser: Using the File List A list of directories and files appears in the center of the File Browser.
Icon, Button, or Key Description Up Arrow/Down Arrow key Moves up and down in the list. Any letter key Once you have clicked in the file listings, press a letter key on the keyboard to jump to the next occurrence of a file or directory that starts with that letter.
2 Click the Bookmark button. The currently open directory is added to the Favorites list. All favorite directory paths you add are saved in the favoritePaths.h file, located in the username/nreal/settings/ directory. By default, the favoritePaths.h file contains: • Your home directory • The nreal directory • The Shake application directory When you add more directories to the Favorites, they’re automatically appended to the code in the favoritePaths.h file.
m To select single files, do one of the following: Double-click the file. m Press the Up Arrow or Down Arrow, then click OK (or press Return). m Press the first letter of the file you want. Press it again to jump to the next file that starts with that letter. Click OK (or press Return). m To select multiple files in the same directory, do one of the following: To select multiple files, drag to select the files, then click OK. m To select multiple individual files, press Shift and select the files.
The File List Click the title of a column to arrange the list according to that type of information. For example, click Modified to list files by creation date. Click Modified again to reverse the order of information. Toggle Buttons The following buttons also change what is listed in the Browser: Button Description Short Listing Lists only file names, type, and size. Sequence Listing Toggles the listing of an image sequence as one listing or as several.
Updating the File Browser Click the Update button to refresh the listing of the current directory in case files have been added or deleted while the File Browser has been open. Specifying Media Placement Three buttons let you set the first frame at which new media is placed when it’s read into your Shake script. This affects the timing of the media inside of your script, and can be seen in the Time View tab. • frame 1: The first frame of media is placed at the first frame of your script. • seq.
The following is a table of examples. Files Shake Notation image.0001.cin, image.0002.cin image.#.cin image.1.tif, image.2.tif image.@.tif image.iff.0001, image.iff.0002 image.iff.# image1.tga, image2.tga image@.tga image.001.tga, image.002.tga image.@@@.tga image.01, image.02 image.@@ Using and Customizing Viewers Shake displays the currently selected image for your project in the Viewer, located in the Viewer workspace at the upper-left quadrant of the interface.
Using Multiple Viewers You can create as many Viewers within the Viewer workspace as you need. Each additional Viewer you create appears within the Viewer workspace area, and each Viewer can be set to independently display any image channel from any node in the current node tree. Each Viewer has its own Viewer shelf with its own controls, and each Viewer you create has two buffers that you can use to compare images.
Note: Each Viewer you create uses additional memory, so you may want to close higher-resolution Viewers when rendering. Also, more open Viewers can slow the display rate due to the increased processing demands of updating each Viewer simultaneously. m To close a Viewer: Click the Close Window button in the selected Viewer’s title bar. Close Window button When you close a Viewer, you release whatever RAM that Viewer was utilizing.
When a node is loaded into the Viewer, an indicator appears on the left side of the node. Additionally, a number and a letter appear below it, specifying which Viewer and compare buffer that node’s image occupies. This node is displayed in viewer 2, buffer A This node is displayed in viewer 1, buffer A m To collapse a node to a minimized state: Click the Iconify Viewer button in the Viewer title bar to minimize its size.
m Drag a Viewer’s bottom-right corner to resize its width and height simultaneously. m To resize a Viewer to fit the image within: Click the Fit Viewer to Image button in the Viewer title bar. Fit Viewer to Image button m To lock a Viewer to the full size of the Viewer workspace: Click the Grip to Desktop button in the Viewer title bar. Grip to Desktop button The full-size Viewer now obscures any other Viewers underneath it, and resizes itself to match the total size of the Viewer workspace.
m To reposition all Viewers within the Viewer workspace at once: Click the middle mouse button anywhere in the Viewer workspace outside of any of the Viewers, then drag to move all of the Viewers around the workspace. m To create a separate Viewer workspace for use on a second monitor: Choose Viewers > Spawn Viewer Desktop. The second monitor must be run from the same graphics card as the primary monitor.
The information (node name, channels, bit depth, size, and so on) for the selected node appears in the Viewer title bar. When the Grad node is loaded into the Viewer, the following appears in the Viewer title bar. Viewer title bar Note: The channels displayed in the Viewer are the non-zero channels. Non-zero channels are not the same as active channels.
m To quickly analyze colors in the Viewer: Click and scrub with the mouse in the Viewer to display the X, Y, R, G, B, and alpha values in the Viewer title bar. These values are also displayed in the Info field in the bottom-right corner of the interface. You can also use the Pixel Analyzer and Color Picker windows to analyze this data with more extensive options. Note: To display the values in the Terminal window that launched Shake, press Control and scrub in the Viewer.
m m To use the two different click-and-hold button behaviors: Click the View Channel button in the Viewer to toggle between the RGB and the alpha views. Click and hold the View Channel button to open a pop-up menu from which you can choose a specific channel view. Click. Click and hold. You can override the default channel display progression when the View Channel button is clicked. For example, clicking the button in RGB view displays the alpha view. When you click again, the RGB view is displayed.
The following table shows the Viewer buttons, the keyboard or hot key shortcuts, and describes the button functions. Button 54 Shortcut Description Pointer Drag the pointer in the Viewer to display the X and Y position values, and the RGBA color values in the Viewer title bar. The values are also displayed in the Info field. Iconify Viewer Stows the current Viewer. Fit Viewer to Image Control-F Fits the Viewer to the image. Grip to Desktop Shift-F Fits the frame to the Viewer workspace.
Button Shortcut Incremental Update Description Updates the changing portion of the image. For example, if Toggle Incremental Update is disabled and you composite a 10 x 10-pixel element on a 6K plate and pan the element, the entire 6K plate updates. When enabled, only the 10 x 10-pixel area is updated. To fix this, turn off the Incremental Update and adjust again—the glitches are corrected. This button has no effect on the output file or batch rendering speed, only on the image in the Viewer.
Button 56 Shortcut Description Viewer Script– Z Channel Right-click menu Views the Z channel. You can also right-click the Viewer Script button, then choose ViewZ. See “Viewer Lookups, Viewer Scripts, and the Viewer DOD” on page 61. Viewer Script– Superwhite/ Subzero Right-click menu Displays superwhite and subzero pixels. You can also right-click the Viewer Script button, then choose Float View. See “Viewer Lookups, Viewer Scripts, and the Viewer DOD” on page 61.
Button Shortcut Description Launch Flipbook Renders a RAM-based image player. Left-mouse click: Renders with the current settings. Right-mouse click: Displays the Render Parameters window. Broadcast Monitor Mirrors the selected node in the Viewer on a video broadcast monitor. The broadcast monitor option is only available in the Mac OS X version of Shake. For more information, see “Viewing on an External Monitor” on page 330.
4 To switch to buffer B, click the A tab, or press 1 (above the Tab key, not on the numeric keypad). The A tab switches to B when clicked. 5 Load the second image into buffer B by clicking the right side of the image’s node. 6 Press 1 to toggle between buffers. You can also click the A and B tabs. Images from The Saint provided courtesy of Framestore CFC and Paramount British Pictures Ltd. You can also put the Viewer into split-screen mode to more directly compare two images.
The Compare Mode button in the Viewer shelf indicates that you are in vertical compare mode. m To create a horizontal split screen: Drag the Compare control up on the right highlighted edge. The Compare Mode button in the Viewer shelf indicates that you are in horizontal compare mode. Alternatively, you can toggle between vertical and horizontal split screens by using the Compare Mode button.
If the Update Mode is not the problem, check to make sure that the manual Update button at the top of the interface is not set to “manual.
Viewer Lookups, Viewer Scripts, and the Viewer DOD There are three similar controls that affect how your images are viewed: • Viewer lookup tables (VLUTs) • The Viewer DOD • Viewer scripts These functions modify the image for efficiency or previsualization purposes, and do not affect the output image. If necessary, it’s possible to apply these settings to a render that is launched from the interface. The following is an example of using a VLUT with a log image.
When LogLin conversion is enabled in VLUT 2, you still work on the log image in the process tree, but you see the linearized plate. (For more information about logarhtymic-to-linear conversion, see “The Logarithmic Cineon File” on page 437.) To activate the VLUT or Viewer Script controls: 1 Apply your VLUT or script. 2 Right-click the VLUT (Viewer Lookup Table) button and select one of the three Load Viewer Lookup options.
The following table includes the current default scripts and VLUTs. Button Description VLUT: Three options let you turn on or off a VLUT for the Viewer. • By default, the VLUT is turned off. • A second option lets you use the Truelight VLUT control, combining monitor calibration with the previsualization of film recorders and other output devices. • A third option, VLUT 2, allows Gamma, Add, and LogLin operators to be applied to the Viewer. Viewer Script–Aperture: Displays a field chart with safe zones.
Button Description Viewer Script–Histogram: Displays a Histogram of your image. Viewer Script controls (right-click the Viewer Script button to select Load options): • ignore: Ignores pixels with a 0 or 1 value. • maxPerChannel: Pushes the values up on a per-channel basis. • fade: Fades the display of the Histogram. The colors are squeezed down in a limited range, an indication that this is probably a logarithmic image. Notice the big healthy chunk of blue near the high end. That is good.
Button Description Viewer Script–Superwhite/Subzero: Displays pixel values above 1 or below 0 for float images. The alpha channel is also tested. Viewer Script controls (right-click the Viewer Script button to select Load options): • view: This parameter controls how the pixels are displayed: per channel: Sets subzero pixels to 0, sets pixels between 0 and 1 to 0.5, and pixels above 1 to 1. This is applied on a per-channel basis.
Button Description Viewer Script–Frames/Timecode: Displays frames or timecode in the active Viewer. To show and modify the frames/timecode display: • Right-click the Viewer Script button and select timecode, or click and hold the Viewer Script button and select the Timecode button. By default, timecode is displayed in the Viewer. • Right-click the Viewer Script button and select Load Viewer Script into Parameters2 tab. The timecode parameters are loaded into the tab.
Note: The Truelight VLUT control in the Viewer shelf lets you set the Viewer’s lookup table to use calibration profiles that you can create with the TLCalibrate node, or that are created using Truelight’s monitor probe. Use the Load Viewer Lookup Controls into Parameters1 Tab command to make adjustments to the Truelight VLUT parameters. For more information on using Truelight, see the Truelight documentation, located in the Documentation folder on the Shake installation disc.
Right-click the Viewer DOD button to access the DOD control options. For example, using Frame DOD to Viewer (sets the DOD to the Viewer frame), you can zoom in on an area you want to focus on and limit your DOD to that area. Note that the DOD is not dynamic, as it would need to constantly recalculate as you pan. For more information, see “The Domain of Definition (DOD)” on page 82. Creating Your Own VLUTs and Viewer Scripts The preset examples are stored in the end of the nreal.h file.
Keyboard Function Control-F Fit Viewer to Image. Shift-F Fit Viewer to Desktop. Alt-drag Pan image. + or - Zoom image in Viewer. Home Reset view. R, G, B, A, C Toggle Red, Green, Blue, alpha, and Color views. Also, see the table on page 54 for keyboard equivalents to Viewer buttons. The Viewer Shortcut Menu Shortcut menus differ depending on the location of the pointer in the interface, or what function/button the pointer is on.
Menu Option Keyboard Clear Buffer A/ B New Viewer Description Clears buffer A or B. N Creates a new Viewer. If the mouse is over a Viewer, it clones that Viewer. Delete Viewer Deletes that Viewer. Helps to clear up graphic/ refresh problems. Minimize or Restore Viewer Stores the Viewer as a small bar. Viewer Lookups Lets you load Viewer lookup controls into the Parameters1 or Parameters2 tab, or into a floating window.
The following table shows the common onscreen control buttons. Button Description Onscreen Controls– Show Displays the onscreen controls. Click to toggle between Show and Hide mode. Onscreen Controls– Show on Release Hides onscreen controls while you modify an image. To access this mode, click and hold the Onscreen Controls button, then choose this button from the pop-up menu, or right-click the Onscreen Controls button, then choose this option from the shortcut menu.
Button Description Path Display–Keyframe Displays only the keyframe positions in the Viewer. To access this mode, click and hold the Path Display button, then choose this button from the pop-up menu. Path Display–Hide The motion path and keyframes are not displayed in the Viewer. To access this mode, click and hold the Path Display button, then choose this button from the pop-up menu.
The parameters indicator appears on the right side of the node, and the node’s parameters are loaded into the Parameters2 tab. The node does not have to be selected in order to load its parameters into the Parameters2 tab. Loading a node’s parameters into a tab automatically clears out whatever previous parameters were loaded. If necessary, you can clear a Parameters tab at any time.
For example, you can view the resulting image from the bottommost node in a tree, while adjusting the parameters of a node that’s farther up in that tree. The indicator on the left shows which nodes are loaded into Viewers, and the indicator on the right shows which nodes have been loaded into one of the Parameters tabs. Using Tweaker Windows You can also open a node’s parameters in a floating “Tweaker” window. m To open a Tweaker window: Select a node and press Control-T.
Each parameter has several types of controls that you can use to change that parameter’s numerical value. • Sliders: Move the slider (if available) to modify the parameter’s value. • Virtual sliders: These sliders—controlled by dragging in a value field—allow you to increase or decrease a parameter’s value beyond the limits of a standard slider. Drag left or right in a value field to decrease or increase a parameter’s numeric value.
When the Load Curves button is enabled (checked), the parameter is displayed in the Curve Editor. When disabled, the parameter does not appear in the Curve Editor. The Autokey button enables keyframing for that parameter. For more information on animating parameters, see Chapter 10, “Parameter Animation and the Curve Editor,” on page 291. Locking a Parameter Most parameters have a lock button next to the Autokey button. This control lets you lock that parameter so that it can’t be modified.
m Click the plus (+) sign to the left of the Color control to access color subparameters. The first row in the subtree contains a slider to modify one channel at a time. Select the button that corresponds to the desired channel: (R)ed, (G)reen, (B)lue, (O)ffset, (H)ue, (S)aturation, (V)alue, (T)emperature, (M)agenta-Cyan, or (L)uminance. Move the slider to calculate according to the selected channel, but convert the numbers back to RGB. m Edit the individual channels or add expressions in the subtree.
Using Expressions in Parameters An expression is any non-numeric entry, such as a variable or a mathematical calculation. Any parameter can use an expression. Some expressions, such as time, are extremely simple. When you type the expression variable “time” into a value field, Shake returns the numeric value of the current playhead position. For example, if the playhead (in the Time Bar) is parked at frame 1, typing “time” into a value field returns a value of 1 in that field.
Linking One Parameter to Another You can link any parameter to any other parameter. m To link parameter A to parameter B within the same node: Enter the name of parameter A into the value field of parameter B, then press Return. A plus sign appears to indicate that the parameter now contains an expression.
Displaying Parameter Values in the Viewer You can dynamically display the values of parameters using the Text and AddText nodes. To differentiate a parameter name from regular text in the value field, surround it with a pair of braces. For example: The current frame is: {time} displays the following in the Viewer: The current frame is: x where x automatically updates as each frame progresses. In another example, if there is a node called Gamma1, and its rGamma value is 1.
The Parameters Tab Shortcut Menu The following table lists the options that appear when you right-click the top portion of the Parameters tab. Option Description Clear Tab Unloads the current parameters from the tab. Create Local Variable Allows you to create a variable specific to a given node. Use this option when you want to link one or more parameters to other parameters. See Tutorial 4, “Working With Expressions,” in the Shake 4 Tutorials.
The Domain of Definition (DOD) The Domain of Definition (DOD) is a rectangular zone that Shake uses to bind the significant pixels in an image in order to optimize rendering speed. Everything outside of the DOD is considered as background (black by default), and is therefore ignored in most computations. Proper handling of the DOD is an extremely powerful way to speed your render times. To examine the efficiency of the DOD node: 1 Create an Image–Text node.
There is a significant difference in rendering speed, even though both images are the same resolution. Assigning a DOD All images from disk are automatically assigned a DOD that is equal to the resolution of the image. There are five ways to alter the DOD: • Images generated in Shake have a DOD. For example, nodes from the Image tab such as RGrad, Text, and RotoShape automatically have an assigned DOD. • The DOD of an image from disk that is transformed or filtered is automatically recalculated.
• The SetDOD node, located in the Transform tab, allows you to manually assign a DOD to an image. In the following illustration, a SetDOD node is attached to the building image to limit the effects to the tower. • You can combine multiple images using a DOD. When you combine two images, the DODs combine to form a larger rectangle. If, however, you use a node like Inside or IMult, that node takes the DOD of the second node.
Combining images with a DOD is an excellent way to optimize greenscreen or bluescreen images that need to be cropped via a garbage matte anyway, because it simultaneously removes the garbage areas and assigns an efficient DOD to the image. The node tree above produces the folowing effect: Building QuickShape1 Primatte1 Inside1 With a good understanding of the role of the DOD, you can optimize the tree before and after the node in question.
The two main keyers in Shake, Keylight and Primatte, recognize the background color, and have a toggle to key the background color in or out. By default, the keyer leaves the background area black in the alpha channel. To turn the background completely white, toggle BGColor on. Shake processes color correction of the BGColor very quickly, as it recognizes there is a pure correction applied to previously black pixels. If the color correction does not change black, such as Gamma or Mult, it is ignored.
There may be cases, however, where you want to take advantage of the DOD for masking purposes. In this tree, an image is scaled down, and the brightness increased with an Add node. This, however, turns the area outside of the image a medium gray. Since this area is recognized as outside of the DOD, it can be returned to black with a Color–SetBGColor node, which sets the color for the area outside of the DOD. Building Add1 Move2D1 SetBGColor1 The Layer–Constraint node also limits a process.
The Time Bar The Time Bar, at the bottom of the Shake window, displays the currently defined range of frames, the playback buttons, and the Info field, which provides a brief description of each control you move the pointer over. The Time Bar is a display of the currently defined time range. It neither limits nor controls the actual parameters that are saved into the script.
m To pan across the Time Bar, press the middle mouse button and drag; or Option-click or Alt-click and drag. m To zoom into or out of the frame range displayed by the Time Bar, press Control and the middle mouse button; or Control-Option-click or Control-Alt-click, then drag. Playback Controls The controls illustrated below play through the script according to the Time Bar frame range, not the global timeRange. • To play forward, click the forward arrow button.
Previewing Your Script Using the Flipbook You can render a temporary Flipbook to preview your work. Once the Flipbook has rendered into RAM, use the playback buttons (described below) to play back the Flipbook. The Flipbook is available on Mac OS X and Linux systems. To launch the Flipbook from the interface: 1 In the Globals tab, set the timeRange, for example, 1-50 or1-50x2. 2 Load the node that contains the image you want to preview into the main Viewer. 3 Click the Flipbook button in the Viewer shelf.
Setting a Script’s Global Parameters 2 2 This chapter covers how to set the global parameters within each script, tailoring your script’s properties to fit your needs. About Global Parameters When you create a new script, you should customize its global parameters before starting work on your composite. The Globals tab contains parameters that are commonly found in the Project Properties window of other applications.
Note: The global controls also appear in the Parameters1 tab when Shake is first started, or whenever you create a new script. The global parameters that can be seen in the Globals tab of the Shake interface are divided into several groups. The Main Global Parameters These parameters control the duration and format of the output from your script. While these parameters can be changed at any time, it’s a good idea to set them to the proper values before you begin any serious compositing.
The starting frame does not always have to be set to 1. For example, to quickly trim off the first 20 frames of your project, change the timeRange to “21-240.” Doing this restricts the frame range displayed in the Time Bar and the processing and rendering of your script to only the frames you need. Here are some more examples of frame ranges you can define in Shake. Time Range Number of Frames Frames Rendered 1-100 100 1, 2, 3... 100 1-100x2 50 1, 3, 5... 99 1-100x20 5 1, 21, 41...
interactiveScale If the general processing speed for your operations is fine, but the interactivity of processor-intensive operations is slowing you down, you can turn on the InteractiveScale option in the Globals tab to use a proxy resolution only while you’re adjusting parameters. This option does not affect your Flipbooks or FileOut renders. For more information, see “Using interactiveScale” on page 139. motionBlur In Shake, motion blur can be applied to animated transformation parameters.
Name default Width default Height default Aspect default ViewerAspect framesPerSecond PAL (D1 4:3) 720 576 .9380 1.066 25 PAL (16:9) 720 576 .7032 1.422 25 PAL (square) 768 576 1 1 25 If the format you need is not in this list, you can always open up the format parameter subtree—by clicking the “+” (plus) icon to the left of the parameter name—and create your own custom format.
defaultViewerAspectRatio This value corrects the aspect ratio of the image displayed by the Viewer to account for images using nonsquare pixels. The defaultViewerAspectRatio parameter is for display only, and has no effect on rendered output. Changing any format subparameter sets the format pop-up menu to Custom. If there’s a particular custom format that you use frequently, you can add it to the Format popup list.
quality When this parameter is set to lo (0), anti-aliasing is disabled. This results in poorer image quality, but improved render speed. maxThread Set the maxThread to the number of available processors you want to use for rendering by Shake. cacheMode The cache is a directory or precalculated images with script information attached. When Shake evaluates a node tree at a given frame, it compares the tree to the cache to see if it has rendered that frame before.
To open or load a script that contains a missing macro: 1 Click the Globals tab. 2 Expand the renderControls subtree. 3 Set macroCheck to one of the following options: • abort load: does not load the script • sub. with text: substitutes a Text node in place of the missing macro • sub. no text: substitutes a MissingMacro node 4 Open/load the script. To set the default macroCheck behavior to substitute a MissingMacro node, include the following in a .h file: sys.
virtualSliderMode When this parameter is turned off, dragging within any parameter’s value field in Shake results in an edit bar appearing and the contents of that field being selected. When this parameter is turned on, dragging within a parameter’s value field results in that parameter being modified as if you were dragging a slider. This mode is very useful when using Shake with a graphics tablet. You can also use these virtual sliders in the value fields simply by dragging with the mouse.
rotoPickRadius This parameter provides the ability to select individual points on a shape that fall within a user-definable region around the pointer. This allows you to easily select points that are near the pointer which may be hard to select by clicking them directly. A slider allows you to define how far, in pixels, the pointer may be from a point to select it.
multiPlaneLocatorScale Affects all MultiPlane nodes within the script. This parameter scales the depth of the virtual space used to distribute the locator points that are displayed in the Viewer (which represent 3D-tracking data clouds that are imported from .ma files). This parameter allows you to expand or compress the relative distance from the camera to the tracked background plate.
Note: The external display monitor doesn’t have to be a broadcast display. If you have more than one computer display connected to your computer, the second one can be used as the external preview display. Colors These parameters allow you to customize the colors Shake uses for different Shake interface controls. fontColor This parameter lets you customize the color used by the text within the Shake interface.
enhancedNodeView This parameter allows you to toggle all four enhanced Node View parameters using a single button. This parameter can also be toggled using the Enhanced Node View command from the Node View shortcut menu (Control-E or Command-E). For more information on the enhancedNodeView parameters, see “Using the Enhanced Node View” on page 221. showTimeDependency This parameter, when turned on, draws a bluish glow around nodes that are animated.
Application Environmental Variables The default values of many of the global parameters can be customized via .h preference files. For example, if you consistently set one or more global parameters to a custom state whenever you create a new script, you can set custom defaults so that new scripts are created with your preferred settings. Custom global values you set with .h files are only applied to newly created scripts.
Global Parameter Type Purpose SetUseProxy(const char *useProxy) char The default proxy setting. SetProxyFilter(const char *proxyFilter) char The default filter used to scale proxies. SetPixelScale(const char *pixelScale, const char *pixelRatio) char A temporary setting for the proxy resolution that is overwritten when useProxy is set.
3 Adding Media, Retiming, and Remastering 3 This chapter covers adding media to your script using FileIn nodes, either as individual files, or as media from Final Cut Pro. Also discussed are the retiming and remastering functions available from within the FileIn node itself. About Image Input This section discusses importing images into a Shake script using the FileIn node.
The selected media appears in the Node View, represented by one or more FileIn nodes. For more information about finding and selecting files, see “The File Browser” on page 38. Dragging and Dropping Media Into Your Script If you’re running Shake on Mac OS X, you can drag supported media types from the Finder directly into the Node View tab. This results in the creation of a FileIn node corresponding to each file you dragged in.
The following table lists some formatting examples. Shake Format Reads image.#.iff image.0001.iff, image.0002.iff image.%04d.iff image.0001.iff, image.0002.iff image.@.iff image.1.iff, image.2.iff image.%d.iff image.1.iff, image.2.iff image.@@@.iff image.001.iff, image.002.iff image.%03d.iff image.001.iff, image.002.iff The above examples assume an exact relation between the current frame processed in Shake, and the frame read in. For example, at frame 1, image.1 is read in.
When Shake reads in an image, it converts the file path of the image to the UNC naming convention. This labels the machine name first, and then the file path. The third listing above is an example of this convention. This behavior can be turned off in a preferences file. For more information, see “Customizing File Path and Browser Controls” on page 371. Shake looks for its files in the User directory ($HOME) when launched from the application icon, or the current directory if launched from the Terminal.
• IRetime: Sets the start/stop frame of a clip, can slip sync, and controls how the clip behaves for frames outside of the frame range. Works for FileIn and SFileIn. FileIn Source Parameters The parameters for each FileIn node are divided into subtabs: the Source tab and the Timing tab. The Source tab, located on the left side of the Parameters tab, contains the following controls: ImageName Specifies the local or absolute path to the image or media file on disk.
increment This parameter controls how frames in the referenced image sequence are advanced, providing an unsophisticated method for retiming the clip by either skipping or multiplying frames being read in from an image sequence. • The default value of 1 means that every frame plays back, and the clip’s duration in the script is identical to its duration on disk. • A value of 2 or higher means that frames are skipped. At 2, every other frame is skipped, and the clip duration is halved.
• If the file name format is filename.1-30#.tiff, Shake expects an uninterrupted sequence of frames to exist on disk. If individual frames are accidentally deleted or moved from the specified path, each missing frame results in a gap in the image sequence in Shake. Each gap results in a black frame being displayed in the Viewer. For example, if frame 17 goes missing after a tiff sequence has been imported, moving the playhead to frame 17 in the Time Bar displays a black frame in the Viewer.
2 Click the File Browser icon in the ImageName parameter. 3 Use the File Browser to find the original media files, then click OK. Note: The File Name field displays the name of the file that was originally linked to that FileIn node. FileIn Timing Parameters The second subtab under the FileIn Parameters tab is the Timing tab. The parameters in this tab control the timing of image sequences and movie files used in your Shake script.
inMode If media has been time-shifted or the In point changes so that there are blank frames prior to the first frame of the media in the Time View, this parameter lets you set how those empty frames should be filled. outMode This parameter lets you set how the empty frames after the last frame of the media in this FileIn node are filled.
Pulldown and Pullup 3:2 Pulldown is a technique to temporally convert the framerate of noninterlaced film footage to that of video, and back again. The pulldown parameter in the Timing tab of SFileIn allows you to manage your pulldown/pullup of a sequence. There are two options: 30 to 24 This option removes pulldown from a media file that has been telecined to 30 fps. Use this setting to return it to 24 fps for compositing in Shake.
3 Choose the firstFrame value that corresponds to this frame number in the following chart: First Frame With Field Blending firstFrame Setting 1 BC 2 BB 3 AA 4 DD 5 CD 4 Click the Timing tab in the Parameters1 tab, and set the firstFrame parameter according to the table in step 3.
The reTiming parameter has four options: • None: No retiming is applied, and the clip plays at its original speed. • Speed: Lets you change the speed of a clip using a simple multiplier. For example, .5 returns a clip twice the length of the original, that plays in slow motion. • Remap: Allows you to change the speed of a clip with a curve, with the X axis representing the input frame number and Y representing the frame it’s remapped to.
retimeMode By default, you are given three options for frame blending: Nearest No frame blending is applied, and Shake simply uses a copy of the nearest available frame to fill the new in-between frames. Blend Averages neighboring frames together to create in-between frames that are a combination of both to soften the strobing effect that can result from slow motion effects. If the retimeMode parameter has been set to Blend, three additional parameters appear underneath.
Adaptive This option in the retimeMode pop-up menu uses advanced image analysis to generate new in-between frames, creating seamless slow and fast-motion effects. Selecting Adaptive reveals additional parameters. Fast versus Best Settings for Adaptive Retiming When setting up an adaptive timing operation, you might be tempted to simply choose Best across the board for every parameter.
• AlwaysInterpolate: With AlwaysInterpolate turned off, the final result of a retiming operation is a mix of original, unprocessed frames, and interpolated frames. For example, setting the speed to 0.5 to slow an image sequence down by 50 percent results in an alternating series of original frames and interpolated frames.
Remap Parameters If you select the Remap button in the reTiming parameter, the following additional parameters appear: • retimeMode: By default, you are given two options for frame blending: • Nearest: No frame blending is applied, and Shake simply uses a copy of the nearest available frame to fill the new in-between frames. • Blend: Averages neighboring frames together to create in-between frames that are a combination of both to soften the strobing effect that can result from slow motion effects.
• range: Controls how many frames should be blended together to create the final result. For example, if you want to extend a source clip of 20 frames to 40 frames, each source frame contributes to two output frames. With a range of 2, each source frame contributes to four output frames, resulting in more blending. If you only apply this value with no other modifications, you get repetitions of neighboring frames to help you with degraining.
Parameters The TimeX node has one parameter in the Parameters tab: newTime This parameter defaults to a spline that maps every input frame to a corresponding frame in time, such that the clip plays forward normally at 100 percent speed. Typically, you’ll enter a new expression into this field, using the expression time, to remap the frames of the image sequence or movie file to create new timing effects. Similar to Lookup and ColorX, you can duplicate most other Time functions with TimeX.
Manual Manipulation of Time This section explains the notation Shake uses for a FileIn node, and the available FileIn options. It also discusses the notation for the timeRange parameter in the Globals tab, or the -t option on the command line. For a discussion of the interactive controls of time, see Chapter 8, “Using the Time View,” on page 261, and “Using the FileIn (SFileIn) Node” on page 110. Time Notation for a FileIn This section focuses on manual manipulation of time.
Shake Format Reads/Writes image.%d.iff image.1.iff, image.2.iff image.@@@.iff image.001.iff, image.002.iff image.%03d.iff image.001.iff, image.002.iff Time Notation Setting the Script Range The script range can be set in the timeRange field of the Globals tab, or on the batch command line with the -t option, which overrides the script. The range description is extremely flexible. The following are some examples: Time Range Number of Frames Frames Rendered 1-100 100 1, 2, 3...
You can use these options to convert individual shots that you’re compositing within Shake, or you can read in an edited sequence from an application like Final Cut Pro for format conversion using Shake. Important: If you’re converting a clip from a video frame rate to that of film with the intention of adding 3:2 pulldown back to the video (to achieve a film look for video), render the 24 fps conversion first.
Convert Parameters The Convert mode has the following parameters: InputFrameRate Specify the original frame rate of the input media here. This parameter is also a subtree with two additional subparameters. InputFrameInterlaced If the input media is video, enable this parameter if it’s interlaced. InputFrameDominance If the input media is interlaced, specify the field dominance here. OutputFrameRate Specify the output frame rate here for format conversion.
OutputFrameDominance If OutputFrameInterlaced is turned on, specify the field dominance of the output image here. OutputRes Two fields where you enter the horizontal and vertical output resolution you want to convert the media to, to scale it up or down. Scaling an image sequence using the OutputRes parameter of the Convert options results in higher-quality output than using Shake’s Transform nodes.
AspectRatio This parameter is a multiplier that allows you to convert pixels of one aspect ratio into another aspect ratio—for example, from NTSC to PAL, or from high definition (square) to NTSC. The default value of 1 makes no change to the output. The following table contains common conversion values: Operation Conversion Value Square to NTSC (4:3) 0.9140, or 1 if Fit is set to Resize Square to PAL (4:3) 1.1111, or 1 if Fit is set to Resize NTSC (4:3) to Square (4:3) 1.
There are two ways you can get around this safety feature. Using Proxies The first is to use proxies with a proxyScale of less than 1. For example, at a proxyScale of .5, you can potentially look at images up to 8K x 8K resolution. Changing the Viewer Limits The other workaround is to change the default Viewer limits by customizing a ui preference file. Add the following lines: gui.viewer.maxWidth = 4096; gui.viewer.maxHeight = 4096; These lines set the maximum resolution to 4K.
Tuning the Amount of RAM Shake Uses Finally, you need to tune the amount of RAM used by Shake. By default, 96 MB are assigned to the nodes and 64 MB to the images themselves. You need to increase the second setting. It is recommended that you allocate one-third of your memory to each of the two following settings, to reserve memory for other applications and Flipbooks. However, the first setting rarely needs to exceed 96 MB.
How Sent Clips Are Arranged in Shake Regardless of how you move Final Cut Pro clips into Shake, how they’re assembled in the newly created Shake script depends on whether they were sequentially arranged within a single video track, or vertically superimposed using several video tracks.
If you used the Send to Shake command on the following superimposed clips: Sequentially edited clips in Final Cut Pro The result would be the following Shake script, with three Select nodes, and one MultiLayer node: Resulting arrangement in Shake While it is possible to slide footage within edits by adjusting the placement of imported clips in Shake’s Time View, you are better off making these adjustments in Final Cut Pro and re-sending the media to Shake.
Sending Clips From Final Cut Pro If you want to send one or more selected clips (or a single sequence), from Final Cut Pro to Shake, you should use the Send to Shake command in Final Cut Pro. To send one or more clips from Final Cut Pro to Shake: 1 Clean up your project timeline, so that you are able to select only the clips you intend to send. 2 Do one of the following: • Select one or more clips in the Timeline or Browser. • Select a sequence in the Browser.
5 Check the Launch Shake box if you want to automatically open the newly created Shake script and start working on it. 6 Click Export. When you click Export, four things happen: • A duplicate sequence appears in your Final Cut Pro project, containing duplicates of the selected media. • A Shake project is created on disk. • A placeholder QuickTime file is created on disk.
4 Using Proxies 4 Shake has a sophisticated proxy system that lets you dynamically adjust the resolution of the images to speed your workflow. This chapter covers how to tailor Shake’s proxy system to suit your needs. Using Proxies This section discusses how to use proxies to speed up your workflow.
The following example shows a full-resolution image compared to a 1/3 scale proxy image. You can see that the proxy uses 1/9th of the space, which potentially requires 11 percent of the processing time, memory, and I/O activity. Full resolution 1/3 proxy Images from The Saint provided courtesy of Framestore CFC and Paramount British As a result, there is a dramatic difference in quality when the clip is viewed at the same resolution, as you can see by the softening of the image to the right.
Enabling a useProxy setting If processing is slow overall, and you need to speed things up while you’re working, you can enable one of the proxy settings without needing to pre-render a set of proxy files. This is a good option if you don’t anticipate working on the project for very long.
You can combine this setting with the useProxy setting if the script you’re creating is exceptionally slow to render. For example, setting useProxy to P1 lowers the overall processing resolution to 1/2 by default. If you set the interactiveScale setting to 1/4, parameter interactivity will be very fast, and you won’t have so long to wait when you release the parameter control to let the image render at the current proxy setting.
Using Temporary Proxies Unless you specifically do otherwise, Shake generates temporary proxies (also called on-the-fly proxies) that are created only for frames that are displayed, as needed, and that are discarded once your computer’s disk cache is full. Whenever you set the useProxy parameter to something other then Base, Shake scales down the resolution of frames at the position of the playhead as you view them, in order to accelerate your script’s performance.
The default proxy settings are: Proxy Setting proxyScale proxyRatio Base 1 1 P1 1/2 (.5) 1 P2 1/4 (.25) 1 P3 1/10 (.1) 1 By default, you can select from the predefined proxy sets in the useProxy subtree of the Globals tab. These are common proxy settings, but you can also use your own. To temporarily set a custom proxy: 1 In the Globals tab, open the useProxy subtree. 2 Change the proxyScale and proxyRatio parameters to the desired settings.
In the following example, the proxyRatio is set to .5. This setting has the added benefit of correcting the anamorphic distortion of the image while simultaneously reducing its resolution. Full Resolution m .5 proxyRatio To return to a preset proxy setting: Click Base/P1/P2/P3 (or Other in the upper-right corner of the Shake window). Changing the Aspect Ratio to 0.5 To ensure that your nodes understand the aspect ratio as 0.
3 Modify the proxy1DefaultScale and proxy1DefaultRatio parameters. • For example, suppose you want to create a proxy setting that lowers the resolution of an anamorphic image by resizing the image vertically to correct the anamorphic distortion. You want to set P1 to be the same width as the base file (the full resolution image) but flattened, and P2 to be 1/4 scale and also flattened. To do this, use the following values: • proxy1DefaultScale 1 • proxy1DefaultRatio .
When an SFileIn node is created, three pieces of information are taken from the File Browser: • The file name • The proxy level that corresponds to this file name (Base, P1, P2, or P3) • The set of images to use for that proxy level The chosen file name appears in the FileIn node’s proxy1File parameter, and the settings for the selected proxy level from the selected proxy set are used to set the other subparameters of the fields.
Variable Definitions This section explains the declarations made in the above script. proxyPath Defines the default location for pre-generated proxies. (See the example below.) Note that you can use variables to grab strings from the baseName: • = image name + frame range • = format extension • = image name (no frame range) • = the frame range • , , etc. = the name of the parent directory, two directories up, and so on. scale The proxy scale.
Example This example sets a proxy of .25 with an aspect ratio of .5. It takes the default bytes setting, turns on the render light for the Render Proxies menu, adds an entry into an SFileIn, and is set as P1: DefineProxyPath(“../proxy.25.5/.”, .25, .5, GetDefaultBytes(), “Auto”, 1,1,1, “substitutionStrings”); You can also create and use predefined proxy sets in the useProxy subtree (in the Globals tab), where you can choose the proxyScale values for P1, P2, and P3.
The first line names the group as “4k Fullap.” The next line describes the base file name. The next three lines that begin with DefProxyPath describe the subproxies using the DefineProxyPath definition, except the substitutionStrings. When the first string is found in the base file name, it substitutes the second string. For example, from the first line, “4096x3112” is substituted with “2048x1556.
If the proxy was named: //MyMachine/project1/shot1/plate1/proxy1/myfile_proxy1 and the full resolution elements are: //Server1/project1/shot1/plate1/full/myfile_full you enter MyMachine|Server1; proxy1|full as your baseDefaultReplace. Note the semicolon to split the entries. 4 Create a FileIn node in the Node View to read the pre-rendered proxies into your script.
Pre-Generating Your Own Proxies Ordinarily, if you set useProxy to P1, P2, or P3, the proxies created for each frame of the composition are written on the fly to memory. Eventually, the computer’s memory fills up, and these temporary proxy images are written to disk—into the cache. The cache is a closed set of files that are viewable only by Shake. Additionally, remote renders do not recognize the cache directory if not explicitly specified to do so.
• 2K Academy: This option is suitable if your original image files have a resolution of 1828 x 1556. Three sets of proxies are generated, with the following absolute defaultScale values: • 914 x 778 • 457 x 389 • 183 x 156 • 2K Fullap: This option is suitable if your original image files have a resolution of 2048 x 1556.
4 Choose Render > Render Proxies. The Render Proxy Parameters window appears. 5 Turn on the proxies you want to generate. In the following screenshot, only the proxy1Default proxy set will be rendered, because the other two sets are turned off. The Render Proxy Parameters window has the following parameters: renderProxies Specifies whether all FileIn nodes in the currently open script are rendered as proxies, or just the selected ones. timeRange Sets the range of frames to render as proxies.
previewFrames Displays the thumbnails of the new proxy frames as they’re rendered. Render proxy Defaults Each proxy set you want to be rendered must be enabled. You can also open each proxyXDefault’s subtree to modify any parameters. If you create your own custom proxy setting with a .h file (see above), you can specify if this button is on or off by default. 6 When you’re finished changing the settings, click Render. When Shake finishes rendering, the proxies are ready to be used in your script.
Pre-Generated Proxy File References in FileIn Nodes When you open a FileIn node’s parameters in the Parameters tab, the imageName parameter shows which proxy image files are currently being used.
Anamorphic Images and Pre-Generated Proxies Do not use the proxyRatio parameter to change your aspect ratio on the fly if working with pre-rendered proxies. This parameter dictates the relationship of the height-towidth ratio between the proxy file and the base file as they exist on disk. Therefore, either ensure you are using flattened pre-generated proxies (that can be a second proxy set), or use the global parameter viewerAspectRatio to flatten the anamorphic proxies.
For example, suppose the source media of an image sequence using the file name plate.# is referenced by the following path: /MyHiResImages/plate.#.cin By default, proxy image files are rendered and saved into new directories, which are created within the directory referenced by using the following names: /proxy.50/plate.#.cin /proxy.25/plate.#.cin /proxy.10/plate.#.
If you have many plates and a high frame count, you may want to put the images for each proxy resolution into separate directories. For example, you can provide a file path such as: ../_p.50/. This approach keeps the file count down in each directory, but increases the overall number of directories referenced by your script. Examples of this are: images/bluescreen1/bs1.#.cin, images/bs1_p.50/bs1.#.cin images/bluescreen2/bs2.#.cin, images/bs2_p.50/bs2.#.cin images/cg_plate/cg_plate.#.
Using local files can speed your compositing work by eliminating the need for your computer to access media over the network. As an added benefit, using local files speeds up renders on your machine. On the other hand, having your script reference the original files over the network can speed up network renders by preventing networked machines from having to access media on your computer. You can create a local set of media files by setting the proxyScale of one of the proxy settings (typically P1) to 1.
The following example uses one of the tutorial clips to illustrate how you can create custom proxy settings to create half-height proxies for anamorphic footage. Do not read the tutorial images in right away. To pre-generate customized proxies from the Shake interface: 1 In the Globals tab, open the useProxy subtree. 2 Set your proxy1DefaultFile to: /TEMP/saint_p.1x.5 3 Set your proxy2DefaultFile to: /TEMP/saint_p.25x.
This group of parameters should now look like this: 7 Now, create a FileIn node, and read in the saint_fg.1-5# and saint_bg.1-5# files from the $HOME/nreal/Tutorial_Media/Tutorial_05/images directory. 8 Choose Render > Render Proxies. 9 In the Render Proxy Parameters window, set the frame range to 1-5. 10 Enable Render Proxy1Default and Render Proxy2Default. 11 Click Render. Your proxies are rendered and available for use. When you click P1, you switch to the half-height images.
Pre-Generating Proxies From the Command Line—Method One If the base-resolution images are already loaded into a script and you have checked that the proxy paths are correct (see above), you can launch a proxy-only render on the command line with the -renderproxies command: shake -exec myscript.shk -renderproxies p1 p2 p3 -t 1-100 -v createdirs This automatically creates the appropriate subdirectories when -createdirs is activated.
To use pre-generated proxies in a script via the user interface: 1 Read the full-resolution images into a script with a FileIn node. The Load as proxy parameter at the bottom of the Browser lets you choose whether the resolution of the image corresponds to the Base, P1, P2, or P3 proxy resolution. Keeping High-Resolution Elements Offline If you have not yet loaded your full-resolution images onto a disk and are loading a proxy into the interface, click Cancel to close the File Browser.
Note: When you toggle the useProxy parameter from Base to P1, P2, or P3, you do not necessarily load a FileIn node’s corresponding proxy1File, proxy2File, or proxy3File media. The proxy mechanism loads the set that is closest to the global settings, and does a further scale based on that set. For example, if you haven’t loaded a 10-percent pre-generated proxy and you set useProxy to P3, a 10-percent file is generated on the fly from the generated P2 proxy.
Proxy Parameters The following tables list proxy parameters everywhere they appear in Shake, in the Globals tab, and in each FileIn node’s Source tab. In the Globals Tab The useProxy subtree in the Globals tab has the following parameters that let you customize how Shake handles proxies for the media used by your script: useProxy Specifies the proxy set to be used. The sizes are determined by opening proxy1File, Proxy2File, and so on, and setting the scale/ratio parameters.
Adding Your Own Entry to the proxySet Pop-Up Menu You can define your own proxy set to appear in this menu via a .h file. This automatically sets the paths and sizes for each set. You can also declare a proxy set for a specific FileIn during browsing. A predefined proxy set looks like this: DefProxyGroup("4K Fullap", DefBasePath( "../4096x3112/."), DefProxyPath("../2048x1556/.", .50, 1., GetDefaultBytes(), "Auto", 0, 1, 0, "4096x3112|2048x1556"), DefProxyPath("../1024x778/." , .25, 1.
• proxyNDefaultBytes: The bit depth for pre-rendered proxies. This has no effect with on-the-fly proxies. • proxyNDefaultAlwaysAdd: When enabled, this proxy set is added to a FileIn node when created. • proxyNDefaultReplace: See baseDefaultReplace. textureProxy The proxy level at which texture-rendered images that are used by the MultiPlane’s hardware-rendering mode are displayed in the Viewer.
5 Compatible File Formats and Image Resolutions 5 The first part of this chapter covers the many file formats with which Shake is compatible. The second chapter covers how to control image resolution. File Formats The FileIn node can read in two kinds of media—image sequences and QuickTime files. Image sequences are simply collections of image files, where each frame of film or video corresponds to one image file. QuickTime files, on the other hand, contain every frame of media inside of a single file.
Shake is a hybrid renderer—it adapts its rendering from either scanlines or a group of tiles. This means it never has to load the entire image, just a single piece of the image, making a much smaller memory footprint than other compositors. Sometimes you cannot load just a single line, for example, when using a Rotate node, in which case Shake internally breaks the image down into small tiles to work with more manageable bits.
There are some formats that do not support the ability to efficiently read a random portion of the image. As a result, these images can take significantly longer to load, and may require more memory. Note: QuickTime files do not support the creation of tmp files. Create Temporary Files Do Not Create Temporary Files Alias AVI BMP (depending on orientation) DXP Cineon (depending on orientation) GIF JPEG IFF PBM Mental Images Softimage .
Nodes That Create tmp Files Certain nodes also create tmp files of their own during the processing of a script. This is required for nodes that drastically change the X, Y position of an image’s pixels during rendering. For example, if you rotate an image 90 degrees, the pixel in the lower right now moves to the upper right. In order to process this, Shake creates a tmp file that includes as much information as necessary to calculate the image.
An asterisk indicates additional format notes (following the table). Extension Image Format Input Channels Output Channels .iff* (or no extension) Shake native BW[A, Z], RGB[A, Z] Same 8, 16, float No .nri Shake icon (only for interface icons) RGB[A] Same 8 No .iff* Alias/ Wavefront Maya (licensed from Apple) RGB[A, Z] Same 8, 16, float No .als, .alias, (pix) Alias/ Wavefront Alias RGB Same 8 Yes .
Image Format Input Channels Output Channels .jpeg, .jpg, .jfif* JPEG BW, RGB .pbm, .ppm, .pnm, .pgm PBM .pic Extension 172 Compression Bit Depth tmp Files Same Lossy, from 0 8 to 100%. 100 = high quality Yes BW, RGB Same 8 Yes Softimage RGB[A] Same 8 Yes .png PNG RGB[A], BW [A] Same 8, 16 No .psd* Adobe Photoshop RGB[A] RGBA 8, 16 .mov, .
Extension Image Format Input Channels Output Channels Compression Bit Depth tmp Files .tdx Alias/ BW[A, Z], Wavefront RGB[A,Z] Explore Tiled Texture Map Same .tga Targa RGB[A] RGB[A] .tif, .tiff TIFF BW[A], RGB[A] Same .xpm XPM RGB[A] Same .yuv, .qnt, .qtl, .pal* YUV/Abekas/ RGB Quantel Same Uncompressed files with YUV encoding 8 Yes .yuv (10-bit) Same Same Uncompressed files with YUV encoding 16 (10) Yes RGB 8, 16, float No On/Off 8 Yes 4 options, see below.
m To set Shake to write images in top-down mode: Add the following lines to a .h file in your startup directory: script.cineonTopDown = 1; script.tiffTopDown = 1; You can also set environment variables in your .cshrc (or .tcshrc or whatever): setenv NR_CINEON_TOPDOWN setenv NR_TIFF_TOPDOWN (For more information on setting up your own .h files, see Chapter 14, “Customizing Shake.
Note: 32-bit unsigned integer channel data will only be useful to custom plug-ins with built-in logic capable of processing the data within the Z channel. A major feature of the OpenEXR format is its ability to support an extremely wide dynamic range. Thanks to its floating-point support, a contrast range of up to 30 f-stops can be supported with no loss of precision. Color resolution in 16-bit float (“half”) files is 1024 steps per f-stop.
Support for Data Compression The OpenEXR format supports several codecs, with options for either lossless or lossy compression. Compression ratios range from 2:1 to 3:1. Note: By default, FileOut nodes set to output OpenEXR images default to the Piz codec. The following codec information appears courtesy of Industrial Light & Magic: • none: No compression is applied. • RLE: (Lossless) Differences between horizontally adjacent pixels are run-length encoded.
JPEG In the FileOut node you can set the quality level of these image formats (.jpeg, .jpg, .jfif ) and determine which channels are present in the file. MOV, AVI The QuickTime format (.mov, .avi) is available on Macintosh systems only. AVI files are written through QuickTime. If you select either as your output format, you have three additional options: • codec: A pop-up menu with a list of all available compressors with Animation (RLE compression) as the default codec. • compressQuality: 0-1.
When yuvFormat is set to Auto, the resolution is automatically determined by the resolution of the FileIn node. The selected resolution is the smallest possible to fit the entire image. For example, if the image is smaller than NTSC, it is NTSC. If it is between NTSC and PAL, it is PAL; otherwise it is HD. You can also manually select the resolution. The script.videoResolution is no longer used for this purpose. Note: The YUV file reader and writer supports Rec. 709 and Rec.
To assign blind header data from one image to another: 1 Add a Copy node to the node tree, so that the nodes providing the RGBA data you want to use are connected to the Foreground input knot. 2 Attach a second FileIn node containing the blind header information you want to use to the Copy node’s background input knot. 3 In the Copy node’s Parameters tab, turn on the copyBData parameter. The resulting output from the Copy node contains the blind header data from the second FileIn node.
Table of File Sizes In the following table, all sizes are for 3-channel images. Note that many images support optional alpha or Z channels, which add to the file size. A single channel image is typically one-third the size. The two sizes listed in each cell are for a Ramp (an example of extreme compression), and a completely random image, each in MB. Normal plates tend to be in between, usually closer to the higher value. This can give you a very wide variation in an image. For example, an .iff goes from 2.
Combining Images of Differing Resolution When you composite images with different resolutions using one of the Layer nodes, you can select which image defines the output resolution of this operation using the clipMode parameter. This parameter allows you to select either the foreground (first image) or background (second image) resolution to use for the final image. For example, if you read in 50 2048 x 1556 images, you are working at 2048 x 1556.
Note: This method works even when compositing a pure black plate generated with the Color node. Tree Background, 720 x 486 Foreground, 640 x 480 In the following example, a 320 x 240 black frame is created with an Image–Color node. The resolution of the foreground and background elements is set to 320 x 240 by assigning the background clipMode in the second Over node.
Using the Resize, Fit, or Zoom Node to Scale the Frame The following three nodes change the resolution by scaling the pixels. • Resize: You set the output resolution of the node, and the image is squeezed into that resolution. This usually causes a change in aspect ratio. • Fit: Like Resize, except it pads the horizontal or vertical axis with black to maintain the same aspect ratio.
Parameters This node displays the following controls in the Parameters tab: xSize, ySize The new horizontal and vertical resolution. This parameter defaults to the width expression. xFilter, yFilter The methods used to scale the image horizontally and vertically. Choosing Default uses the sinc filter when scaling the image down, and the mitchell filter when scaling the image up. For more information, see Chapter 28, “Filters.
subPixel Turns on quality control. • 0 = low quality • 1 = high quality If the new width or height is not an integer (either because it was set that way, or because of a proxy scale), you have a choice to snap to the closest integer (subpixel off ) or generate transparent pixels for the last row and column (subpixel on). Zoom The Zoom node resizes the image to a given resolution. Parameters This node displays the following controls in the Parameters tab: xScale, yScale The scaling factor, for example, .
Cropping Functions This section describes several nodes you can use to crop your images. Window, Viewport, and Crop are located in the Transform tab, and AddBorders is located in the Other tab. AddBorders The AddBorders node is similar to a Crop, except it adds an equal amount of space to the left and right sides, or to the top and bottom sides. It is located in the Other tab because of its infrequent use.
Parameters This node displays the following controls in the Parameters tab: cropLeft The number of pixels to crop from the left of the image. This parameter defaults to 0, the leftmost pixel of the image. cropBottom The number of pixels to crop from the bottom of the image. This parameter defaults to 0, the bottommost pixel of the image. cropRight The number of pixels to crop from the right of the image. This parameter defaults to the width expression.
Viewport Node Example The following tree has a large input image (scaled down in the illustration) which is piped into a Crop node and a Viewport node, each with the same values. Both nodes are then piped into Move2D nodes with the same xPan values. The Crop result has black on the right edge after the pan; the Viewport result does not.
cropLeft The number of pixels to crop from the left of the image. This parameter defaults to 0, the leftmost pixel of the image. cropBottom The number of pixels to crop from the bottom of the image. This parameter defaults to 0, the bottommost pixel of the image. cropRight The number of pixels to crop from the right of the image. This parameter defaults to the width expression. cropTop The number of pixels to crop from the top of the image. This parameter defaults to the height expression.
6 Importing Video and Anamorphic Film 6 Shake provides support for nearly any video or anamorphic film format in use. This chapter covers the parameters that must be set up—and the special considerations given—for these formats.
Understanding Video Interlacing Dividing each frame of video into two fields is a technique originally developed for television broadcasting to solve a number of technical difficulties with early TV equipment. In essence, interlacing reduces the perceived strobing of 30 images playing every second on a television screen. Interlacing divides each frame into two fields, each of which contains half of the image information.
This effect occurs because video fields are recorded one after the other, just like frames. When a moving subject is recorded using an interlaced video format, the subject is in one position when the first field is recorded, and in another position when the second field is recorded. When the video is played back, and each field is played in the correct order, the image appears normal.
Because each interlaced frame of video consists of two fields that contain half the information for that frame, each field can be thought of as a half-height version of the originating frame. Because, during playback, the television displays these images quickly, one after the other, the human eye is fooled into perceiving the image as having a higher resolution than each individual field actually possesses.
Another issue arises when you apply image rotation and scaling to an interlaced clip. In the following images, a rotation effect has been applied to two images, one with field rendering and one without field rendering. The right image will appear correct when played back on a broadcast monitor, because the interlaced lines are properly arrayed. The lack of clearly defined fields in the left image will cause undesirable artifacts during video playback.
To illustrate what happens when fields are improperly combined, we’ve removed one field from the image on the left below. Notice that information from both fields intermingles due to the blur, as pixels from a different moment in time bleed into the current field. Turning on field rendering gives you the correct image, shown on the right. No image information bleeds between the two fields.
Step 4: Set the OutputFrameInterlaced and fieldRendering parameters when you’re finished compositing Once you’ve completed your composite and you’re ready to render, turn on the OutputFrameInterlaced parameter within each FileIn node’s Timing tab, then set the fieldRendering parameter in the renderControls subtree of the Globals tab to the same field dominance used in your other clips. Important: Make sure you leave fieldRendering set to off until you’re ready to render.
When the deInterlacing parameter of a FileIn node is set to either odd or even, Shake separates the two fields within each frame, placing field 1 at frame 1, and field 2 at frame 1.5. This effectively doubles the number of frames processed within your script, but keeps them within the same duration of the Time Bar. Turning on deInterlacing for each FileIn node ensures that all animation, transforms, and filters are properly handled by Shake’s field rendering.
6 Set the OutputFrameRate to match the InputFrameRate parameter. 7 While you’re working in Shake, leave the OutputFrameInterlaced parameter in the OutputFrameRate subtree turned off. Once you’ve finished and you’re ready to render the resulting composite from your script as an interlaced image sequence, turn OutputFrameInterlaced on.
6 In the OutputFrameRate subtree, turn off the OutputFrameInterlaced button. Creating Interlacing From Non-Interlaced Source Media You can also use the reTiming parameters to interlace previously non-interlaced media. To create interlaced output from non-interlaced source media: 1 With a FileIn node’s parameters loaded, open the Timing tab. 2 Set the reTiming parameter to Convert. Additional parameters appear below. 3 Set the InputFrameRate parameter to match the format of the original media.
With Inc set to 0.5, the playhead moves in half-frame increments as you scrub through the Time Bar. When you use the arrow keys to move back and forth in the Time Bar, you’ll actually be moving from field to field. The first field is displayed when the playhead is on whole frames, and the second field is displayed at every frame and a half.
Setting the deInterlacing parameter for each FileIn node not only separates each field internally to Shake, but it sets the Viewer to display each field with interpolated lines of resolution added, so that each field appears as a complete image. The default interpolation quality is somewhat low, but is fast to work with. To improve the display and processing quality of individual fields, see “Setting the reTiming Parameters of Each FileIn Node” on page 198.
Note: You can also click the Home button in the Viewer to reset the ratio to 1:1. Viewer artifact example Exporting Field Interlaced Footage If you’re working on media that will be output to an interlaced video format, you have to set one additional global parameter. Once you’ve finished your composite, you need to set the fieldRendering parameter in the renderControls subtree of the Globals tab to the appropriate field dominance. Field Rendering Settings By default, fieldRendering is set to off.
In the following example, the image has been resized from 640 x 480 to 720 x 486. The image on the left has field rendering off, while the image on the right has field rendering on. In the left example, resizing the image without removing interlacing first has resulted in undesirable inter-field bleeding (in other words, the lines in the alternating fields have been enlarged and distorted, and no longer line up). The right example benefits from having been de-interlaced before image resizing.
Video Functions Shake has several other video-oriented functions. When using these features, make sure that field rendering is off, because field-rendering options may interfere with the desired result. These functions include the following: Location Function Description Globals tab timecodeMode Sets the timecode format displayed in the Time Bar. Time Bar T on keyboard Toggles timecode/frame display.
Parameters This node displays the following controls in the Parameters tab: clipMode Toggles between using the foreground (0) or background (1) images to define the resolution. field Specifies which field the first image uses. • 0 = even field • 1 = odd field mode Tells Shake if the input image is the same height as the result image. • 0 = replace. Takes every other field from the input images; input images have the same height as the result. • 1 = merge.
Parameters This node displays the following controls in the Parameters tab: field The field that is retained. • 0 = even field • 1 = odd field mode The mode in which the removed field is replaced (see above). • 0 = replicate • 1 = interpolate • 2 = blur Field Located in the Other tab, this node extracts the even or the odd field of the image, returning an image of half the Y resolution.
VideoSafe Located in the Color tab, this node clips “illegal” video values. As such, it is generally placed at the end of a composite. You can set the node for NTSC or PAL video, based on luminance or saturation. There is also an example (in the videoGamma subtree) of a conditional statement that toggles between 2.8 (NTSC) and 2.2 (PAL). Generally, these values are not touched. Parameters The VideoSafe node displays the following controls in the Parameters tab: videoType Toggles between NTSC and PAL.
The result of this expression is that if videoType is not zero (in other words, videoType is set to PAL), videoGamma is set to 2.8. If videoType is set to 1, videoGamma is set to 2.2. For more information about how expressions work, see Chapter 30, “Installing and Creating Macros,” on page 905. About Aspect Ratios and Nonsquare Pixels Shake has several controls in the Globals tab to help you work with nonsquare pixel images. These images are typically video images, or anamorphic film images.
This is a fundamental principle when compositing anamorphically squeezed elements—the actual image should never actually be scaled, but in order to work on the image, you still need to see the results as they will look in widescreen. Shake has specific parameters that allow you to preserve the original anamorphic data, while viewing the frame at the proper unsqueezed ratio for purposes of layering other images, rotoscoping, and painting.
The only speed hit is in the interactivity to adjust the viewed frame. This is the parameter you should use when dealing with video clips, since you change the X axis and leave the Y axis, which contains the sensitive field information, alone. • Film: With film media, you should set the proxyRatio (in the useProxy subtree of the Globals tab) to .5 (1/2). Use of the proxy system reduces your render time for interactive tests by half.
The Rotate node has an aspectRatio parameter. Set the parameter to .5, and the rotation is no longer distorted. The RGrad node is backward from the other nodes. The aspectRatio for this should be 1/defaultAspect (what it uses as its creation rule). Here, an RGrad with an aspectRatio of 1 is composited on the image. Since it is distorted, change the aspectRatio of the RGrad to 2 and the world is beautiful.
When composited over the image, there is distortion because of the proxyRatio. There are two options to correct this. You can scale the X parameter by half, or increase the Y parameter by two. The first option ensures the highest quality, but means you have to render the original CG element at twice the resolution of the second option.
• • • • • • • • • • • • • • ISharpen PercentBlur Pixelize Sharpen RBlur Sharpen AddText MatchMove Stabilize Text PinCushion Randomize Turbulate AddShadow 3D Software Renders If your software allows, render your scene with the proper aspect ratio. This ensures the highest quality in your composite. Tuning Parameters in Squeezed Space In addition to Rotate and RGrad, other nodes should be tuned with a squeezed aspect ratio. In the following example, a Blur node is applied to the image.
The blur now looks proportionately correct. Rendering Squeezed Images Once your composite is complete, reset the proxyRatio (in the Globals tab) to 1, and render. Do not change any other parameters. The resulting image appears squeezed on the X axis, but this distortion is corrected during the film projection process in the theater. Although you worked on the image in a squeezed state, all elements are properly positioned when the proxyRatio is returned to 1.
The correct way to account for video pixel ratios is to use the viewerAspectRatio parameter (within the format subtree of the Globals tab) to set the aspect ratio of the Viewer, leaving the fields of your video frames untouched. This also only affects the Viewer—rendered images are not affected. However, Viewer playback performance may be slightly affected. You need only to change the defaultAspect for proper rendering. Unlike using the proxyRatio method, you set defaultAspect to 1/YourVideoAspectRatio.
7 Using the Node View 7 The Node View is the heart of Shake’s graphical compositing interface. This chapter covers all aspects of navigating, customizing, and organizing nodes using this powerful tool. About Node-Based Compositing The Node View in Shake displays all of the nodes that are used in a script. This amalgamation of all the nodes used in a script is referred to as the node tree. Each node in the tree performs a specific function, and is connected to other nodes by lines referred to as noodles.
Note: Knots are only visible when the pointer is positioned over a node. Knot Noodle The entire node tree Node This node-based approach has many advantages. By expressing the entire compositing task as a big flowchart, of sorts, the flow of image data is easy to keep track of. Graphical manipulation of the individual nodes in the tree also lets you make changes by quickly turning on and off different functions in the composite, adding and removing nodes where necessary.
Navigating in the Node View Every effect in Shake is created by an individual node that has been inserted into the node tree, and each node has its own specific function and parameters. As you build progressively larger node trees, you’ll find yourself spending more and more time navigating around the Node View as you make adjustments to nodes at various levels of the node tree. As with all the other areas of the Shake interface, you can pan and zoom in the Node View to navigate around your node tree.
m To resize the node overview: Drag the upper-right corner, the top, or the right of the overview. Default size After resizing Favorite Views If you’ve assembled an exceptionally large and complex node tree, you can navigate to specific areas of your node tree and save that position of the Node View as a Favorite View. This is mainly useful for saving the position of a collection of nodes that you’ll be adjusting frequently.
m Move the pointer into the Node View, and press F1-5, where F1, F2, F3, F4, and F5 correspond to each of the Favorite Views. That quadrant is set to the originally saved position and zoom level. m m To restore the framing and state of a Favorite View, do one of the following: Right-click in the Viewer, Node View, or Curve Editor, then choose Favorite Views > View N > Restore Framing & State (where N is one of the Five Favorite views you can save) from the shortcut menu.
2 Move the pointer over the Node View, and do one of the following: • Right-click, then choose Enhanced Node View from the shortcut menu. • Press Control-E. • Open the Globals tab, then click enhancedNodeView. Enhanced Node View Parameters There are seven parameters in the enhancedNodeView subtree. showTimeDependency This parameter, when turned on, draws a bluish glow around nodes that are animated.
Note: When you clone a node by copying it and then pasting it with the Paste Linked command, the resulting cloned node displays an expression link arrow when showExpressionLinks is turned on. ShowConcatenationLinks When this parameter is turned on, a green line connects a series of nodes that concatenate. For example, three transform nodes that have been added to a node tree in sequence so that they concatenate appear linked with a green line connecting the left edge of each node.
Note: The Node View redraw speed of extremely large scripts may be reduced with noodleColorCoding turned on. There are two kinds of coding used to identify the image data that noodles represent. stipple8Bit, stipple16Bit, stipple32Bit The stipple pattern of a noodle indicates its bit depth. In the following screenshot, three renamed Bytes nodes output 8-, 16-, and 32-bit float data respectively. The stippling indicates each bit depth at a glance.
Noodle Tension The noodleTension parameter, within the guiControls subtree of the Globals tab, lets you adjust how much “slack” there is in the way noodles are drawn from knot to knot. Higher values introduce more slack, and noodles appear more curved. Lower values reduce the slack, and noodles are drawn in more of a straight line.
In the enhancedNodeView subtree, the stipple8Bit, stipple16Bit, and stipple32Bit parameters each have five different stipple patterns you can choose from, for maximum clarity. Creating Custom Stipple Patterns Different stipple patterns can be set in a .h preference file. Each stipple pattern is defined by a four-byte hex number that, when converted to binary, provides the pattern of the line drawn for each bit depth—each 1 corresponds to a dot, and each 0 corresponds to blank space.
• Right-click any Tool tab to display a shortcut menu of the available node functions. The modifier keys (see below) work as well. Additionally, if you lower the Tool tabs so that only the tabs are visible, you can also access the pop-up menus with the leftmouse button (a cool trick). Note: To add several nodes from the Tool tab shortcut menu at once, right-click the tab, then right-click each node you want to create in succession. To close the menu, left-click in the menu.
2 In the Tool tabs, right-click the node you want to add, then choose Insert Multiple from the shortcut menu. The new node is inserted after each selected node. Selecting and Deselecting Nodes There are numerous ways you can select nodes in the Node View. m To select one or more nodes, do one of the following: Click a single node to select it. m Drag a selection box around one or more nodes in the Node View. m Shift-click individual nodes to add them to the current selection.
• Right-click the first node, then choose Select > Associated Nodes from the shortcut menu. m m To select every node that’s connected above (upstream from) a selected node, do one of the following: Press Shift-U. Right-click the selected node, then choose Select > Upstream Nodes from the shortcut menu. Note: To limit the selection to only the node above the currently selected one, choose Select > Upstream 1 Level (or press Shift-Up Arrow).
m m To select every node that’s connected below (downstream from) a selected node, do one of the following: Press Shift-D. Right-click the selected node, then choose Select > Downstream Nodes from the shortcut menu. Note: To limit the selection to only the node above the currently selected one, choose Select > Upstream 1 Level (or press Shift-Down Arrow). To select a node by its name: 1 Press Command-F or Control-F in the Node View.
Function Description Select by name Enter the search string, and matching nodes are immediately activated. For example, if you enter just f, FileIn1 and Fade are selected. If you enter fi, just the FileIn1 is selected. Select by type Selects by node type. For example, enter Move, and all Move2D and Move3D nodes are selected. Select by expression Allows you to enter an expression. For example, if you want to find all nodes with an angle parameter greater than 180, type “angle>180.
You can also connect one knot to another by Shift-clicking. This is a more convenient method to use if the two knots you want to connect are far away from one another in the Node View. To connect one node to another by Shift-clicking: 1 Select the first node you want to connect. 2 Move the pointer over the second node you want to connect so that the knot is visible, then Shift-click the knot to connect both nodes together.
To connect several nodes to a multi-input node at once: 1 Select all of the nodes you want to connect to the multi-input node. 2 Shift-click the plus sign input of the multi-input node. All selected nodes are connected. One Input, Many Outputs Any single input knot on a node can only be connected to a single noodle. This is true even for multi-input nodes—each input knot can only be connected to a single noodle.
You can also drag a noodle from an input knot to the output knot of a different node. For example, you can drag a noodle from the Over1 node to the moon node. On the other hand, you can drag as many connections from a node’s output as you want. For example, you can connect a FileIn node’s output knot to several nodes. This creates multiple separate branches of image processing, which can be recombined later on in the tree.
Breaking Node Connections Node connections are broken by deleting the noodle that connects them. To delete the connection between two nodes: 1 Select the noodle you want to delete by positioning the pointer over it so that it turns red (toward the bottom) or mustard yellow (toward the top). 2 To delete it, do one of the following: • Press Delete or Backspace. • Right-click the noodle, then choose Edit > Delete from the shortcut menu.
Inserting Nodes Into a Tree You can insert nodes into the middle of the node tree in the Node View using either the Tool tabs, or the Nodes submenu in the shortcut menu of the Node View. There are several shortcuts you can use to create and insert nodes. m m To insert a new node between two nodes, do one of the following: Select a parent node in the Node View, and click a new node in the Tool tabs.
m m Select a parent node in the Node View, then, pressing the Shift key while you right-click it, choose a node from the Nodes submenu at the top of the shortcut menu. To replace an already existing node with a different one, do one of the following: Select the node you want to replace in the Node View, then Control-click the new node in the Tool tabs. m Right-click a node in the Tool tabs, then choose Replace from the shortcut menu.
m Deselect all nodes in the Node View, then right-click in the background area of the Node View and choose a node from the Nodes submenu at the top of the shortcut menu. Deleting and Disconnecting Nodes From a Tree There are several ways to remove nodes from a tree, either by isolating the node, or eliminating it completely. m m m m 238 To delete a node, do one of the following: Select one or more nodes and press Delete or Backspace.
m m Click the node, and with the mouse button held down, drag it quickly to the left and right several times to “shake” it loose. To disconnect a noodle without affecting the nodes above and below, do one of the following: Control-click a noodle. m Move the pointer over the noodle, and when the noodle turns red, press Delete or Backspace. m Select a node, then right-click it and choose Edit > Delete from the shortcut menu. Copying and Pasting Nodes Nodes can be cut and pasted within the Node View.
Moving Nodes To move a node, select the node and drag it within the Node View. If you drag a node past the edge of the Node View, the workspace will scroll, allowing you to move the selection further into that direction. Loading a Node Into a Viewer You can view the image output from any single node in your node tree.
Loading Node Parameters In order to modify a node’s parameters, you must first load them into one of the two Parameters tabs. The Parameters tabs remain empty until you click the right side of a node (or double-click the node). m To load a node’s parameters into the Parameters1 tab, do one of the following: Click the right side of the node. The parameters indicator appears on the right side of the node.
m To clear a tab so that no parameters are loaded into it: Right-click the Parameters1 or Parameters2 tab, then choose Clear Tab from the shortcut menu. It’s important to bear in mind that you can load the image from one node into the Viewer, while loading another node’s parameters into the Parameters tab. Click to load node parameters. Click once to display node in Viewer. Double-click to load both the Viewer and the node parameters.
Ignoring Nodes Nodes in the node tree can be disabled without actually removing them from the tree, using the Ignore command. Ignored nodes have no effect on your script whatsoever, and are never rendered. This is a good way to see what effect a node is having on your composition. Ignoring nodes also allows you to disable nodes you may not need any more, without permanently deleting them in the event you change your mind later on.
Name Nodes Carefully Here are some rules about names to avoid using: • Avoid using spaces or non-alphanumeric characters (’, .!, and so on). • Don’t name any node “color.” • To avoid confusion, don’t give a node another node’s name, for example, renaming a Brightness node to Fade. • Don’t use a name that’s used by a local variable within that node. • Don’t name nodes with single characters that typically have other meanings within Shake, such as x, y, z, r, g, b, or a.
gridEnabled Lets you turn grid snapping on and off. This control also toggles the background grid pattern in the Node View if gridVisible is turned on. gridVisible Displays the grid as a graph in the background of the Node View. This graph is only displayed when gridEnabled is turned on. layoutTightness This parameter affects the Layout Arrangement commands in the next section.
m To align nodes horizontally (on the same Y axis): Select one or more nodes and press Y. m To compress and align nodes vertically: Select one or more nodes and press Shift-L. The selected nodes are lined up and stacked together one against the other. Groups and Clusters A group is a collection of several nodes that are collapsed to appear as a single object in the Node View.
• To create a group and immediately open it into a cluster, right-click in the Node View, then choose Group Selected Nodes and Maximize from the shortcut menu (or press Option-G or Alt-G). To consolidate two or more groups into a larger group: 1 Select two or more groups in the Node View. 2 Do one of the following: • Right-click a group, then choose Groups > Consolidate Selected Groups from the shortcut menu. • Press Shift-G.
2 Select a group, then press G. The group expands into a cluster. Once a group is expanded into a cluster, the group node includes two additional controls: The Ungroup button The Ungroup button (on the left side of the group node) removes all grouping/cluster information. When you click this button, a warning window appears that states, “You are about to ungroup the selected group. Continue?” Click Yes to ungroup the selected group.
Group Parameters Loading the parameters of a group into the Parameters tab allows you to change the color of the cluster background (see below), add notes, and expose selected parameters. To add a note to a group: 1 Load the group into the Parameters tab. 2 Type your annotation into the Notes parameter field. Cluster notes appear at the bottom-left corner of an open cluster. To change the background color of a cluster: 1 Load the group into the Parameters tab.
The Expose Group Parameters window appears. 3 To select one or more node parameters from nodes within the cluster, do one of the following: • To expose every parameter within a node, click Select All. • To expose individual parameters within a node, expand the node’s Select All subtree, then enable the desired parameters. 4 Click OK.
The selected nodes parameters appear in the group Parameters tab. Opening Macros If you’re using macros within your script, they can be opened and closed in much the same way as groups. m To examine the contents of a macro, do one of the following: Right-click a macro, then choose Macro > Show Macro Internals from the shortcut menu. m Press B. When a macro is open, you can view any parameter or stage of the macro, but you cannot edit parameters or rewire nodes.
The principal advantage to cloned nodes is that changes made to one cloned node are automatically applied to every other cloned duplicate of that node within your script. To create a clone of a node: 1 Copy a node by pressing Command-C or Control-C. 2 Paste a clone of that node by doing one of the following: • Right-click in the Node View, then choose Edit > Paste Linked from the shortcut menu. • Press Command-Shift-V or Control-Shift-V.
Thumbnails By default, thumbnails are automatically generated in the Node View for image nodes, including but not limited to the FileIn, Grad, Ramp, and RotoShape nodes. These thumbnails are meant to help you navigate the Node View by showing where the originating images in your script are. In order to prevent these thumbnails from slowing down Shake’s processing speed, they do not automatically update to reflect changes made to them.
In the following images, the greenscreen image is PAL and the truck image is 410 x 410. thumbSizeRelative deactivated thumbSizeRelative activated thumbSize Lets you adjust the size of thumbnails in the Node View. If thumbSizeRelative is turned on, all nodes are resized relative to one another. thumbAlphaBlend Turns thumbnail transparency on and off. When thumbAlphaBlend is on, moving one thumbnail over another results in a fast look at how the nodes might appear when composited together in the Viewer.
• Press T. When a node with a thumbnail appears in the middle of a node tree, the input noodles feed into the top of the thumbnail. Updating Thumbnails To prevent unnecessary processing, thumbnails are not automatically updated, so they may not reflect the frame that’s at the current position of the playhead. Furthermore, nodes aren’t updated when you change their parameters. This can be especially noticeable in the thumbnails of QuickPaint and RotoShape nodes.
Toggling Thumbnails Between Color and Alpha Channels When the pointer is positioned over a thumbnail, a number and letter appear in the upper-left corner, indicating which frame is loaded as a thumbnail, and whether you are looking at the RGB/Color view (C) or the Alpha view (A). Thumbnails can be toggled between Alpha and Color view on an individual basis. Indicates a thumbnail displaying frame 1, in Alpha view. To toggle thumbnails between Color and Alpha view: 1 Select one or more nodes.
The Node View Shortcut Menu The following commands are available in the shortcut menu that appears when you right-click in the Node View. Shortcut Menu Option Keyboard Nodes Edit View Render Desription Create nodes directly in the Node View from the node list. Cut Command-X or Removes selected nodes and places them into Control-X the paste buffer. Copy Command-C or Copies the selected nodes into the paste buffer. Control-C Paste Command-V or Pastes the buffer into the Node View.
Shortcut Menu Option Enhanced Node View On/Off Keyboard Desription Control-E Turns the selected enhanced Node View options off and on. Snap to Grid On/Off Select Node Layout 258 Turns gridEnabled on and off in the Globals tab. Find Nodes Command-F or Activates nodes according to what you enter in Control-F the Search string field in the Select Nodes by Name window. • Select by name. Enter the search string, and matching nodes are immediately activated.
Shortcut Menu Thumbnails Groups Option Keyboard Desription Refresh Selected Thumbnails R Activates/refreshes the thumbnails for selected nodes. Show/Hide Selected Thumbnails T Turns on/off selected nodes. If you haven’t yet created a thumbnail (R), this does nothing. View RGB Channels C Displays the RGB channels. View Alpha Channels A Displays the alpha channel. Group/ G Ungroup Selected Nodes Visually collapses selected nodes into one node.
Shortcut Menu 260 Option Keyboard Desription Show Macro Internals B Opens a macro into a subwindow so you can review wiring and parameters. You cannot change the nodes inside the subwindow. Hide Macro Internals Option-B or Alt-B Closes up the macro subwindow when the pointer is placed outside of the open macro.
8 Using the Time View 8 The Time View provides a centralized representation of the timing for each image used in a script. This chapter covers how to navigate this interface, and how to make adjustments to the timing parameters of each image. About the Time View While the Node View allows you to arrange and adjust the nodes that comprise your composite, the Time View lets you view and arrange the timing of your nodes.
The Time View lets you modify the timing parameters that are found inside each FileIn node in your node tree. This means that you have the option of modifying these timing parameters either numerically, in the Parameters tab, or graphically, in the Time View. Either way, the effect is the same. As soon you make changes to a clip’s timing, an internal node called IReTime is associated with a FileIn node. The IReTime node is saved into the script, but is invisible in the Node View.
Clip Durations in the Time View The duration of image sequences and movie files (hereafter referred to as clips) referenced by a FileIn node is simply that of the source media on disk. The duration of single image files, and of image nodes generated by Shake, is considered to be infinite. When two or more nodes are combined, as with the Over or MultiLayer node, the final duration is that of the longest clip in the operation.
Image Node Controls When you move the pointer over an image node in the Time View, three controls appear: the Viewer indicator, the parameters indicator, and the Ignore control. Click the Viewer indicator to load the node into the Viewer. Click the Ignore node to ignore the node. Click the parameters indicator to load the node’s parameters into the Parameters tab. Image Sequence Timing Controls In the Time View, image nodes also have timing handles, located at the beginning and end of the bars.
m To shift a node in time: Drag an image node in the Time View to the left or right. That node’s timeShift parameter changes, and the start and end frames of the node are moved together. The inPoint and outPoint parameters, however, remain the same, since this operation does nothing to change the clip’s duration. All compositing nodes that are attached to a time-shifted image node are automatically shifted in time to match.
m To adjust the startFrame and lastFrame points of an image sequence: In the Time View, drag the left handle of an image node to adjust its inPoint parameter, or drag the right handle to adjust its outPoint parameter. Notice that the firstFrame value for that clip is labeled on the left side of the bar, and the lastFrame value is labeled on the right side—in the example above, the inPoint parameter is 40 and the outPoint parameter is 138.
You can change the repeat mode of an extended-duration clip at any time using the controls in the Timing tab of that image node. A clip’s repeating behavior is controlled by the inMode and outMode parameters in the Timing tab of the FileIn parameters. The inMode parameter controls the looping behavior of frames between the firstFrame looping handle and the inPoint, and the outMode parameter controls the frames between the outPoint and the lastFrame looping handle.
Clips With Infinite Duration Image nodes such as RGrad and Ramp have no preset range because they are generated by Shake. In the Time View, these types of nodes have infinity symbols on their left and right edges, indicating that these images have no end. To limit these nodes, grab the handles as you would with clip nodes. Customizing How the Last Frame Is Represented The Out point of an image node represents different things to different users, depending on which media applications they’re used to.
Const Point Display When Const Point Display is enabled, the frame considered as the Out point is toggled to the frame at which it becomes black, or the last frame on disk. FileIn Trim The FileIn Trim option controls what happens when you drag the outPoint handle and right looping handle past each other (first image). With FileIn Trim off, Control-dragging a timing handle past a looping handle collapses the looping portion of the clip as the clip’s total duration is changed.
In the following example, a clip that begins at frame 40 and ends at frame 80 is reversed by manually swapping inPoint and outPoint values. The modified clip now begins at frame 80, then plays in reverse until it reaches frame 40. There are no interface controls in the Time View for this functionality. The Transition Node The Transition node, located in the Other tab, is an editing node to mix or cut two clips together.
In the following example, two clips have been added to the script. Connecting both FileIn nodes to a Transition node (located in the Other tab) offsets the second input clip from the first. Notice that the transition node appears underneath, spanning the combined duration of both clips. You can now route the combined output of the Transition node to as complicated a node tree as you like, and both image nodes feeding the transition node will be treated as a single image stream.
mixer Other default choices are: • cut • dissolve • horizontalWipe • verticalWipe You can also add your own custom effects. For more information, refer to “Customizing the Transition Node” below. clipMode This option appears when mixer is set to Dissolve, allowing you to choose which image sets the DOD. channels This parameter appears when mixer is set to Dissolve, allowing you to choose which channels are dissolved.
The following is an example from the include/nreal.h file for horizontalWipe: image HWipe( image i1=0, image i2=0, float blur=0, int reverse=0, float mixPercent=“HermiteV(x,1,[0,50,50]@0,[100,50,50]@100)” ) { Color1 = Color( max(i1.width,i2.width), max(i1.height,i2.
The following images show the effect that can be achieved by increasing and decreasing the RGrad radius. Select all of the nodes in the tree in the Node View, and copy them (press Command-C or Control-C). 2 Create a text file, and paste (press Command-V orControl-V) the nodes you’ve copied into it. You’ll notice that the node tree you copied is automatically converted into Shake script. It should look like this: RGrad1 = RGrad(720, 486, 1, width/2, height/2, 1 min(width,height)/4, min(width,height)/4, 0.
Finally, calculate the resolution of the RGrad by comparing the two input sizes. The script should now look like this: image RadialWipe( image in1=0, image in2=0, float blur=0, int reverse=0, float mixPercent=“HermiteV(x,1,[0,50,50]@0,[100,50,50]@100)” ) { RGrad1 = RGrad( max(in1.width,in2.width), max(in1.height,in2.height), 1, width/2, height/2, 1, min(width,height)/4, //This is the radius min(width,height)/4, //This is the falloff 0.
6 Now comes the tricky bit—reversing the mix. You may think multiplying by -1 inverts the transformation, but you’d be wrong. Instead, you often have to subtract the value from the maximum value that you expect, in this case the distance from the center to the corner. This is part of a conditional statement that tests to see if reverse is activated. Also, invert the mask in the KeyMix to help it out.
9 Using the Audio Panel 9 The Audio Panel lets you import reference audio clips that you can use for timing and to generate keyframe data within your script. About Audio in Shake Shake supports the use of PCM AIFF and PCM Wave files in your projects. You can import one or more audio files, mix them together, extract curves based on frequency, manipulate the timing of the sound, and save the files back out again. These audio curves can also be visualized directly within the Curve Editor.
Most of Shake’s audio functionality resides within the Audio Panel. To access the audio controls, click the Audio Panel tab. The Shake audio panel opens. Loading, Refreshing, and Removing Audio Files You can load both AIFF and Wave files into Shake. The first row of buttons on the top of the Audio Panel controls loading, removing, refreshing, and previewing .aif (.aiff ) and .wav files.
To load an audio file into a script: 1 Open the Audio Panel. 2 In the Audio Panel, click the Open Audio File button. 3 In the Select Audio File window, select the audio file(s) you wish to import, then click OK. Note: You can also double-click an audio file to import it. The audio file appears in the audio track list, at the top of the Audio Panel. You can import several audio files into your script—they all appear in this list. Details about the selected audio file appear in the audio track list.
To remove an audio file from a script: 1 Select an audio file in the track list of the Audio Panel. Note: You can Shift-select or drag to select multiple files. 2 Do one of the following: • Click Remove Selected Files. • Press Delete or Backspace. The selected audio tracks are removed from your script. Previewing and Looping Audio You can use the Preview Audio button to listen to and edit audio tracks as they play. You can also loop an audio track within a designated time range.
If the audio clip’s Time Shift subparameters (at the bottom of the Audio Panel) have been changed, these parameters will modify playback. For example, if the Source In parameter (in the Time Shift subtree) has been altered, then audio will begin previewing at the new Source In point. While the audio plays, the Preview Audio button turns into the Stop Preview button. 4 To stop audio playback, click Stop Preview. When you preview an audio clip, the audio meter lights up to display the clip’s audio level.
Note: If a frame range is not specified in the Globals tab, the audio preview continues to play (beyond the end of the actual audio track) until you click Stop Preview. 2 Open the Audio Panel, and toggle looping on. 3 In the Audio Panel, click Preview Audio. The track loops within the designated frame range. Click Stop Preview to halt playback. Muting and Soloing Tracks If you have multiple audio tracks in your script, you can use the mute and solo controls to control which ones play back.
Important: Because Shake is designed primarily as a compositing application, and not a real-time editing application, audio sync is not guaranteed due to the excessive processor demands of most operations. If you want a synchronized preview of your script, use one of the Flipbook options. For more information, see “Previewing Your Script Using the Flipbook” on page 90. Alternately, you can scrub through the audio directly in the Time Bar.
To slip an individual audio track in time: 1 In the Audio Panel, select a track in the track list, and enable solo. The waveform for the track is redrawn in the Curve Editor. 2 Do one of the following: • Press Shift-Option or Shift-Alt and drag in the Curve Editor. • In the Audio Panel, enter the slip amount (in frames) in the Time Shift value field. m To slip all audio tracks in time at once: Press Shift-Option or Shift-Alt and drag in the Curve Editor.
Source Out (seconds) End point of the clip, listed as seconds. Start Time (seconds) Beginning point of the clip, listed as frames. End Time (seconds) End point of the clip, listed as frames. Playback Rate Subparameters These parameters allow you to specify the rate at which audio plays back, resampling the audio tracks if necessary to make them conform. Audio playback is only possible on computers using Mac OS X. Playback Rate (percent) Same as playback rate, but allows you to enter a specific cycle rate.
The parameters located in the Create Curves subtree let you analyze the current audio mix, creating a keyframed curve that’s stored as the Audio parameter, within the localParameters subtree of the Globals tab. The audio parameter can be referenced as an expression from any other parameter in your project. To create an audio curve: 1 Open the Audio Panel, and import one or more audio files into your project. 2 Open the Create Curves subtree.
A progress bar appears to show you how long this process takes. Opening the Globals tab reveals the Audio parameter that has been created, underneath the localParameters subtree. This parameter is now ready for use as an expression from within other parameters in your project. Create Curves Options These parameters in the Create Curves subtree of the Audio Panel let you customize how keyframe information is extracted from the audio waveform.
For example, if in peak mode, and the peak audio value over an interval is 0.5 (approximately -6 dBFS), the value entered with logarithmic mode off would be 0.5. With logarithmic mode on, it would be ( -6 + 90 ) / 90 = 0.9333. Create separate left/right curves Either one curve is created, or left and right channels are sampled and two curves are created. Lowpass Filter Activates the LPF, as described below.
Sample Rate, Bit Depth The output sample rate and bit depth of the output file. Resampling Quality When input clips are adjusted and scaled in time, their sound samples must be interpolated to the output sampling rate. How closely this is done is determined by the quality parameter. “Highest” should be used if intended for broadcast. For the technically minded, this corresponds to a 27-point symmetric Kaiser-windowed sinc interpolation.
10 Parameter Animation and the Curve Editor 10 Shake has a flexible keyframing interface for animating nearly any parameter in your script. This chapter covers how to create keyframed animation, as well as how to manipulate keyframed data using the Curve Editor. Animating Parameters With Keyframes Several controls exist throughout Shake that allow you to animate the parameters of various nodes over time.
• To keyframe parameter changes you make using a node’s Viewer controls, turn on the Autokey button in the Viewer shelf. Autokey button Whenever you first enable keyframing, a keyframe is automatically created at the current position of the playhead in the Time Bar for the affected parameters. 2 To create a second keyframe, move the playhead in the Time Bar to another frame, and then change the value of the parameter. A keyframe appears in the Time Bar to show this change.
Rules for Keyframing How keyframes are created and modified depends on two things—the current state of the Autokey buttons, and whether or not there’s already a keyframe for that parameter in the Time Bar or Curve Editor at the current position of the playhead. When animating any parameter, the following rules apply: • When the Autokey button is off and you adjust a parameter that has no keyframes, you can freely adjust it at any frame, and all adjustments are applied to the entire duration of that node.
Navigating Among Keyframes in the Time Bar Once you’ve created a number of keyframes, two keyframe navigation controls let you move the playhead from keyframe to keyframe, making it easy to jump to and modify existing keyframes. Go to previous keyframe Go to next keyframe Note: These two controls only work when the playhead is within a range of two or more keyframes in the Time Bar. If the playhead is located either before the first keyframe, or after the last keyframe, these controls have no effect.
Parameters can be represented by any one of a number of different curve types, each of which gives you a different way of controlling how a parameter’s values are interpolated from keyframe to keyframe. You can change a curve’s type and cycling mode at any time. For more information on specific curve types, see “More About Splines” on page 316. In addition to the Curve Editor tab, there are also curve editors that appear within the Parameters tabs.
Note: Whenever you turn on an Autokey button, the corresponding parameter’s curve loads into the Curve Editor. In the following example, even though the pan and angle parameters are both animated, the angle parameter is the only one that’s actually displayed in the Curve Editor. Controlling Curves Displayed in the Curve Editor There are several controls that allow you to control the visibility of curves from within the Curve Editor.
Visibility and Persistence Controls In the loaded parameters list, additional controls let you toggle the individual visibility and persistence of parameters in the Curve Editor. Persistence Visibility m To toggle the visibility of individual curves, do one of the following: Click a parameter’s Visibility button to turn the display of a curve on and off in the Curve Editor, keeping it in the list. m Select a parameter in the parameters list, and press V to toggle its visibility.
Navigating the Curve Editor There are many controls you can use to move around the Curve Editor. Useful controls for automatically framing curves: • To frame one or more selected curves to the size of the Curve Editor, press F. • To frame all curves to the size of the Curve Editor, press the Home key, or click the Home button. • To frame only the selected curves, click the Frame Selected Curves button.
Shortcut Menu Description Visibility >Toggle Visibility Inverts the visibility of all selected curves. Keyboard Select > All Curves Selects all curves in the parameters list. Command-A Control-A Select > CVs Selects all keyframes on active curves. To select all keyframes on all loaded curves, press Command-A or Control-A and then Shift-A. Shift-A Display Timecode Toggles the time display from frames to timecode.
Button Description Display Waveform Displays the waveform of any currently loaded audio files from the Audio Panel. Color controls These buttons appear in the Parameters tab for the Lookup, LookupHSV, and LookupHLS functions. They allow you to pick an input color (RGB, HSV, or HLS) and match it to a different color. Only visible curves receive keyframes on their curves. For example, if you only want to modify luminance, ensure the hue and saturation curves are disabled in a LookupHLS node.
m To add keyframes to a curve by modifying a parameter: In the node’s Parameters tab, click the Autokey button. Modifying a value when Autokey is enabled creates a keyframe at the current position of the playhead. To create keyframes at the position of the playhead on every loaded curve: 1 In the Parameters tab, click the Load Curve button for each parameter you want to keyframe. 2 Move the playhead to the frame where you want to create a keyframe. 3 Click the Autokey button.
Note: In the Curve Editor, when the pointer passes over a curve, the curve name is highlighted; when the pointer passes over a keyframe, the keyframe values are displayed. Selecting Keyframes You can edit a group of keyframes together by selecting them as a group. You can also add and remove keyframes from a previously selected group. m To select one or more keyframes, do one of the following: Click a single keyframe. m Shift-click to select multiple keyframes.
Note: To remove keyframes from a group of selected keyframes within a manipulator box, press Shift and click the keyframes. For more information, see “Modifying Keyframes” on page 303. m To deselect all keyframes: Click an empty area of the Curve Editor. Deleting Keyframes and Curves There are several different ways of deleting keyframes in the Curve Editor. m To delete one or more keyframes, do one of the following: In the Curve Editor, select the keyframes you want to delete, then press Delete.
Using the Manipulator Box You can use the manipulator box to move or scale a group of keyframes. The advantage the box has over simply selecting keyframes is that you can see the scale borders. m To use the manipulator box: Hold down the B key (for box) and drag to select a group of keyframes. The light gray manipulator box appears around the selected keyframes. m m m 304 To move the selection: Position the pointer within the box, then drag.
m To scale the selection in the Y axis: Position the pointer at the top or the bottom edge of the box, then drag. Note: Once you make a selection with the manipulator box, clicking a keyframe or clicking outside of the box deselects the box. m To add to the keyframes selected in the manipulator box: Press Shift and click the additional keyframes. m To remove selected keyframes from the group: Press Shift and click the keyframes you want to delete.
• The Key field is the time of the keyframe. • The Value field is the value of the keyframe. • The LTan and RTan fields control the tangents. If the tangents are set to 0, the keyframe is flattened (on a Hermite curve). You can also press H to set horizontal tangents. The value field displays “-----” when multiple keyframes are selected. To set all keyframes to that value, enter a number into the Value field. In the parameters list, the Val field displays the value of the curve at that point in time.
Using Keyframe Move Modes In the Curve Editor, there are four keyframe move modes—Bound, Interleave, Push, and Replace—that are activated by the four states of the Keyframe Move Mode button. These modes control the behavior of the keyframes when the keyframes are moved left or right past non-active keyframes. To change modes, click the Keyframe Move Mode button in the bottom-left corner of the Curve Editor.
When the Interleave mode is set, the selected keyframes jump over the adjacent nonselected keyframes to the next segment of the curve. Push When the Push mode is set, the selected keyframes push the other keyframes along the curve. In the following example, the selected keyframes are pushed to the left of the Curve Editor. Therefore, keyframe A pushes keyframes 1 and 2, as well as all other keyframes to the left of keyframe 1.
When the Replace mode is set, the selected keyframes replace the adjacent nonselected keyframe(s). In the following example, keyframes A, B, and C have slipped past the position of keyframes 1 and 2, removing them from the curve. Applying Operations to Curves To apply operations such as Smooth and Jitter to curves or keyframes, use the Apply Operation button, located in the lower-left corner of the Curve Editor.
In the following example, the “scale” operation type is selected. 4 Where appropriate, enter the value(s) for the expression in the value fields. 5 Do one of the following: • To apply the operation to a selected curve, make sure that the Apply Curve/Keys button is set to Curve, then click Apply. • To apply the operation to selected keyframes, make sure that the Apply Curve/Keys button is set to Keys, then click Apply.
The selected operation is applied to the selected curve or keyframes. These operations include the following: • scale: You can manually scale a curve using a manipulator box. This scale function in the Curve Processing window, however, allows you to enter specific scaling values. Enter the curve center and values. The following curve has a center of 0, 0 and .5, .5 for the scale values.
• jitter: The opposite of smooth, jitter removes all values except for the noise using the formula (Unmodified Curve - Smoothed Curve = Jitter). Once the function is applied, the curve snaps down to approximately the 0 value, so the curve may disappear (press F or click the Home button to reframe the Editor). This is useful for stabilizing a jerky camera move. You can keep the overall camera move, but remove the jerkiness. The vertical scale of this image is much smaller than the first example snapshot.
• negate: Flips the curve around the 0 point, so a value of 300 turns into a value of -300. Again, the curve may disappear, so press F or click the Home button to reframe the Editor. • average: Allows you to average two curves together. When the Operation mode is set to average, the Dest Curve button appears, allowing you to select a second curve. Click this button to select the curve that is averaged with the current curve. In the following example, the random curve was averaged with a cos expression.
• resample: Replaces the curve or expression with a new sequence. This is useful for two purposes. First, you “bake” an expression, turning it into a keyframe curve. Second, you can adjust the number of keyframes that are on a curve. To set the resample, enter a frame range. For example, set 1-50 to enter 1 keyframe per frame from frames 1 to 50; 1-50x10 to enter only 5 keyframes every 10 frames, and so on. Copying and Pasting Keyframes You can copy and paste keyframes from one curve to another curve.
5 In the Curve Editor, position the playhead at the frame you want to paste the keyframes (the first keyframe pastes at the position of the playhead). 6 Press Command-V or Control-V to paste the keyframes. The keyframes are pasted at the position of the playhead. Modifying Curves You can modify a curve type, and its repetition mode, as well as apply filter effects (smooth, jitter extraction, and so on) to a curve.
Note: The KeepSlope option cannot be used with curves that have expressions applied to them. To learn how to use local variables and expressions to control your curves, see Tutorial 4, “Working With Expressions,” in the Shake 4 Tutorials. For more information on the cycle types, see “More About Splines” on page 316. The Right-Mouse Menu The lower portion of the right-click shortcut menu in the Curve Editor includes additional options. • Display Timecode: Toggles between frame count and timecode count.
In addition, the keyframes completely define the curve, so there is no tangent control whatsoever. Cardinal Splines CSpline(cycle, value@key1,value@key2,...value@keyN) CSplineV(time_value, cycle, value@key1,value@key2,...value@keyN) Cardinal splines trade off curvature continuity for local control. When a keyframe moves, only four segments are affected (two before and two after the keyframe).
Jeffress splines are similar to CSplines, except they are guaranteed to never overshoot. If two keyframes have the same Y value, a flat segment connects them. This is very nice for animation, since you have a good idea of your limits. Hermite Splines Hermite(cycle,(value,tangent1,tangent2)@key1,... (value,tangent1,tangent2)@keyN) HermiteV(time_value,cycle,(value,tangent1,tangent2)@key1,..
Linear Splines Linear(cycle,value@key1,value@key2,...value@keyN) LinearV(time_value, cycle,value@key1,value@key2,...value@keyN) With Linear splines, there is not much mystery. No smoothness, but you know exactly what you get. Step Splines Step(cycle,value@key1,value@key2,...value@keyN) StepV(time_value, cycle,value@key1,value@key2,...value@keyN) Step splines create a stair-stepping spline that maintains its value until the next keyframe. This is great for toggling functions.
Cycle Types You can change how the curve cycles its animation before and after the curve ends. The cycle is represented by a dotted line in the Curve Editor. The value is declared with the first parameter of a curve, for example, Linear (CycleType,value@frame1,...). Each cycle type has a numeric code: • 0 = Keep Value • 1 = KeepSlope • 2 = RepeatValue • 3 = MirrorValue • 4 = OffsetValue KeepValue Keeps the value of the first and last keyframe when a frame is evaluated outside of the curve’s time range.
KeepSlope Takes the slope of the curve at the last keyframe and shoots a line into infinity. RepeatValue Loops the animation curve. It works best when you set the first and last points at the same Y value, and maintain a similar slope to ensure a nice animation cycle.
MirrorValue Also loops the animation, but inverts the animation each time the cycle repeats. OffsetValue Also loops the animation, but offsets the repeated curve so that the end keyframes match up.
The Flipbook, Monitor Previews, and Color Calibration 11 11 As you work with Shake, the Flipbook lets you preview your scripts in motion before actually rendering them to disk. The Monitor Preview control lets you send the Viewer output to an external monitor, allowing you to examine your image output on a different screen. Cached Playback From the Viewer You can cache frames using the Time Bar playback controls, to preview your work right in the Viewer.
2 Load the node into the Viewer that represents the image you want to preview. 3 Do one of the following: • Click the Flipbook button. • Right-click in the Node View, then choose Render > Render Flipbook from the shortcut menu. Enter your settings in the Flipbook Render Parameters window and click Render. The images are rendered into RAM. A Flipbook window appears, and the specified timeRange is rendered into RAM for playback. You can also launch the Flipbook from the command line.
Keyboard Command Description T Fixes the frame rate to real-time playback. O Displays information on the image (available on Linux systems only). As the Flipbook plays, the frame rate is displayed in the title bar. If the Flipbook is playing back in real time, the title bar frame rate is followed by the word, “Locked.” If your computer cannot maintain the desired speed, Shake will drop frames, indicating the percentage of dropped frames in the title bar.
Use the following formula to determine the amount of required memory: width * height * channels * bytes per channel * images = bytes For example, a single 1024 x 768 RGB 8-bit (1 byte) per channel image is: 1024 * 768 * 3 * 1 = 2359296 bytes Or, it is approximately 2.4 MB per frame. To convert from bytes to megabytes (MB), divide by 1024 two times (1024 equals the number of bytes per kilobyte). Thankfully, all operating systems come with calculators. For a rough approximation, drop the last 6 digits.
To render a Disk Flipbook: Note: It is recommended to select a format for the Flipbook from the format pop-up menu in the Globals tab before rendering. 1 Choose Render > Render Disk Flipbook. The Flipbook Render Parameters window appears. 2 In the Flipbook Render Parameters window, set your Disk Flipbook parameters: • Viewer Scripts, DODs, and Lookups: To apply an active Viewer Script, Viewer DOD, or Viewer Lookup to the Flipbook render, enable the desired parameter.
• quicktimeCodec: Click the codecOptions button to open the Compression Settings dialog. Choose a codec from the Compression type pop-up menu. By default, the Animation codec is selected. • videoOutput: To enable playback on a broadcast monitor, enable the videoOutput parameter. Note: When using a broadcast monitor, ensure that the quicktimeCodec parameter is the same as the device parameter found in the videoOutput subtree.
To view and save the Disk Flipbook: 1 In the Shake Preview (Shake QuickTime Viewer) window, click the Play button. Note: You can also press the Space bar to start and stop playback. 2 To loop the playback, choose Movie > Loop. Note: You can also choose Loop Back And Forth to “ping-pong” the playback. If you’re using a broadcast monitor, the Movie menu includes the following additional options: • Video Output: Enables and disables the Flipbook display in the broadcast monitor.
Viewing on an External Monitor When using the Mac OS X version of Shake, you can preview your work on a second display. This can either be a second computer monitor, or a broadcast video monitor connected to a compatible video output card (compatible video output cards support an extended desktop). For more information on compatible video cards, go to http:// www.apple.com/shake/. Note: The broadcast viewer option is not available on the Linux version of Shake.
broadcastHighQuality When the broadcastHighQuality parameter is turned on, the image is fit to the size of the broadcast monitor in software mode (rather than hardware mode). The broadcastHighQuality parameter applies a scale node and a resize node, instead of using OpenGL. The broadcastHighQuality parameter is enabled by default. broadcastGammaAdjust Lets you adjust the gamma of your broadcast monitor to insure proper viewing (for example, if you are sending an SD NTSC signal to an HD monitor).
Note: This node also allows you to use calibration profiles generated by a Truelight Monitor probe. • The calibration profiles generated using TLCalibrate can then be used by the Truelight VLUT control in the Viewer shelf. The Truelight VLUT lets you previsualize the image in the Viewer as it will look after being output from a film recorder, or displayed by a high definition monitor or projector.
12 Rendering With the FileOut Node 12 When you’ve finished your composite, you can set up one or more sections of your script to be rendered using FileOut nodes. This chapter covers how to render scripts from the Shake interface, from the command line, or by using Apple Qmaster. Attaching FileOut Nodes Prior to Rendering After you’ve finished creating the necessary effect in Shake, you export your finished shot by attaching a FileOut node to the section of the node tree that you want to write to disk.
You can also branch multiple FileOut nodes from the same node, to output several versions of the same result. In the following example, two FileOut nodes simultaneously write both a 10-bit 2K log Cineon image and an 8-bit video resolution linear gammaadjusted frame, in order to obtain a video preview of the composite before sending the filmout images to a film processing lab. Note: You cannot export a QuickTime movie with a dynamically varying frame size by using a FileOut node.
File Names If you write an image without a file extension (for example, image_name instead of image_name.cin), and you haven’t explicitly set an output format, Shake writes the image to its native .iff format. Otherwise, adding a file extension defines the type of file that will be written. For example, adding .tiff specifies a .tiff sequence, while adding .mov results in the creation of a QuickTime movie.
fileFormat If no extension is given, the output format is .iff. To override this behavior, explicitly set the output format. QuickTime Parameters The following parameters become available from the codecOptions button if the fileFormat pop-up menu is set to QuickTime. codec A list of all available compression codecs installed on that computer. compressionQuality The quality of the compression algorithm. A value of 1 is maximum size, maximum quality. 0 is minimum size, minimum quality.
This further compresses uboat.iff, maintains it in .iff format, and retains the Z channel. For more information on executing scripts, see Appendix B, “The Shake Command-Line Manual,” on page 1015. Using the Render Parameters Window When a render is performed using the Render menu, the Render Parameters window opens. This window overrides the Global settings for your render. Note that these settings are not saved into the script; they only control how the Shake interface renders.
updateFromGlobals Indicates if your settings match the Globals tab settings (updated), or if you have modified the settings (update now), in which case the button allows you to update the settings from the Globals tab. timeRange Set a new time range using Shake’s standard frame syntax; for example, 1-100 renders 1 to 100, 10-20x2 renders frames 10, 12, 14, up to 20, and so on. useProxy Sets your proxy settings. quality When this is set to lo (0), anti-aliasing is disabled.
The Render Menu There are four options in the Render menu. Menu Option Description Render Flipbook Renders a Flipbook of the contents of the current Viewer. It first launches the Flipbook Parameters Window that allows you to override the Global parameters. To cancel the render, press Esc in the Flipbook window. See “Previewing Your Script Using the Flipbook” on page 90 for instructions on how to use the Flipbook.
Note: If Apple Qmaster isn’t installed but the sys.useRenderQueue plug is declared, a message is sent to the console upon startup, and the following options do not appear. renderQueue Options The renderQueue parameter group contains the following options: queueName The name of the render queue software being used. If Apple Qmaster is installed, “Qmaster” appears here.
Important: When you submit Shake jobs to a cluster, the working directory should reside on a shared volume that’s accessible to all the computers in the cluster. This ensures that the working directory is accessible to the rest of the nodes in the cluster. cluster A pop-up menu that allows you to choose which cluster you want to use to perform the job. All clusters set up in your render queue software will appear here. refreshClusterList Shake checks for available clusters during startup.
13 Image Caching 13 Shake has a powerful image caching system that keeps track of previously rendered frames in order to speed your workflow as you work within the interface. This system can be customized to optimize how you work. About Caching in Shake Shake’s cache is a directory of pre-rendered images, with script information about each frame. When Shake displays the image data for a node tree at a given frame, it first checks the cache to see if that frame has been rendered before.
You can set the cacheMode to one of four states: • none: Cache data is neither read nor written. • read-only: Preexisting cache data is read, but no new cache data is generated. • regular: The cache is both read from and written to, but normal caching does not occur when the global time is changed (as when moving the playhead). • aggressive: The cache is both read from and written to, and normal caching occurs whenever the global time is changed (as when moving the playhead).
From that point on, Shake references the cached image data within that node, instead of constantly reprocessing the nodes that precede it, unless a change is made to one of the preceding nodes. This section of the node tree is cached by the selected Cache node below. This Cache node caches the image generated by the nodes above it. Important: Using a Cache node crops the image to the current image size, eliminating data from the Infinite Workspace from that point in the node tree on.
The total cache memory limit has been exceeded. The second possibility is that the amount of memory needed by all the Cache nodes in your script exceeds the memory assigned to the cache by the diskCache.cacheMemory global plug. In this case, no additional Cache nodes may be cached without increasing the diskCache.cacheMemory global plug. For more information on the global plugs referenced above, see “Cache Parameters in the Globals Tab” on page 343.
Parameters in the Cache Render Parameters Window The Cache Render Parameters window has the following parameters: renderCacheNodes If you have multiple Cache nodes in the node tree, you can select one or more of these and render them simultaneously by setting renderCacheNodes to Selected in the Cache Render Parameters window. Or you can render all Cache nodes in the node tree by setting renderCacheNodes to All. timeRange If necessary, you can change the timeRange to cache a different frame duration.
cacheStatus This is a display-only parameter that shows whether the input image has been cached or not. • not cached: Nothing has been written to the cache. • in disk cache: Input image data has been moved to the disk cache. This is a result of the memory cache becoming full, or cache images having been saved after exiting a previous Shake session. • in memory cache: The input image data has been written to the memory cache.
Commands to Clear the Cache Ordinarily, cached frames in memory are written to disk and cleared as appropriate whenever you quit Shake. If necessary, you can also choose to clear parts of the cache manually while Shake is running. Important: It’s advisable to quit Shake normally whenever possible. If Shake quits unexpectedly, or you force-quit Shake yourself, the disk cache is invalidated. As a result, the remaining data on disk is unusable by Shake.
The processing cache is mainly used to store image tiles (tiles are portions of the complete image) generated by nodes that need surrounding pixels to perform their image processing operations during a render. Example nodes include the Blur, Transform, Warp, PinCushion, and Twirl nodes.
Similar to the processing cache, the image cache has both a fast RAM-based component and a slower disk-based component. However, the disk-based component of the image cache is only active during interface sessions (unlike the processing cache, which is active in all Shake run modes). In addition, the disk-based component of the image cache is limited in size and, when the disk cache fills up, Shake discards image data using an algorithm similar to that used by the processing cache.
The size of the RAM-based component of the processing cache is set in the nreal.h file using the cache.cacheMemory global plug. The default size is 128 MB and Shake internally sets a 256 MB upper limit on the size of this cache. This internal upper limit can be modified using the cache.cacheMemoryLimit plug. This is only recommended when working on systems with over 2 GB of RAM. The following general guidelines apply when setting the cache.
The following guidelines apply when setting the diskCache.cacheMemory size: • When editing large node trees in the interface, working at higher bit depths (that is, float), or repeatedly playing back an image sequence, you should consider increasing the diskCache.cacheMemory size to 256 MB, depending on the amount of physical RAM installed in the workstation.
diskCache.cacheMaxFileSize The global plug sets the maximum file size (in bytes) that can be stored in the diskbased component of the image cache. Greater values allow Shake to store larger images, since each cached image is stored in a separate file. However, some file systems have limits on both the maximum number of open files allowed and the maximum size of those files, so you can use this parameter to reduce the size of the files being used in the image cache if a system’s file limit is being exceeded.
14 Customizing Shake 14 Shake’s graphical interface can be highly customized. This chapter covers how to create preference files, and explains the different variables and settings that can be modified by the user. Setting Preferences and Customizing Shake This chapter explains how to customize the appearance of Shake, macro interactivity, and performance parameters. It also lists environment variables you can set to improve Shake’s performance.
Finding Shake’s Default Settings Shake uses two important files to set the original default settings. These files are named nreal.h and nrui.h, in the following directory: On Mac OS X /Contents/Resources On Linux /include Warning: You should never modify either of these files. Doing so risks damaging your Shake installation, requiring you to reinstall Shake. The first file, nreal.h, lists every function and default setting in Shake.
Possible Preference File Locations Shake .h preference files can be saved in one of several locations (.h files in each of these locations are read by Shake in the order listed): • In the Shake directory, Contents/Resources/ and Contents/Plugins/startup (/ include/startup/ui for Linux installs). These directories are scanned every time Shake is launched by any user that is using Shake called from this directory. • In any directory listed in the $NR_INCLUDE_PATH list.
Installing Custom Interface Settings Settings that change the interface in some way (including macro interface files) are usually located in: /include/startup/ui These also have a .h file extension, for example: /Users/my_account/nreal/include/startup/ui/slider_settings.h This is referred to as the ui directory or sometimes startup/ui directory. Files inside it are referred to as ui .h files.
Troubleshooting Preference Files If your custom preference files do not appear to be working, check the following: • Does the file have a .
Setting Colors for the Nodes in the Node View In the ui directory: nuiSetMultipleObjectsColor( nodeRed, nodeGreen, nodeBlue, textRed, textGreen, textBlue, “DisplaceX”, “IDisplace”, “PinCushion”, “Randomize”, “Turbulate”, “Twirl”, “WarpX” ); This command assigns colors to nodes in the Node View. The nodeRed, green, etc., and textRed, green, etc., are supposed to be float values.
Setting Colors for the Time Bar In the ui directory: gui.color.timeSliderTop = 0x373737FF; gui.color.timeSliderBottom = 0x4B4B4BFF; gui.color.timeSliderFocus = 0x5B5B5BFF; gui.color.timeSliderText = 0x0A0A0AFF; gui.color.timeSliderTextFocus = 0x000000FF; gui.color.timeSliderRange = 0x373737FF; gui.color.timeSliderRangeReversed = 0x505037FF; gui.color.timeSliderRangeText = 0x0A0A0AFF; gui.color.timeSliderLines = 0xFFFFFFFF; gui.color.timeSliderCurrent = 0x00FF00FF; gui.color.
Setting Colors for Groups in the Node View In the ui directory: nuiSetObjectColor(“Group”, .75, .75, .75); This sets the color of collapsed groups. If you set them to 1, the group takes on the color set in the Group’s color setting: nuiSetObjectColor(“Group”, 1., 1., 1.); Setting Colors for the Curves in the Editor In the ui directory: gui.color.curveDef = 0x658a61; gui.color.curveDefFoc = 0xcccc26; gui.color.curveDefSel = 0xcccc26; gui.color.
gui.color.curveGFoc = 0x00ff00; gui.color.curveGSel = 0x00ff00; gui.color.curveGFocSel = 0xaaffaa; //Curves starting with ’b’ or ’B’ gui.color.curveB = 0x406bf7; gui.color.curveBFoc = 0x1818ff; gui.color.curveBSel = 0x1818ff; gui.color.curveBFocSel = 0x8888ff; //Curves starting with ’a’ or ’A’ gui.color.curveA = 0x888888; gui.color.curveAFoc = 0xbbbbbb; gui.color.curveASel = 0xbbbbbb; gui.color.
• textfield.fontColor: The color of the values within the value field. • tempKeyBackClr: A warning color for values entered when not in autosave mode for animated parameters. The value is not saved until the Autokey button is enabled. Some text colors can also be interactively modified in the Globals tab. These are saved into /nreal/settings when you choose File > Save Interface Settings. Setting Time View Colors In the startup or ui directory: gui.color.timeViewBarStd = 0x737373; gui.color.
Creating a Custom Palette In the ui directory: nuiSetColor(1,1,0,0); nuiSetColor(2,1,0.5,0); nuiSetColor(3,1,1,0); etc. This assigns default colors to the palette icons, with the first number as the button number. Custom Stipple Patterns in the Enhanced Node View Different stipple patterns can be set in a .h preference file.
framesPerSecond, fieldRendering ); DefFormatType( “Academy”, 1828, 1556, 1,1,24,“24 FPS” ); Setting the Default Format Whenever Shake Is Launched Add the following: script.format = “FormatName”; Setting Format Defaults In the startup directory: script.defaultWidth = 720; script.defaultHeight = 486; script.defaultAspect = 1; script.defaultBytes = 1; script.format = “Full”; Using the script.format overrides the other settings—you either set the first four or the format settings, as shown above.
Creating Custom Listings for the Format Pop-Up Menu In the startup directory: DefTimecodeMode( “Name”, fps, numFramesToDrop, numSecondsDropIntervals, numSecondsDropException ); DefTimecodeMode(“24 FPS”, 24); DefTimecodeMode(“30 FPS DF”, 30, 2, 60, 600); These define the timecode modes for the timecodeMode pop-up menu in the Globals tab. To set the default timecodeMode, use: script.timecodeMode = “24 FPS”; Default Timecode Modes and Displays In the startup or ui directory: script.
This shows, in seconds, how often the autoSave script is performed. The script is saved automatically in your User directory as autoSave1.shk, autoSave2.shk, and so on, up to autoSave5.shk. It then recycles back to 1. If you lose a script because Shake unexpectedly quits, you can load in the autoSave version. Four other autosave behaviors can be customized within a .h preference file. Autosave Directory In the startup directory: script.
Font Size for Menus and Pop-Up Menus In the startup directory: // It can take the following values: //tiny, small, medium, big, std gui.menu.fontSize= “std”; This should be in a ui .h file, but it must be set before the interface is built, so it goes in a startup file. The example is “tiny.” The default is “std.
Adding Functions Into a Menu In the ui directory: nuiOpenMenu(“Render”); nuiMenuSeparator(); nuiMenuItem( “Highend2D”, LaunchBrowser( “http://www.highend2d.com”,1 ) ); nuiPopMenu(); This creates an entry in the Render menu, split from the other entries by a separator.
Setting the Time Bar Frame Range In the ui directory: gui.timeRangeMin = 1; gui.timeRangeMax = 100; That pretty much says it all, doesn’t it? Default Timecode Modes and Displays In the startup or ui directory: script.framesPerSecond = 24; script.timecodeMode = “24 FPS”; gui.timecodeDisplay = 0; Set one or the other. Setting the timecodeMode allows you to use drop-frame settings. See above to set the timecode modes.
Using the UNC File Name Convention In the startup directory: script.uncFileNames = 1; Shake automatically assigns the UNC file name, that is, the entire file path name using the network address starting with //MachineName//DriveName/path. This ensures proper network rendering. However, you can turn this off by assigning the uncFileNames to 0, at which point local file paths are maintained. You can use local paths in either case, but they get converted when UNC is on.
All directories assigned here appear in your Favorites area of the Directories pop-up menu in the Browser. To also bookmark a directory in the Browser, click the Bookmark button and then choose File > Save Interface Settings. This saves a setting in your $HOME/nreal/settings directory. Assigning a Browser Pop-Up Menu to a Parameter In the ui directory: nuxDefBrowseControl( “Macro.imageName”, kImageIn ); nuxDefBrowseControl( “Macro.imageName”, kImageOut ); nuxDefBrowseControl( “Macro.
• • • • • • kAnyIn: Directory of the last input directory of any type. kAnyOut: Directory of the last output directory of any type. kScriptIn: Directory of the last script input directory. kScriptOut: Directory of the last script output directory. kExprIn: Directory of the last expression input directory. kExprOut: Directory of the last expression output directory.
Tool Tabs There are a number of ways you can customize the available Tool tabs. Setting the Number of Node Columns in a Tool Tab In the /include/nrui.h or a startup file: gui.doBoxColumns = 8; This sets the number of columns for the nodes in the Tool tab, which is sometimes called the “Do Box.” Unlike the other ui. h files, this must go in /include/ nrui.h, placed right before the call to start building the Image tab. To activate it, uncomment the bold line in the nrui.
This calls the alternative icon set, which concentrates more on the name of the function. The alternative icons are stored in icons/fxAlt, with the same name as the normal icons set, for example, Image.Average.nri, and so on. The dimensions for these icons are 130 x 26. Because they are wider, you typically limit the columns to five in a normal Shake environment. For a macro on generating these icons, see “MakeNodeIcon Macro” on page 998.
• The file name is TabName.Whatever.nri. This example is therefore called Image.Flock.nri. • The icon border is added automatically by Shake. The section that says Flock(0,0,0) is the function of what that button actually does. You can assign any function to these—read in scripts, call multiple nodes, and so on. If the function does not have default values for its parameters, they must be provided here.
You can create multiple nodes with one button click when you call up a function. For example, if you always attach a Blur node to a QuickShape, you can do this by embedding one function within another. The first argument for a function is usually the image input. By substituting the value (usually 0) with a different function, that function feeds into your first function. In the above example, QuickShape is fed into Blur. Light Hardware Mode In the ui directory: sys.
Using Parameters Controls Within Macros These are commands typically assigned to help lay out your macros by setting slider ranges, assigning buttons, and so on. These behaviors are typically assigned to specific parameters. They can be applied either globally (all occurrences of those parameters) or to a specific function. For example, if there is a trio of parameters named red, green, blue, Shake automatically assigns a Color control to it.
Notice that you must first group the parameters into a subtree (the first five lines of the above example). Color controls automatically appear if you name your trio red, green, blue or red1, green1, blue1, or red2, green2, blue2. There are three parameters for the nuiConnectColorPControl function.
nuiPopControlGroup(); nuiPushControlWidget( “MyFunction.Color”, nuiConnectColorPControl( kRGBToggle, kCurrentColor, 1 ) ); This is an older version of the Color control without the cool extra controls. Changing Default Values In the /include/nrui.h file: nuiPushToolBox(“Color”); nuiToolBoxItem(“Add”, Add(0,0,0,0,0,0)); nuiToolBoxItem(“AdjustHSV”, AdjustHSV(0)); nuiToolBoxItem(“Brightness”, Brightness(0,1)); nuiToolBoxItem(“Clamp”, Clamp(0)); nuiToolBoxItem(“ColorCorrect”, ColorCorrect(0)); ...
Grouping Parameters in a Subtree In the ui directory: nuiPushControlGroup(“Func.timeRange”); nuiGroupControl(“Func.inPoint”); nuiGroupControl(“Func.outPoint”); nuiGroupControl(“Func.timeShift”); nuiGroupControl(“Func.inMode”); nuiGroupControl(“Func.outMode”); nuiPopControlGroup(); This groups parameters into a subtree that can be opened and closed by the user. This example, although it says “Func,” is for the FileIn node. Setting Slider Ranges In the ui directory: nuiDefSlider( “Funct.
Even though the sliders are in relatively the same position, there are different numbers in the value fields. You can set slider ranges and precision with this function. The first line assigns a slider range just for the yPan parameter of the Move2D function. Note the use of the height variable so the range adjusts according to the input image. The second line assigns a range for the angle parameter in any node. The third line also has optional precision parameters, which are granularity and notch spacing.
Creating Radio Buttons In the ui directory: nuxDefRadioBtnControl( “Text.xAlign”, 1, 1, 0, “1|ux/radio/radio_left”, “2|ux/radio/radio_center”, “3|ux/radio/radio_right” ); This example is for the Text node. This code creates a series of radio buttons that are mutually exclusive. The naming convention assumes that you have four icons for each name, with the icon names name.on.nri, name.on.focus.nri, name.off.nri, and name.off.focus.nri.
nuxDefExprToggle(“Func.parameter”, “repl.nri|repl.focus.nri”, “interp.nri|interp.focus.nri”, “blur.nri|blur.focus.nri” ); This assigns a series of buttons to toggle through integers starting at 0. The first line is assigned a value of 0, the second line assigned a value of 1, the third assigned a value of 2, and so on. You can place as many toggles as you want.
Placing a Curve Editor Into a Parameters Tab In the ui directory: nuiPushControlGroup(“colorExpr”); nuiGroupControl(“Lookup.rExpr”); nuiGroupControl(“Lookup.gExpr”); nuiGroupControl(“Lookup.bExpr”); nuiGroupControl(“Lookup.aExpr”); nuiPopControlGroup(); //Makes all curves invisible by default registerCurveFunc(“colorExpr”); //This makes all curves visible by default registerCurveFuncVisible(“colorExpr”); gui.colorControl.
By default, Shake protects the user from test rendering an enormous image by limiting the resolution of the Viewer to 4K. If the user accidentally puts a Zoom set to 200 on the composite, it does not try to render an enormous file, but instead only renders the lower-left corner of the image cropped at 4K. To change this behavior, set a higher or lower pixel resolution. These assignments have no effect on files written to disk.
float float float float xScale = 1, yScale = 1, xCenter = width/2, yCenter = height/2 This gives you the border and center controls to change the scale center. You can grab a corner to scale X and Y, or an edge to scale X or Y. CornerPin Controls In the startup macro file: float float float float float float float float x0 y0 x1 y1 x2 y2 x3 y3 = = = = = = = = 0, 0, width, 0, width, height, 0, height In the ui file: nuiPushControlGroup(“Func.Corner Controls”); nuiGroupControl(“Func.
Box Controls In the startup macro file: int int int int left = width/3, right = width*.66, bottom = height/3, top = height*.66 In the ui file: nuiPushControlGroup(“MyFunction.Box Controls”); nuiGroupControl(“MyFunction.left”); nuiGroupControl(“MyFunction.right”); nuiGroupControl(“MyFunction.bottom”); nuiGroupControl(“MyFunction.top”); nuiPopControlGroup(); This creates a movable box. You can grab corners or edges, or the inside crosshairs. This example is applied to a SetDOD function.
Offset Controls In the startup macro file: float xOffset = 0, float yOffset = 0 This is similar to the Pan controls, but with center crosshairs. This control is available in the Other–DropShadow node. Rotate Controls In the startup macro file: float angle = 0, float xCenter = width/2, float yCenter = height/2, This gives you a rotation dial and a center control. This example is plugged into a Rotate function.
Point Controls In the startup macro file: float float float float float float xCenter = width*.33, yCenter = height*.33, xPos = width*.66, yPos = height*.33, myPointX = width/2, myPointY = height*.66 In the UI file: nuiAddPointOsc(“Func.myPoint”); These three sets of parameters create a crosshairs control. Center and Pos are default names—the Center pair is also associated with the angle and the scale parameters.
Radius Controls In the startup macro file: float float float float radius = width/6, falloffRadius = width/6, xCenter = width/2, yCenter = height/2 This is basically for RGrad, but maybe you can do some more with it. Template Preference Files You can add additional parameters and default settings by adding files into the startup/ ui/templates directory. Each time Shake is launched, it adds these extra parameters.
The default settings in Shake are limited to the ones you find in the standard QuickTime Compression Settings dialog. To change the default QuickTime configuration: 1 Create a script with a FileOut node. 2 Select the FileOut node, then choose QuickTime from the fileFormat pop-up menu in the Parameters tab. 3 Click codecOptions, then set the codec options in the Compression Settings dialog. 4 Save the script. 5 Open the script in a text editor and find the definition of the FileOut node you created.
Environment variables are strings of information, such as a specific hard drive, file name, or file path, set through a shell (for example, in Terminal on a Mac OS X system) that is associated with a symbolic name (that you determine). This information is stored in a hidden file. Each time you launch Shake, the operating system and the Shake application look at the hidden file to set the environment variables.
To set the Shake path in the Terminal, do the following: 1 Launch Terminal. 2 In the Finder, navigate to the Shake application (usually located in the Shake4 folder in the Applications folder). 3 Drag the Shake icon to the Terminal. The Shake path is automatically entered in the Terminal. 4 Set environment variables for Shake. For example, you can specify the location of important files that your Shake script needs when opened. 5 Specify the Shake directory. Creating the .
8 In the text document, create the following file (if you’re reading this in the PDF version of the user manual, you can copy the following and paste it into the text document) and edit the information. Note: The following is an example file for instructional purposes only.
a To ensure you are still in your Home directory, type the “present working directory” command: pwd Using the example from step 2, this should return: /Users/john b Enter the following: mv environment.plist .MacOSX The environment.plist file is moved into the .MacOSX directory. c To confirm the environment.plist file is located in the .MacOSX directory, enter: cd .MacOSX This command moves you into the .MacOSX directory. d Enter: ls The content of the .MacOSX directory, the environment.
At login, your computer runs the default /etc/csh.cshrc, followed by any .tcshrc files in your login directory. This sequence is repeated whenever a new tsch is spawned—for example, when you launch Terminal. Note: As mentioned above, Shake only reads the .tcshrc environment file when Shake is run from the Terminal (the file is not applied when Shake is launched from the application icon). To add a variable for Terminal commands, enter the following formatting (edit to suit your own project) into $HOME/.
Cineon frames are written in the slower top-down method for compatibility with other, less protocol-observant, software. • NR_FONT_PATH: Points to a directory where you want Shake to scan for additional fonts used by the Text/AddText functions. In Mac OS X, fonts are stored in /Library/Fonts and $HOME/Library/Fonts. On Linux systems, fonts are typically stored in /usr/lib/DPS/AFM. • NR_ICON_PATH: Points to a directory where you can save your own icons for Shake functions.
To display the day of the week: alias day date +“%A” To display all Shake processes that are running: alias howmany ’ps -aux | grep shake’ Interface Devices and Styles This section discusses considerations when using a stylus, setting mouse behavior, using a two-monitor system, and setting the monitor resolution. Using a Stylus 1 In the Globals tab, open the guiControls subtree. 2 Set the virtualSliderSpeed parameter to 0.
Customizing the Flipbook The following arguments have been added to the Flipbook executable as global plugs, allowing you to specify an external Flipbook as the default. Specify these plugs using a .h file in the startup directory. The global plugs and their default values are: gui.externalFlipbookPath = "shkv"; // the flipbooks name -- this should include the full path gui.flipbookStdInArg = "-"; // instructs the flipbook to take data from StdIn gui.
• minFrames: Use this field to specify the minimum number of frames you want to be processed by each computer in the cluster. • timeout: The time, in seconds, a computer on a cluster can be idle before that part of the job is re-routed to another computer. • priority: A pop-up menu that allows you to choose the priority of the job. The options delay: A pop-up menu that allows you to delay when the render queue software starts the job you’re submitting.
Part II: Compositing With Shake II Part II contains detailed information on how to perform compositing tasks using all the tools and functions Shake provides.
15 Image Processing Basics 15 Shake gives you explicit control over every aspect of image processing. This chapter covers the basics of image processing, and how to control the flow of image data in your own Shake scripts. About This Chapter This chapter covers important information about topics that are fundamental to compositing within Shake.
This means that if, for example, you have a very small element that is 100 x 100 pixels, and you pan it 50 pixels in the X axis and 50 pixels in the Y axis, three-fourths of the image will extend outside of the 100 x 100-pixel frame. Although Shake does not calculate the “unseen area,” the portion of the image outside the boundary of the frame is preserved.
Nodes that modify image resolution also take advantage of the Shake Infinite Workspace. For example, if you apply a Crop node to a 20,000 x 20,000-pixel image, Shake calculates only the area of the image specified in the node. This is true even if you employ other nodes prior to the Crop. The Infinite Workspace allows Shake to limit the processing power needed by your script, because only the contents of the Crop window are calculated.
Note: You must be careful when pulling a bluescreen matte with the ChromaKey node. The outside black pixels are considered invisible because the node is keying a non-black color. To disable the effect of the Infinite Workspace, insert a Crop node and don’t modify its default values (which does not change the resolution). This cuts off the area outside of the frame, replacing it with black pixels. The Viewport node is similar to Crop, but it does not disable the Infinite Workspace.
Note: These examples of 1-bit, 2-bit, and 3-bit images are not supported by Shake, but are used for demonstration purposes. In Shake, you ordinarily work with 8-bit, 16-bit, or 32-bit float (floating point) images. 1 bit, 2 values total Graph of 1-bit image At 1-bit resolution, the graph shows the harsh difference between black and white. 2 bits, 4 values total Graph of 2-bit image At 2-bit resolution, the graph is still harsh, but there are more colors between.
At 3-bit resolution, you begin to see a gradient from black to white, although the graph is still choppy. 8 bits, 256 values total Graph of 8-bit image Finally, at 8 bits, you can see a smooth transition, and the graph line is almost straight. These graphs demonstrate that more bits used to represent an image results in finer color transitions.
Note: In 8-bit images there is no 50 percent point—you have a smidgen less than 50 percent gray and a smidgen more than 50 percent, but you cannot get an exact 50 percent value. This occasionally becomes an issue when creating and using macros. If this is the case, then why not always work at 16-bit resolution? Most film houses do, but it comes at the expense of slower calculations, more memory required, and largersized image files requiring significantly more hard disk space.
You might need to use a higher bit depth when employing certain nodes, such as Emboss and Blur, since they naturally create smooth gradations. In the following example, the image on the left has a Blur node and an Emboss node applied. At 8 bits, terracing appears. By inserting an Other—Bytes node at the beginning of the node tree set to 2 bytes (16 bits), the Emboss effect is smoothed.
You can seamlessly layer images of different bit depths together. This results in the lower bit-depth image being automatically promoted to the higher of the two bit depths. (For example, an Over node compositing an 8-bit image with a 16-bit image results in a 16-bit image.) This is an automatic operation, invisible to the user. To reverse this behavior, insert a Bytes node before the Over node on the 16-bit image to reduce the image to 8 bits. Bit-depth level is calculated locally in the node tree.
Parameters This node displays the following control in the Parameters tab: outBytes Forces the incoming image into a new bit depth. There are three buttons, corresponding to three values in the outBytes parameter field. • 1 = 1 byte per channel, or 8 bits per channel. • 2 = 2 bytes per channel, or 16 bits per channel. • 4 = 4 bytes per channel, or 32 bits per channel (float).
If you apply an operation that changes channel information, Shake automatically updates which channels are used. For example, if you place a Color–Monochrome or Filter–Emboss node on an RGB image, that image becomes a BW image at that point, speeding up the calculation of the subsequent nodes. If you then composite the image over an RGB image or change its color (for example, via a Mult node with values of 1.01, 1, 1), the BW image becomes an RGB image again.
m m To return to viewing the RGB channels, do one of the following: Position the pointer in the Viewer, then press C. Click the View Channel button, then choose the RGB channel option from the pop-up menu. m To display the R, G, or B channels individually, do one of the following: Press R to display the Red channel. m Press G to display the Green channel. m Press B to display the Blue channel. m Click the View Channel button, then choose a color channel from the pop-up menu.
Node Effect Operation Color–Set Adds or removes R, G, B, A, or Z. A value set to 0 removes the specified channel. A channel parameter set to something other than 0 adds that channel. Layer– SwitchMatte Adds A. Copies in any channel from the second input for use as the new alpha channel for the first input. Many operations allow you to select which channel is used as the modifying channel.
Important: Premultiplication plays a vital role in compositing, and Shake gives you explicit control over premultiplying and unpremultiplying your images. For more information, see “About Premultiplication and Compositing” on page 421. Tree with Over node Result m If the image is not premultiplied, it can be premultiplied in one of two ways: Add a Color–MMult node before the Over node in the process tree. m Use the preMultiply toggle in the Over node’s parameters.
Example 3; Assigning an Alpha Channel With the SwitchMatte Node In the following example, the mask is drawn using the QuickShape node and copied in as the alpha channel for the bus via the SwitchMatte node. Because no color corrections have been made, the MatteMult toggle is used in SwitchMatte to premultiply the foreground.
In the following example, MDiv and MMult nodes are added to color correct a 3Drendered element. Again, you can alternatively omit the MMult, and enable preMultiply in the Layer–Over node. Color correcting Result For an example of color correcting premultiplied elements, see Tutorial 3, “Depth Compositing” in the Shake 4 Tutorials. Combining Images in Other Ways Shake also has a set of mathematical and Boolean layering operators.
Using the ClipMode Parameter of Layer Nodes You can easily composite elements of any resolution. To set the output resolution of a composite that contains images of multiple resolutions, go to the compositing node’s parameters and use clipMode to toggle between the foreground or background (as the output resolution). This applies to all layering commands. An element composited over a differently sized background is one way to set your output resolution.
Shake takes a third approach, giving you explicit control over premultiplication for every image in your composition. Although this can be inconvenient, it helps you get around the problems that are typical in other software packages. In a Nutshell—the Rules of Premultiplication If you don’t read the full explanation of the mathematics of premultiplication, here are the two rules you must always follow when creating a composition in Shake: • Rule Number 1: Always color correct unpremultiplied images.
4 In the Node View, select the munch_pre node, click the Layer tab, then click the Over node. An Over node is added to the munch_pre node. 5 Connect the bg node to Background input (the second input) of the Over node. 6 Now, insert a Color–ContrastLum node between the munch_pre node and the Over node, and set the ContrastLum value to .5. If you zoom into the edges, a white edge appears around Munch. This unwanted fringe is problem number one.
If you ignore the premultiplication of your composites, you may have problems with edges, or with raised global levels. Many people see these types of errors, and assume it is a mask problem, so they pinch in the mask a bit. Even more extreme people have erroneously assumed you cannot color correct premultiplied images. These problems are easily solved through proper management of premultiplication.
The result is identical to munch_premult—the RGB is multiplied by the mask. Next, invert the foreground alpha channel (1-A). 3 To do this, select the munch_mask node, then Shift-click the Color–Invert node. The Invert node is attached to the munch_mask node as a separate branch. The next step in the formula ((1-A)*Bg) calls for you to multiply the background by the inverted alpha. 4 In the Node View, select the Invert node, then click Layer–IMult. An IMult node is added to the Invert node.
The result is exactly the same as the Over node. By punching a hole in the background, the alpha determines what is transparent when the two plates are added together. The key concept is that because you are adding, anything that is black (a value of 0) does not appear in the composite. IMult1 IMult2 The KeyMix and Over nodes do this math for you, saving you from having to create four nodes to do a simple composite.
To create the same error here, continue with the previous node tree and do the following: 1 In the Node View, select the IMult1 node, then click Color–Add. An Add node is inserted into the tree, between the IMult1 node and the IAdd1 node. 2 In the Add node parameters (click the right side of the node to load its parameters into the Parameters tab), set Color to .5. The same error occurs—the entire image brightens, not just Munch. This is not what we want to happen.
Now things get a little odd. To reassert the mask, you might be tempted to insert another IMult node after Add2, and connect the munch_mask node to the IMult3 background input. The image is premultiplied again and appears to work. Tree with IMult3 inserted IAdd2 Although this looks fine, mathematically speaking, there is an error.
If you zoom into the Viewer and look very closely, you’ll notice a dark rim appears around the edge. Add switched to ContrastLum IAdd1 detail 3 In the Node View, select the IMult3 node and press I. The node is ignored, and the same nasty edges appear as before. IAdd1 detail with IMult3 ignored 4 Press I again so the node is no longer ignored. So, what is the solution? Simple math will help resolve this issue.
2 Connect the munch_mask node to the IDiv1 background input. The edge appears clean. IDiv inserted IAdd1 detail 3 To test the result, select the IDiv1 node and press I several times to ignore and show the node. By dividing by the mask, the image is unpremultiplied and ready for color correction. Therefore, you can conclude that color correction should be applied to an unpremultiplied image.
Since munch_unpremult is already an unpremultiplied image, you get the same clean result. IDiv and IMult3 deleted, ContrastLum moved up IAdd1 detail Remember This Rule Number 1: Only color correct unpremultiplied images. Managing Premultiplication The above steps are an elaborate illustration to explain Over, KeyMix, and premultiplication. This explanation can be simplified a bit. The basic difference between the KeyMix and Over nodes is: • KeyMix is used for unpremultiplied foreground images.
This example uses the KeyMix node, which handles unpremultiplied foreground elements, the background, and a mask to split between the two. Enable invert in the KeyMix parameters (you could also switch the foreground and background inputs). Identical tree using KeyMix If you are using a premultiplied image that was rendered straight out of a 3D animation package, there are special tools that unpremultiply and premultiply the RGB channels by the alpha. These tools are Color–MDiv and Color–MMult.
The Over node has a premultiplication parameter built into it. In the following tree, the preMultiply flag in the Over parameters is turned on, which allows you to omit the MMult node entirely. Identical tree with premultiplication handled by Over1 Over1 parameters You are not required to apply an MDiv for each color correction. You only need to add a single MDiv to the beginning of the branch of your node tree where you need to perform color correction.
In the next example, an unpremultiplied image is accidentally filtered, to show you what artifacts to look for. Adding a filter to an unpremultiplied image—the wrong way: 1 In a preexisting node tree, add a Blur node to the munch_unpremult node, in an attempt to blur it against the background. The mask clips any soft gradation. 2 Copy and clone the Blur1 node. (Copy the node, then press Control-Shift-V.
Adding a filter to an unpremultiplied image—the right way: m To fundamentally change the compositing order, you should premultiply the foreground with the mask with a SwitchMatte node, then apply an Over node to create the composite. (KeyMix is only used for unpremultiplied images.) The following image shows the same tree with a single premultiplied image. The preMultiply parameter is disabled in the Over1 node (otherwise a black edge appears around the image).
Nodes That Affect Premultiplication The following nodes can change the premultiplication status of an image, although anything that operates an image’s mask differently from the RGB channels changes the effect. Node Description Color–ColorCorrect This color corrector has an option in its Misc tab to specify when the incoming image is premultiplied. If it is, set the premultiplied parameter to yes. MDiv and MMult are internally inserted into the computation.
The Logarithmic Cineon File Kodak created the Cineon file format to support their line of scanners and recorders. Two things are typically associated with the Cineon file: the Cineon file itself (an uncompressed 10-bit image file) and the file’s particular color representation. When graphed, this representation takes the form of a logarithmic curve, hence the term “logarithmic color” (or “log” for short). Although some refer to it as a “log space,” it is not actually a “space” such as YUV, RGB, or HSV.
The logarithmic image does not appear to have a pure black or white. Its graph shows that the highlights are flattened (compressed), and that the blacks have more attention. This is why Cineon frames typically seem to have a very low contrast, mostly in the highlights. Because the Y axis represents the output data, it contains less data than the X axis.
These types of controls are paralleled in the LogLin node with the black and white point parameters. Every 90 points represents one stop of exposure. You can therefore control exposure with the LogLin node. Note: Some Kodak documents state that 95 points represents one stop of exposure. Once images are converted to linear color, they can be treated like other “normal” linear images.
In the example below, the first image is the original plate in log color. The second image has been converted back to linear color, and therefore looks more natural to the eye. Plate in log color Plate in linear color A Color–Mult node is applied to the log image and to the linear version with an extremely slight red color. Note: You are invited to view the online PDF documentation to see the color images. It is difficult to gauge the result in the first image, since it is still in log color.
Therefore, you are mathematically urged to color correct in linear color, or view a conversion to linear using a VLUT while you adjust the color correction. Converting Between Logarithmic and Linear Color As previously mentioned, logarithmic images are simply a result of a color correction. This correction has been standardized by Kodak. Every conversion function is essentially the same. The Shake node that handles this correction is the LogLin node, and is located in the Color Tool tab.
If you are simply doing color timing, as in the following example, you have an added benefit: All the color corrections concatenate into one internal operation. Wedging and Color Timing So, why have numbers in the LogLin node? These numbers are used to color correct your plate as a sort of calibration of your entire input/output system. There are (at least) two fundamental ways to do this: wedging and color timing. The following two methods are only suggestions.
5 Render out 48 frames. The Wedge macro automatically brackets your initial pick up and down by whatever value you set as the colorStep. For a wide bracket, use a high number (such as 90). For a narrow bracket, use a lower number (such as 22). This process prints 48 different color, brightness, and contrast tests, then automatically returns the image to log color with the default settings. The internals of the Wedge macro are basically LogLin (log to lin) > ContrastRGB > LogLin (lin to log).
Logarithmic Color and Float Bit Depth Here is where it gets tricky. If you examine the following logarithmic-to-linear conversion curve, you can see that clipping occurs above 685. The LogLin node does have a roll-off operator, which helps alleviate the sharp corner at the 685 point, but this is inherently a compromise—you are throwing data away. You do not really see this data disposal in linear color. However, once you convert back to logarithmic, the color clipping is evident.
The following images are from a log plate. The left image is the original plate. The right image is the output plate, also in log color, that has been passed through the log-tolin-to-log conversion process. Original log image Output log image Notice that the highlights in the hair detail are lost. The following images are graphs that represent the log plates in the above illustrations. The left graph represents the entire range of the log image.
If you look back at the original log-to-lin conversion graph, the curve suggests that it should continue past 1, but so far, the curve has been clipped at 1. In the following illustration, the red line represents the potential information derived from the color conversion. The curve is clipped at 1 because values can only be stored from 0 to 1 in 8 or 16 bits. As the illustration suggests, if data could be preserved above 1, you could always access the data, and life would be happy.
The following image shows a modification of the compositing tree shown on page 441. An Other–Bytes node is inserted, and the image is bumped up to 4 bytes (32 bits, or float). Notice that you are not obligated to promote your 3D-rendered element (here represented with LinearCGPlate) to float, since it is already in linear color. The second Bytes node at the end of the node tree is included in case you render to an .iff format— you may want to convert it down to 16 bits for smaller storage costs.
In addition to storage requirements, working in float costs you render time, a minimum of 20 percent, but usually significantly higher than that. Looking at Float Values You can use the Float View ViewerScript to view values that are above 1 or below 0. To look at these values, create a Ramp node, and set depth to float. Then, apply a Color–LogLin node. When you turn on the Float View, the top 35 percent turns white, indicating values above 1, and the lower 9 percent turns black, indicating values below 0.
As an alternative to float, you can use the roll-off parameter in the LogLin node. However, this involves inherent compression and banding of your data. The roll-off parameter gives your curve a roll-off (compared to the standard log curves), which can help preserve some highlights, and allows you to stay in 16 bits. However, as shown in the next example, when the same image is converted back to log representation, there is still some cutoff in the upper and lower ranges, but the lower ranges also band.
The following is a sample tree: There are two exceptions: • Keylight allows you to key, color correct, and composite in log color. Simply toggle the colourSpace control to log. • Ultimatte preserves float data. No tricks necessary. Applying gentle pressure to the plug-in manufacturer to support float images is also a nice alternative, but less productive in the short run.
16 Compositing With Layer Nodes 16 Layer nodes form the foundation for compositing two or more images together in Shake. This chapter covers the basic Shake compositing nodes—how they work, and how to use them. Layering Node Essentials The Shake compositing nodes are located in the Layer Tool tab. There are three types of layering nodes: • Atomic nodes: Atomic nodes (Over, IAdd, Atop, and so on) do one thing—combine two images according to a fixed mathematical algorithm.
• Rule Number 1: Only color correct unpremultiplied images. To unpremultiply an image, use the Color–MDiv node. • Rule Number 2: Only apply Filter and Transform nodes to premultiplied images. To premultiply an image, use the Color–MMult node. For more detailed information on premultiplication, see “About Premultiplication and Compositing” on page 421. Using the clipMode Parameter of Layer Nodes You can easily composite elements of any resolution.
Layer Node Common Uses ISub Math LayerX Syntax A-B r-r2 ISubA Find the difference between elements. absolute(A-B) fabs(r-r2) KeyMix Mix two images through a third mask. A*(1-M*C)+ (B*M*C) M represents the percentage mix. Max Combine masks. If (A > B) then A, else B r>r2?r:r2 or max(r,r2) If (A < B) then A, else B r
AddMix Example In the following node tree, a key is pulled from the foreground using a KeyLight node. The foreground is then attached to the background tree. The first “Closeup” illustration (on the left) shows the default result, a result identical to an Over node. Ringing problems occur along the hair (a bright ring), and along the shoulder (a dark ring). When the curves are adjusted, the ringing is dramatically reduced, resulting in a much cleaner composite.
Default curves Modified curves Note: Because the curves can dramatically alter opacity of the foreground, you may need to ensure that the interior of the matte is 100-percent opaque through the use of additional masking, garbage mattes, and so on. Parameters This node displays the following controls in the Parameters tab: clipMode Toggles between the foreground (0) or the background (1) image to set the output resolution. preMultiplied Set this parameter to Yes if the foreground is premultiplied.
background curve A graphical control appearing within a curve editor in the Parameters tab. This curve controls the way the edge of the background image is blended. AddText The AddText node differs from the Text image node only in that it places text over a preexisting background. See “Text” on page 604 for more information on this extremely flexible feature.
xAlign The horizontal alignment of the text. The default is Centered (2). • 0 = left/top-justified • 1 = right/bottom-justified • 2 = centered yAlign The vertical alignment of the text. The default is Centered (2). • 0 = left/top-justified • 1 = right/bottom-justified • 2 = centered Color A color control defining the color of the text. The default is white (1,1,1). alpha The transparency of the text. The default is 1 (solid).
Parameters This node displays the following control in the Parameters tab: clipMode Toggles between the foreground (0) or the background (1) image to set the output resolution. Common The Common node compares two images and extracts or hides common elements. Use Common to create difference mattes. The extracted elements are taken if the difference between the two images is less than the set tolerances. A similar node is ISubA, which subtracts two images and returns the absolute value of these images.
Constraint Constraint is a multifunctional node that restricts the effect of nodes to limited areas, channels, tolerances, or fields. Toggle the type buttons to select the constraint type. When you do so, certain parameters then become active; others no longer have any effect. This is similar to the KeyMix node in that you mix two images according to a third constraint. KeyMix expects an image to be the constraint. Constraint allows you to set other types of constraints.
gTol Controls the green color channel tolerance if the type parameter is set to Threshold (2). If pixels between the two images are less than the tolerance value, they are considered common. bTol Controls the blue color channel tolerance if the type parameter is set to Threshold (2). If pixels between the two images are less than the tolerance value, they are considered common. aTol Controls the alpha channel tolerance if the type parameter is set to Threshold (2).
Parameters This node displays the following controls in the Parameters tab: clipMode Toggles between the foreground (0) or the background (1) image to set the output resolution. channels Tells Shake which channels to copy from BG to FG. You can use r, g, b, a, and/or z. To use multiple channels, list them out. For example, rgz copies the red, green, and Z channels.
clipMode Toggles between the foreground (0) or the background (1) image to set the output resolution. percent A built-in fade parameter. This is the amount of the second image that is taken into consideration. Full strength is 100. If set to 50, the added amount is reduced by 50 percent. ignoreZero Tells Shake to ignore black (zero) values. IMult The IMult node multiplies one input image by another input image. The second image’s strength can be raised and lowered with the percent parameter.
Interlace This node interlaces two images. You can control field dominance, whether the input images are themselves separate field images (for example, half Y resolution), or if the fields are extracted from every other line. For information on the Interlace node, see “Interlace” on page 205. ISub The ISub image math node subtracts one image from another. The strength of the second image can be raised and lowered with the percent parameter.
KeyMix The KeyMix node mixes two images together through the specified channel of a third image. You can control the mix percentage, and also invert the masking image. KeyMix and Over are the two primary compositing nodes—KeyMix for unpremultiplied images and Over for premultiplied images. For more information on premultiplication, see “About Premultiplication and Compositing” on page 421.
channel Lets you pick the channel from the third image that you want to use as the mask. You can pick the r, g, b, or a channel. mixPercent The percentage of the second image that’s mixed in. invert Inverts the mask created from the third image. LayerX The LayerX node is exactly like ColorX, except that you also have access to a second image. This allows you to composite with expressions. The values of the second image are accessed with the variables r2, g2, b2, a2, and z2.
clipMode Toggles between the foreground (0) or the background (1) image to set the output resolution. percent Adjusts the gain on the second image. Mix The Mix node mixes two images together according to a percentage. Animate the mixPercent parameter to create a dissolve between two clips. Parameters This node displays the following controls in the Parameters tab: clipMode Toggles between the foreground (0) or the background (1) image to set the output resolution.
Parameters This node displays the following controls in the Parameters tab: clipMode Toggles between the foreground (0) or the background (1) image to set the output resolution. preMultiply When this parameter is on (1), the foreground image is multiplied by its alpha mask. If it is off (0), the foreground image is assumed to already be premultiplied. addMattes When enabled (1), the mattes are added together for the composite.
matteMult Premultiplies the output image by multiplying the first input image by the alpha channel of the second input image. • 0 = not premultiplied • 1 = premultiplied invertMatte Inverts the result matte. • 0 = do not invert the matte • 1 = invert the matte Under The Under node is the same as the Over operation, except that it reverses the two input images.
ZCompose The ZCompose node composes the input image over the background image using the Z values of both images to determine which image’s pixel is placed on top. You should note that the ZCompose node uses an Over operation to compose the foreground and background input images after it has determined which should be in front, and which should be behind. Z values are depth measurements from the camera to each object. A premultiplied image is assumed since Z values are normally produced by a render.
Other Compositing Functions Shake contains other useful compositing nodes, located in the Other Tool tab. Note: The DepthKey and DepthSlice node modify the alpha channel of an image based on Z-depth values. For more information, see Chapter 24, “Keying,” on page 681. AddShadow The AddShadow node takes the alpha channel of an image, and then colors, blurs, fades, and moves the alpha channel. Next, the alpha is composited under the input, creating a basic shadow effect.
Shadow Color A color control that lets you define the color of the drop shadow. opacity Defines how transparent the drop shadow is. The slider’s range is from 0 to 1. Select The Select node, located in the Other Tool tab, allows you to select between multiple inputs. This node can be useful when you want to switch between different types of compositing logic over time, or when you have “doubles” that you want to insert.
17 Layered Photoshop Files and the MultiLayer Node 17 Shake supports the use of layered Photoshop files with the MultiLayer node. This node also provides an easy way to composite three or more images within a single node, simplifying your node tree. About the MultiLayer Node The MultiLayer node duplicates the functionality of many of the atomic nodes covered in the previous chapter (with the exception of the AddMix, AddText, Interlace, and KeyMix nodes).
2 Double-click the Composite node to display the Photoshop image (the composite) in the Viewer and load the MultiLayer node parameters. Click and hold to select a different compositing operation. Unsupported Photoshop Features and Issues When you import a Photoshop file that contains one or more layers that are set to an unsupported transfer mode, the “Unsupported Transfer Mode (Mode Name)” message appears in the Viewer, and the mode for that layer in the Parameters tab reads “Unsupported.
The postMMult Parameter In the MultiLayer parameters, postMMult is enabled by default. When turned on, the postMMult parameter premultiplies the output image produced by the MultiLayer node (in the same manner as a composite in the Photoshop application). Premultiplication is enabled by default. For more information on the other buttons in the MultiLayer parameters, see “Using the MultiLayer Node” on page 478.
Photoshop Layer Opacity To change the opacity of a layer, expand the subtree for the layer and set the opacity parameter to a value between 0 and 1. By default, the layer opacity is set to 1. A layer that is set to a Photoshop transfer mode contains an additional opacity control—the PSOpacity parameter. Shake layer opacity Photoshop mode opacity This additional opacity control is necessary because Photoshop and Shake handle transparency differently.
Layer Function Description Exclusion The second image acts as a mask for inverting the first image. White areas of the second image completely invert the first image; black areas of the second image leave the first image unmodified. HardLight Screens or multiplies the first image, depending on the strength of the second image. Values below 50 percent in the second image multiply the first image, making it darker. Values above 50 percent in the second image act as a Screen effect.
To select an individual layer: 1 Load the Photoshop file’s FileIn parameters (click the right side of the node). 2 In the Source subtree, disable readMerged. 3 In the whichLayer parameter, select the layer you want to display. In the following example, the third layer of the Photoshop file is selected. When Shake imports a multilayer Photoshop file, the first layer in the file is numbered 0 in the whichLayer parameter.
Connecting Inputs to a MultiLayer Node The MultiLayer node accepts a variable number of inputs. Drag input noodles onto the + (plus) sign on the top of the MultiLayer node that appears when the pointer passes over it. The + sign always appears to the right of all other previously connected knots. You can also attach several nodes to a single MultiLayer node simultaneously. To connect several nodes to a multi-input node at once: 1 Select all of the nodes you want to attach to the multi-input node.
2 Shift-click the + sign input of the multi-input node. All selected nodes are connected. The Order in Which You Connect Nodes Unlike the other layer nodes, the order in which you connect input images determines the initial layer order of the resulting composite. The first input represents the background layer, the second node is the next deepest, and so on, until you reach the input furthest to the right, representing the foreground.
m To change layer order: Drag that layer’s Reposition control up or down between other layers until a horizontal line appears, which indicates the new position of that layer. The compositing order is rearranged, and the nodes are rewired in the Node View. In the following illustration, Layer_1 is the background, and Layer_2 is the most prominent foreground layer. Each layer has associated parameters and controls. In the following illustration, several controls are visible on each line.
Control Description Input Layer Name Field Displays the name of the input image node. By blanking it out, the node is disconnected, but the layer information remains. Composite Mode This pop-up menu lets you set each layer with its own composite mode, which affects how that image’s color data interacts with other overlapping layers. Certain composite modes add parameters to that layer’s parameter subtree. For more information on composite modes, see “Supported Photoshop Transfer Modes” on page 476.
Layer Parameters Subtree Each layer in the layers list has additional parameters within a subtree that provide additional control. layerName The name of the layer. All associated parameters for that layer are prefixed by the layerName. opacity Opacity of the input layer. With an imported Photoshop file, there is an additional PSOpacity parameter. See “Supported Photoshop Transfer Modes” on page 476 for more information. preMult Indicates whether the layer is to be premultiplied.
18 Compositing With the MultiPlane Node 18 The MultiPlane node provides a simple 3D compositing environment within Shake. This environment can be used as a way to arrange and animate images within a 3D space, or as a way to integrate generated or tracked 3D camera paths into your scripts. An Overview of the MultiPlane Node The MultiPlane node provides a compositing environment for positioning 2D layers within a 3D space.
Viewing MultiPlane Composites When you double-click a MultiPlane node to open it into the Viewer, the Viewer switches to a multi-pane interface, unique to the MultiPlane node. Each pane of this interface can be toggled among single, double, triple, and quadruplepane layouts. Each individual pane can be set to display any available camera or angle in the 3D workspace, to help you position and transform objects from any angle.
Render Mode Button Description This mode sets the Viewer to use Hardware rendering while you’re making adjustments using onscreen controls. Once you’ve finished, the Viewer goes into Software rendering mode to show the image Hardware Mode While Adjusting at the final quality. To turn this setting on, click and hold the Render Mode button, then choose this option from the pop-up menu that appears. This mode displays the selected renderCamera as it appears at its actual quality.
m To work within a MultiPlane node using the multi-pane interface: Double-click a MultiPlane node to load its image into the Viewer and its parameters into the Parameters tab. Now, the Viewer switches to the MultiPlane’s multi-pane Viewer interface. Once the multi-pane interface is displayed, you can toggle among four different layouts. m To change the MultiPlane Viewer layout: Click the Viewer Layout button in the Viewer shelf. Keep clicking to cycle among all the available layouts.
Changing Angles Within a Pane Although the multi-pane layouts are fixed, you can change the angle displayed by each pane at any time. The assigned angles appear in white at the lower-left corner of each pane. m m To change the angle displayed by a single pane, do one of the following: Right-click within a pane, then choose a new angle from the shortcut menu. Position the pointer within the pane you want to switch, and press one of the numeric keypad keyboard shortcuts (0-5) to switch layouts.
Using and Navigating Within the Perspective Angle In addition, there is a single non-isometric angle, Perspective (Persp). This is the only pane where you can transform a layer’s X, Y, and Z parameters all at once. In addition to panning and zooming to navigate within this angle, you can also orbit the Perspective angle. m To orbit the Perspective view: Move the pointer within a pane displaying the Perspective angle, press X, and drag with the middle mouse button held down.
Whichever angle is assigned as the renderCamera has the following additional properties: • It’s the only angle that can be switched between viewing the software-rendered final output, and the hardware-rendered preview. • It’s the only angle with a compare control (in software-rendering mode only). • The image border ROI (Region of Interest) appears only for the renderCamera angle. • There are additional keyboard shortcuts available for transforming a camera.
Button Description Path Display Shows/hides animation paths for image plates. Rendering Mode Toggles the Camera View pane of the Viewer between hardware (HW) and software (SW) rendering. Hardware rendering is faster, but the color and quality of the image is less accurate; this mode makes it easier to position objects. Software rendering is slower, but allows you to accurately see the final image as it will be rendered.
Connecting Inputs to a MultiPlane Node Like the MultiLayer node, the MultiPlane node accepts a variable number of inputs. Drag input noodles from other nodes onto the + sign on the top of the MultiPlane node that appears when the pointer passes over it. The + sign always appears to the right of all other previously connected knots. Before After You can also attach several nodes to a single MultiPlane node simultaneously.
Using Camera and Tracking Data From .ma Files The MultiPlane node supports .ma (Maya ASCII) files, allowing you to import 3D camera paths from a variety of 3D animation packages, or use 3D tracking data clouds generated by third-party tracking applications. Every new MultiPlane node is created with one camera, named camera1. Importing a .ma file adds a camera to the renderCamera pop-up menu in the Camera tab of the MultiPlane node’s parameters.
The data from the .ma file appears in the Viewer as a cloud of points. The camera or tracking data populates the parameters of the Camera tab, and a new camera appears at the bottom of the renderCamera pop-up menu. Important: Many 3D applications export camera paths with timing that begins at frame 0. Shake scripts begin at frame 1, which can result in a one-frame offset. To correct this, edit the timing of each camera path point as described in “Editing Locator Point Data” on page 499.
Unattached layers that are positioned within the 3D workspace should now appear as if they’re moving along with the features within the attached layer. For more information about attaching a layer to the camera, see “Attaching Layers to the Camera and to Locator Points” on page 506. Importing Data Clouds From Maya In Shake, the aspectRatio parameter of a layer within the MultiPlane node is determined by the width and height values of the filmBack parameter in the Camera tab.
Thus, you can set up animated MultiPlane composites using multiple MultiPlane nodes, instead of connecting all your images to a single MultiPlane node. For example, you might set up a composite using three different MultiPlane nodes—one for background layers, one for midrange layers, and one for foreground layers. This way you can apply separate color correction and Defocus nodes to the output of each sub-composite.
The “Link camera” window appears. The “Link to” pop-up menu presents a list of every camera and angle within every MultiPlane node in your script. 4 Choose the camera you want to link to from the “Link to” pop-up menu, then click OK. The camera in the current MultiPlane node is now linked to the camera you chose. Every parameter in the Camera tab is linked, with expressions, to the matching camera parameter of the MultiPlane node you chose.
m To change the size of the locator points displayed in the Viewer: Adjust the multiPlaneLocatorScale parameter, located at the bottom of the guiControls subtree of the Globals tab. Default MultiPlaneLocatorScale of 1 MultiPlaneLocatorScale set to 3 If the data cloud has individually labeled locator points, these labels are viewable within Shake.
A new subtree named pointCloud appears at the top of the Images tab of the MultiPlane node’s parameters. Opening the subtree reveals a list of every point that’s been added using the Expose command. Opening an individual locator point’s subtree in this list reveals its xPos, yPos, and zPos parameters. These parameters can be loaded into the Curve Editor to edit, animate, or slip their values in time.
If you have many layers stacked up within a single MultiPlane node, you may want to turn one or more layers invisible to make it easier to manipulate the remaining layers. Invisible layers aren’t output when the script is rendered. For more information, see “Showing and Hiding Layers” on page 506. Layer Controls When you select a layer, that layer’s onscreen controls appear superimposed over it.
Pan and Center Controls Selected layers in the Viewer have two sets of onscreen controls for panning in 3D space—global axis and local axis pan controls. Local axis pan control Global axis pan control Global axis controls pan a layer relative to the overall 3D space, even if the layer has been rotated. Panning a layer up with a global axis control pans it straight up in space.
The local axis pan controls pan the layer relative to its own orientation. If a layer has been rotated using the angle controls, using the local pan controls moves it along the axis of its own rotation. Panning a layer up with a local axis control pans it diagonally in space. Before local axis pan m After local axis pan To pan along the Local Axis: Drag one of the two local axis pan controls to move the layer in that direction.
To rotate a layer in the Viewer without using the angle controls: 1 Select a layer. 2 Press W or O and click in a pane of the Viewer. 3 When the dimension pointer appears, move the pointer in the direction in which you want to rotate the layer. The colors in the pointer correspond to the angle controls. 4 When you move the pointer, the axis in which you first move is indicated by a single axis arrow, and the layer rotates in that dimension.
3 Drag the dimension pointer in the direction in which you want to scale the layer. The colored arrows correspond to the pan controls. 4 When you move the pointer, the direction in which you first move is indicated by a single axis arrow, and the layer scales up and down in that dimension. Creating Layer Hierarchies You can create hierarchical relationships between layers within a MultiPlane node using the parentTo parameter.
Deleting Parent Layers When you disconnect a layer that’s being used as a parent, a warning appears: Clicking Yes removes the parent layer, eliminating the parent-child hierarchy. The remaining layers’ parentTo parameters still show the original layer, in the event you decide to reconnect it later on. Showing and Hiding Layers You can toggle the visibility of layers.
Attaching Layers to the Camera To use a MultiPlane node to matchmove one or more images into a scene using 3D tracking data, you need to do three things: • Import data from a .ma file. • Position the images you want to matchmove. • Attach the originally tracked image sequence to the camera. Attaching the layer that produced the tracking data to the camera forces the attached layer to follow along with the camera as it moves according to the tracking data.
Decreasing the cameraDistance value brings the layer closer to the front of the composition, while increasing the cameraDistance pushes the layer farther away. Attached layers move back and forth along the lines that are projected from the camera itself to the four corners of the frustum surrounding the camera target.
3 Turn on Attach Layer to Camera for the background and isolated building layers to lock both images to the full area of the renderCamera angle in the Viewer. 4 Open the subtree for each attached layer, and adjust the cameraDistance parameters to create the necessary spacing between each element for your composition. In this case, the front building is moved forward so there’s room between the building and the rest of the background plate for the hot-air balloon.
As a result, the balloon appears positioned between the front building and the rest of the city in the camera view. A balloon image inserted between. the front building and cityscape The resulting camera angle Because both the building and city layers are attached to the camera, they look identical to the original input image from which they’re derived, regardless of each layer’s position within the 3D workspace.
To attach a layer to three locator points: 1 If necessary, move the layer’s center point to a position at which you want the layer to be attached to the locator point. 2 Shift-click three locator points in the Viewer. 3 Right-click one of the selected locator points, then choose a layer from the Attach Plane to Point shortcut menu. The layer is panned so that its center point is at the center of the triangle defined by the three selected locator points.
• Raising sceneScale expands the distribution of points, moving any layers that are locked to locator points away from the camera. The locator points themselves appear to stretch out. Changing the sceneScale parameter has no effect on layers that are attached to the camera, nor does it affect the position of layers that are not attached to locator points. It does, however, affect the size of the frustum, increasing or decreasing the area that is seen by the camera.
Individual Layer Controls Each image that you connect to a MultiPlane node is represented by its own set of layer controls and subtree parameters in the Images tab. These controls are similar to those found within the MultiLayer node, and are labeled in the order in which the layers were connected to the MultiPlane node. For example, L1 is the name of the first connected layer, followed by L2, and so on.
Individual Layer Parameters Opening up a layer’s parameter subtree reveals a group of compositing and transform parameters affecting that particular layer. layerName The name of the layer. All associated parameters for that layer are prefixed by the layerName. opacity Opacity of the input layer. With an imported Photoshop file, there is an additional PSOpacity parameter. See “Supported Photoshop Transfer Modes” on page 476 for more information.
faceCamera The faceCamera pop-up menu lets you choose a camera. Once set, the layer will always rotate to face the same direction as the selected camera. If the camera is animated, the layer animates to match the camera’s movement so that the object remains facing the camera at every frame. This automatically animates that layer’s angle parameters, even though no keyframes are applied. In the following example, the camera starts off facing a 2D balloon layer.
One useful application of this parameter is to offset a layer’s center point, then use layer rotation to control layer position, even though faceCamera is turned on. In the following example, an image of a planet is arranged to the right of an image of the sun. The planet layer’s center point is offset to the left to match the center of the sun layer.
parentTo This parameter lets you create layer hierarchies within a single MultiPlane node. You can link one layer to another by choosing a parent layer from this pop-up menu. Layers with a parent can still be transformed individually, but transformations that are applied to the parent are also applied to all layers linked to it. For more information on using the parentTo parameter, see “Creating Layer Hierarchies” on page 505.
3D Transform Controls Click the camera to expose its 3D transform controls. Camera target Camera The camera consists of two groups of controls, the camera itself, and the camera target. Both controls are connected so that they always face one another—moving one rotates the other to match its position. Camera Controls Similar to layer controls, the camera has rotate x, y, and z controls, and translate (move) x, y, and z controls to constrain movement of the camera to one of these directions.
Moving the camera in relation to the camera target An additional control at the front of the camera constrains its movement so that it moves either closer to or farther away from the camera target—which also adjusts the interestDistance parameter in the Camera tab of the MultiPlane parameters. Before moving interestDistance control After moving interestDistance control No matter where you move the camera in space, it rotates to face the position of the camera target.
m Keyboard Explanation D-drag Pans the camera and camera target together along the X and Y axes. X-drag Pivots the camera about the camera target’s orbit point. To move the camera and the camera target together in any view: Press T and drag the camera or camera target controls in the Viewer. Before T-dragging camera After T-dragging camera Camera Target Controls and Frustum The camera target represents the image that is displayed by the camera1 view.
The outer bounding box represents the frustum, which defines the camera view frame that produces the output image. The size of the frustum determines, in part, the area of the 3D workspace that is output as the renderCamera image that’s output by the MultiPlane node. Note: Unlike frustum controls found in other 3D animation packages, Shake’s MultiPlane frustum does not crop the image outside of the frustum boundary.
Parameters in the Camera Tab All of the parameters that affect the camera are located within the Camera tab of the parameters. renderCamera A pop-up menu that lets you choose which angle provides the output image from the MultiPlane node. Lock, Unlock, Reset Click the Lock button to lock all of the camera parameters at once, preventing them from being accidentally edited. Click the Unlock button to unlock these parameters again. Click the Reset button to restore the camera to its default position.
angleOfView A subparameter of focalLength. This value is provided for convenience, and represents the horizontal field of view of the frustum (as opposed to the vertical field of view that the Move3D node uses), based on the current focalLength. The value of the angleOfView has an inverse relationship to that of the focalLength parameter—raising one lowers the other, and vice versa. translate (x, y, z) Transform data for the camera’s position.
fitResolution A pop-up menu with four options: Fill, Horizontal, Vertical, and Overscan. This parameter determines how differences between the filmBack aspect ratio and that of the input image are resolved. filmFitOffset If the filmBack resolution is different from that of the clipLayer, this parameter offsets the image within the filmBack resolution in inches. filmOffset (x, y) Offsets the image within the filmBack in relation to the area defined by the clipLayer. This parameter is measured in inches.
Copy/Delete These buttons let you duplicate or delete the currently selected renderCamera. Link The link button at the right lets you link the camera in the currently open MultiPlane node to an animated camera within another. Delete Cloud Deletes a point cloud, but leaves the camera angle intact. This is useful if you plan on redoing the track and you want to clear the old point cloud in preparation for importing a new one.
19 Using Masks 19 This chapter describes how you can use masks in Shake to create transparency and to limit the effects of other functions within your node tree. About Masks Masking is the process of using one image to limit another. This typically takes the form of assigning one image to be used as an alpha channel by another. Masking in Shake can also take the form of using one image to limit the effect of a particular node in the node tree. Masking is closely related to keying.
Using Side Input Masks to Limit Effects You can attach a mask to the side input of a node, thereby limiting that node’s effect on the input image. In the following screenshots, a mask image (actually an RGrad image node modified by a Move2D node) is used to limit the effect of a Brightness node that’s connected to the source image of the car.
m To attach an image in the node tree to a side input mask: Drag a noodle from an image’s output knot, and attach it to a node’s side input mask. Drag noodle to side input.. Connected side input mask To create a side input mask: 1 Load the parameters of the node you want to mask into the Parameters tab. 2 Do one of the following: • Click Create to create a new instance of the type of node listed in the pop-up menu to the right. • Choose a different type of node from the Create pop-up menu to the right.
Parameters Within the Mask Subtree The Mask subtree, located in the top section of any node’s Parameters tab, contains the following parameters that let you customize how the input mask image is used: maskChannel Lets you choose which channel to use as the mask. This parameter defaults to A (alpha). invertMask Lets you invert the mask, reversing its effect on the image. clampMask Turning this parameter on clamps mask image data to a value between 0 and 1.
5 To create a mask that gives the appearance of a “spotlight,” do one of the following: • Create an RGrad node (in its own branch), and connect the RGrad output to the M (mask) input on the side of the Brightness node. • In the Brightness parameters, choose RGrad from the Mask pop-up menu. Note: To create the node type already in the Mask shape menu, click Create. For information on the rotoscoping or paint tools and their onscreen controls to draw and edit masks, see Chapter 21, “Paint,” on page 579.
For more information on transforming with onscreen controls, see Chapter 26, “Transformations, Motion Blur, and AutoAlign,” on page 763. 8 To invert the mask, open the Mask subtree in the Brightness node, and enable invertMask. The mask is inverted, and the masked portion of the image is lightened. Don’t Use Mask Inputs With Layer Nodes Mask inputs are useful for color corrections and transforms. However, masks should not be used for layer nodes.
Masking Concatenating Nodes It is never a good idea to use side input masking with multiple successive concatenating nodes because doing so breaks the concatenation. The following example demonstrates the wrong way to use masks. Breaking node concatenation with side input masks—don’t try this at home: 1 Select the Brightness node and apply a Color–Mult node. 2 In the Color controls of the Mult node parameters, set the Color to blue. A blue tint is created to color correct the dark areas of the background.
A better way to mask a series of concatenating nodes: 1 Disconnect the masks from the previous example. 2 Select the Mult node and add a Layer–KeyMix node. 3 Connect the car_bg node output to the KeyMix node’s Foreground input (the second input). 4 Connect the CornerPin node to the KeyMix node’s Key input (the third input). This eliminates the above problems. The following images compare the two resulting renders.
5 Connect the KeyMix2 node to the Key input of the KeyMix1 node. 6 Click the right side of the KeyMix1 node to show the resulting image in the Viewer. 7 Click the left side of the Pan node to show the onscreen controls in the Viewer, and load the parameters. 8 Using the following illustration as a guide, pan the RGrad up slightly to the left.
Note: If you had simply connected the car_mask image to the M input of the Pan node, rather than using the KeyMix method, you would have masked normally concatenating nodes and broken the concatenation between the CornerPin and Pan functions. Using Images Without an Alpha Channel A masked image does not need an alpha channel. Connecting an image without an alpha channel as the mask doesn’t immediately have an effect, however, since by default mask inputs are expecting an alpha channel.
3 Connect the sign_mask2 node to the Background input (the second input) of the Outside node. The light mask is “outside” of the sign mask. Outside1 m KeyMix1 The following example demonstrates the wrong way to combine the sign and car masks. Using the following image as a guide, combine the sign_mask and the car_mask with an Over (or Max) node.
A slight problem occurs when you try this using the Over node. A matte line appears between the two masks. Fortunately, in Shake, there’s always a different method you can try. This problem is easily solved by substituting a different node for the Over. A better way to combine the sign and car masks: 1 Select the Over node, and Control-click IAdd. The Over node is replaced with the IAdd node, and the line disappears. Next, you can put the woman outside of the new mask IAdd1 using the Outside node.
7 Connect the SwitchMatte node to the Background input of the Atop node. If the image looks wrong, make sure that matteMult is disabled, and invertMatte is enabled in the SwitchMatte node parameters. Masking Filters Filters have special masked versions of the node that not only mask an effect, but also change the amount of filtering based on the intensity of the second image. These take the same name as the normal filter node preceded by an I, for example, Blur and IBlur.
6 In the Blur parameters, set the xPixels and yPixels value to 200. The result looks bad, rather like the following. Notice that the right side of the image merely mixes the completely blurred image with the non-blurred image. 7 Select the Blur node, and Control-click Filter–IBlur. The Blur node is replaced with the IBlur node. 8 Disconnect the Ramp from the blur node’s M input, and connect it to the IBlur node’s second image input. 9 In the IBlur parameters, set the xPixels and yPixels value to 200.
Parameters Type Defaults Description percent float 100 A gain control applied to the maskChannel. • 100 percent is full brightness. • 50 percent is half brightness. • 200 percent is twice as bright, and so on. invertKey int 0 A switch to invert the maskChannel. • 0 = do not invert • 1 = invert enableKey int 1 A switch to turn the key on and off.
Masking Using the Constraint Node The Layer–Constraint node also helps to limit a process. The Constraint node mixes two images according to a combination of modes. The modes are Area of Interest (AOI), tolerance, channel, or field. In the following example, the AOI is enabled and the area box is set. Only the area inside of the box of the second image is calculated. Constraint Constraint is a multifunctional node that restricts the effect of nodes to limited areas, channels, tolerances, or fields.
Because of the labeling, you can do multiple types of constraining in the script by adding the numbers together. For example, 7 = AOI (1) + Threshold (2) + Channel (4); in other words, AOI, Threshold, and Channel are all active. AOI Controls These are active only if the type parameter is set to 1. (See “type,” above.) They describe a cropping box for the effect. Opening this parameter reveals left, right, bottom, and top subparameters. rTol If the type parameter is set to 2, the red color channel tolerance.
invert Inverts the selection. For example, everything beyond a color tolerance is included, rather than below, and so on.
20 Rotoscoping 20 Shake provides rotoscoping capabilities with the RotoShape node. When combined with Shake’s other image processing, layering, and tracking functions, you have a powerful rotoscoping environment. Options to Customize Shape Drawing Before you start working with Shake’s RotoShape node, you should be aware that there are several parameters in the guiControls section of the Globals tab that allow you to customize shape-drawing behaviors and shape-transform controls in the Viewer.
Note: You can also resize every transform control appearing in the Viewer by holding the Command key down while dragging the handles of any transform control in the Viewer. rotoTransformIncrement This parameter allows you to 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.
Why Use the RotoShape Node Instead of the QuickShape Node? The RotoShape node is a newer, faster, more flexible, and more able rotoscoping tool that replaces the QuickShape node. The RotoShape node has the following advantages over the QuickShape node: • You can create multiple shapes within the same node. • You can have a soft-edge falloff on each shape that can be modified independently on each control point. • You can make one shape cut a hole into another. • It is much faster to enter keyframes.
Drawing New Shapes With the RotoShape Node 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, then assign its type in a subsequent step. Unassigned shapes appear yellow, by default. To create a new shape: 1 Add an Image–RotoShape node to the Node View. 2 Click the Parameter control of the RotoShape node to load its parameters into the Parameters tab, and its controls into the Viewer shelf.
Note: If you traced the image from another node, you’ll need to load the RotoShape node into the Viewer to see the fill. Important: You can only create filled shapes in the RotoShape node. To create singlepoint and open shapes, use the Warper or Morpher node. A single RotoShape node can contain more than one shape. To create multiple shapes in a single node: 1 To create another shape, click the Add Shapes button again. 2 Use the techniques described previously to create the additional shape.
To duplicate a shape: 1 Click the Edit Shapes button to allow you to select shapes in the Viewer. 2 Move the pointer over the transform controls of the shape you want to duplicate, then right-click and choose Copy Shape from the shortcut menu. 3 Right-click in the Viewer, then choose Paste Shapes from the shortcut menu. Editing Shapes Once you’ve created a shape, there are several ways you can modify it by turning on the Edit Shapes button.
4 When the selected points are highlighted, 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. Note: Using the transform control without the Shift key pressed modifies the entire shape, regardless of how many points are selected.
3 Do one of the following: • To change the length of one of the tangent handles independently from the other, while keeping the angle of both handles locked relative to each other, drag a handle to lengthen or shorten it. You can also rotate both handles around the axis of the selected point. • 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.
To edit a shape using its transform control: 1 Make sure the Enable/Disable Shape Transform Control button is turned on. Each shape’s transform control affects only that shape. For example, if a RotoShape node has three shapes in the Viewer, each of the three transform controls will only affect the shape its associated with. This is true even if you select control points on multiple shapes at once.
Drag the Rotate handle (to the right of the transform control) to rotate the shape about the axis of the transform control. Rotate handle To edit selected control points using a shape’s transform control: 1 Select one or more control points. 2 Hold down the Shift key while you manipulate one or more selected points with the transform control to modify only the selected points.
A transform control that affects the entire node appears across the entire frame. Each shape’s individual transform control remains visible. Shape Bounding Boxes Right-click a point, then choose Bounding Box Toggle from the shortcut menu to display a box around that shape that can be transformed to move and scale the shape. This works in addition to the shape’s transform control, which appears at the center of the shape.
Reordering Shapes You can reorder multiple overlapping shapes to change the effect they have on the alpha channel. For example, placing a black shape over a white shape lets you create a transparent area, while placing a white shape over a black shape creates a solid region. To change the order of multiple shapes in the same RotoShape node: 1 Right-click a shape’s transform control, or any of its main control points.
Shapes can be copied and pasted between all of these nodes, so that a shape drawn in one can be used in any other. Animated shapes are copied along with all of their keyframes. Note: You cannot copy shapes from RotoShape nodes that were created in Shake 3.5 or earlier. m To copy a single shape: Right-click the transform control, outline, or any point of the shape you want to copy, then do one of the following: • Choose Copy Shape from the shortcut menu. • Press Control-C.
5 If necessary, move the playhead to another frame and continue making adjustments until you’re finished. 6 When you’re done, turn off auto-keyframing. Rules for Keyframing How keyframes are created and modified depends on two things: the current state of the Autokey button, and whether or not there’s already a keyframe in the Time Bar at the current position of the playhead.
m To set keyframes for all shapes: Toggle to Key All Shapes. When this control is turned on, making a change to any single shape results in the state of all shapes within that RotoShape node being saved in the newly created keyframe. Seeing the Correspondences Between Shapes and Keyframes When you position the playhead in the Time Bar over a keyframe, all shapes that were animated within that keyframe appear with blue control points.
To paste a keyframe: 1 Move the playhead in the Time Bar to the frame where you want to paste the copied keyframe. 2 Right-click the transform control of the desired shape, then choose Paste Keyframe of Shape from the shortcut menu. Adding Blank and Duplicate Keyframes to Pause Animation If you want a shape to be still for a period of time before it begins to animate, insert a pair of identical keyframes at the start and end frame of the pause you want to create.
outPoint Moves the out point of the rotoshape, allowing you to change where that rotoshape ends. This parameter corresponds to the out point of the rotoshape in the Time View. Retiming RotoShape Animation The retimeShapes button, within the timing subtree of the RotoShape Parameters tab, lets you retime all of the keyframes that are applied to that rotoshape.
invert Turning on the Invert button expands the keyframes by the Amount value, instead of contracting them. This has an identical effect to setting Amount to a decimal value between 0 and 1. Remap Adjustments Setting Operation to Remap provides a way for you to use curve expressions to retime the current keyframe distribution. This lets you apply a retiming curve from a FileIn node to the keyframes of a shape that you’ve already animated to rotoscope that image.
m To attach a track to an entire shape: In the Viewer, right-click the lower-center portion of the shape’s transform controls and select an available track from the “Attach tracker to shape” list. Right-click the lower center section of the transform controls. Note: You may have to click more than once for the correct menu to appear.
To remove a tracker from one or more control points: 1 Select one or more shape control points in the Viewer. 2 Right-click one of the selected points, then choose “Remove tracker reference on selected points” from the shortcut menu. Adjusting Shape Feathering Using the Point Modes Each shape you create with a RotoShape node actually consists of two overlapping sets of points.
3 Drag the selected points out, away from the shape’s edge. The farther you drag the edge, the softer it becomes. To reset a soft edge segment to the default hard edge: 1 Click the Edge Points or Any Points controls. 2 Right-click the edge point you want to reset, then choose Reset Softedge from the shortcut menu. To adjust both main and edge points at the same time: 1 Click the Group Points button. 2 Select one or more main shape points around the edge of the shape.
Important: Be careful with the soft edges—if you create a shape with overlapping lines, rendering artifacts may appear. To clean up minor artifacts, apply a slight blur using the Blur node. Linking Shapes Together When you right-click the transform control, you can set up a skeleton relationship between your shapes. Right-click and choose Add Child from the shortcut menu, then click the transform control of the shape you want as a child of the current shape.
Importing and Exporting Shape Data Two controls let you import and export shape data between Shake and external applications. These controls are located in the Viewer shelf when editing RotoShape, Warper, or Morpher nodes. m To export shape data: Click the Import Shape Data button in the Viewer shelf, choose a name and destination for the export file in the File Browser, then click OK.
Menu Option Description Re-Center Re-centers the transform tool to be the center of the shape. Control-drag to modify it without moving the shape. Add Child Click the transform tool of a second shape to make it a child of the current shape. Remove Parent Removes the current shape from the skeleton hierarchy. Delete Shape Deletes the current shape. Copy Shape Copies the current shape. Copy Visible Shapes Copies all visible shapes. Paste Shapes Pastes copied shapes.
Button Description Fill/No Fill Controls whether or not the shape is filled. Show/Hide Tangents Controls the tangent visibility. In Pick mode, only the active point displays a tangent. None hides all tangents, and All displays all tangents. Lock/Unlock Tangents When Lock Tangents is on, the tangent angles are locked when control points are moved, rotated, or scaled. When Unlock Tangents is on, the tangent angles are unlocked. Spline/Linear Mode New points are created as splines or as linear points.
RotoShape Node Parameters The RotoShape node has the following controls: timing Three parameters within the timing subtree of the RotoShape parameters allow you to modify when a rotoshape starts and ends. An additional retimeShapes control lets you retime all keyframes that have been applied to that RotoShape node. timeShift Offsets the entire rotoshape, along with any keyframes that have been applied to it. This parameter corresponds to the position of that rotoshape in the Time View.
For more information on using the retimeShapes command, see “Retiming RotoShape Animation” on page 561. Res The Width and Height of the RotoShape node’s DOD. bytes The bit depth of the image created by the RotoShape node. You can specify 8-bit, 16bit, or float. pan A global pan applied to the entire image. angle A global rotation applied to the entire shape—points are properly interpolated according to the rotation. aspectRatio This parameter inherits the current value of the defaultAspect global parameter.
Using the QuickShape Node The QuickShape node is an image generator to be used for animated garbage mattes. It is ideal for plugging into the Mask input of a node, or is used in conjunction with nodes such as Inside, Outside, or KeyMix. Note: The QuickShape node is an older node to create rotoshapes. The more flexible (and faster) RotoShape node is recommended. This node is maintained for compatibility purposes.
Modifying QuickShapes To select multiple points in Edit mode, drag to select the desired points. The selected points can then be modified as a group. Button Usage Example The Spline/Line Mode buttons change the selected points from Linear to Smooth. Select the points and toggle the button to the setting you want. In this example, the two right points have been made Linear. When Linear is selected, no tangents are available. Click the Fill button on the Viewer toolbar to turn the shape fill on and off.
Button Usage The Lock Tangents button locks or unlocks the tangents of adjacent points when moving any point. In the first example, the tangents are unlocked. Therefore, the middle blue point is moved down. Shake tries to keep the tangents of the adjacent points smooth, and therefore moves the tangents. If Lock Tangents is on, the adjacent tangents stay locked in place. This provides accuracy for adjacent segments, but creates a more irregular shape.
m To break a tangent: Control-click the tangent. Note: No tangents are available when the points are set to Linear mode. m To reconnect the tangents: Shift-click the broken tangent. Use the transform tool to modify the entire shape. The transform tool includes pan, rotation, and scaling tools for the shape. Since this is a transformation, the points rotate properly in an angular fashion when interpolating in an animation, rather than just sliding linearly to the next position.
Button Usage To easily animate the QuickShape, enable Autokey and move the points. To enter a new keyframe, move to a new time, and change the shape’s position (or the control points of the shape). In this example, the shape is smaller on the second keyframe. As you drag the playhead, the shape interpolates between the two keyframes. Delete a keyframe (if present) at the current frame.
Button Usage Example Here, a point is inserted and moved toward the center at the first keyframe. At the second keyframe’s position, the shape is still round because Shake has maintained the smooth quality of the segment. If you instead turn on the Propagate buttons when you modify a point, the second keyframe’s point position is also modified. For example, go back to keyframe 1, enable Propagate Forward, and insert a new point, dragging it outward.
QuickShape Node Parameters The following table lists the QuickShape parameters. Parameters This node displays the following controls in the Parameters tab: width, height The overall width and height of the frame in which the rotoshape is drawn. Defines the DOD. These parameters default to the expressions GetDefaultWidth() and GetDefaultHeight(). bytes Bit depth, 1, 2, or 4 bytes/channel. xPan, yPan A global pan applied to the entire shape.
21 Paint 21 Shake provides simple paint capabilities using the QuickPaint node. This chapter describes how to use the non-destructive tools found within this node to make fast fixes to your image sequences. About the QuickPaint Node The QuickPaint node is a touch-up tool to fix small element problems such as holes in mattes or scratches/dirt on your plates. It is a procedural paint tool, which allows you to change strokes long after they’ve been made.
Note: In the Color node, the alpha channel is set to 1 by default. It’s important to make sure the resolution of the QuickPaint node is properly set, because you cannot paint beyond the boundaries of the frame. Toggling Between Paint and Edit Mode The QuickPaint node has two modes of operation. In Paint mode, you can create new brush strokes. In Edit mode, you can modify any previously created paint stroke. When the QuickPaint node is active, its associated tools appear in the Viewer shelf.
The following table contains the basic brush tools. Button Soft falloff Description Hard/Soft When soft is selected, paints any brush type with a soft falloff. When hard is selected, paints any brush type with a hard falloff. You can also press F11 to toggle between the soft and hard falloff. This is not a brush—it just modifies other brushes. Paint Brush Applies RGBA color to the first input. Smudge Smears the pixels. Smudge should always use the hardfalloff setting.
Other Viewer Shelf Controls The QuickPaint node has the following Viewer shelf controls: Button 582 Description Active Channels These buttons indicate which channels are being painted on. For example, to touch up the alpha channel only, turn off the RGB channels. Frame Mode When Frame mode is selected, you only paint on the current frame. Interp Mode When Interp (Interpolate) mode is selected, brush strokes are animated using interpolation from one frame to the next.
Button Description Erase Last Stroke By default, removes the last stroke you made. If you select another stroke with the History Step controls or stokeIndex parameter, this control deletes the currently selected stroke. Clear Canvas Removes all strokes from all frames of your canvas. Modifying Paint Strokes In Edit mode, you can select any stroke by clicking its path. You can also adjust the strokeIndex slider back and forth to expose previous strokes numerically.
m To remove points from the current selection: Control-drag to remove control points from the current selection. To drag-select multiple control points: 1 Move the pointer over the stroke you want to edit. 2 Drag to select that stroke’s control points. 3 Edit the points as necessary. This behavior applies to QuickPaint, RotoShape, and QuickShape objects.
There are two different drag modes that affect how strokes are reshaped when you move a selected group of control points. • If Linear Drag mode is selected, all selected control points move the same amount. Selected points Dragging in Linear Drag mode • If Magnet Drag mode is selected, the points nearest the pointer move the most. To temporarily activate this mode, press and hold the Z key and drag.
Attaching a Tracker to a Paint Stroke In Edit mode, a preexisting track can be attached to a paint stroke. To attach a track to a paint stroke: 1 Make sure the paint stroke is a persistent stroke. Note: For information on converting a paint stroke from Frame to Persist mode, see “Converting Paint Stroke Types” on page 589. You can also convert the stroke after the track is attached.
Modifying Paint Stroke Parameters You can also use the Edit Controls tab in the QuickPaint parameters to modify your strokes. In the Edit Controls tab, click a brush type in the Tool row to switch brush types. You can also click the Hard/Soft button to switch between a hard and soft falloff, or change the stroke type with the Convert Stroke button. Additionally, you can alter or animate the color, alpha, opacity, brushSize, or aspectRatio parameters of the current stroke.
Interpolating Paint Strokes In the following example, frame 1 contains three separate paint strokes, and frame 50 also contains three separate paint strokes. Interpolate the second paint stroke on frame 1 (the number “2”) with the second paint stroke on frame 50 (the number “5”). To interpolate paint strokes from one shape to another: 1 In the Viewer shelf, ensure that Paint mode is enabled. 2 Ensure that Frame mode is enabled. 3 At frame 1, draw three paint strokes.
7 Click the Convert Stroke button. Convert Stroke button The Convert Stroke window opens. 8 In the Convert Stroke window, enable Interp if it is not already enabled. 9 Enter “2, 5” in the Stroke Range field. This instructs Shake to combine paint strokes 2 and 5 into one interpolated stroke. Note: Because there is more than one paint stroke on a frame, the comma syntax must be used for interpolation.
To convert paint strokes from Frame to Persist mode: 1 Once the paint stroke is drawn (in Frame mode), click the Edit mode button in the Viewer shelf. 2 In the Edit Controls tab, select the stroke in the strokeIndex. Note: You can change the selected stroke later in the Convert Stroke window. 3 Click the Convert Stroke button. 4 In the Convert Stroke window, enable Persist.
QuickPaint Hot Keys The following table lists the QuickPaint node hot keys. Key Function F9 Use last brush. F10 or P Pick color. F11 Toggle between hard/soft brush. Z Magnet drag in Edit mode. Note: In Mac OS X, Exposé is mapped to F9-F12 by default. To use these keys in Shake, disable the Exposé keyboard shortcuts in System Preferences. QuickPaint Parameters The following section lists the QuickPaint node parameters. Note: The QuickPaint node should not be used inside of macros.
opacity A fade value applied to the R, G, B, and A channels. constPressure When this parameter is turned on, the digital graphics tablet’s stylus pressure is ignored. keyFrames This parameter has no purpose except as a placeholder to contain keyframe markers in the Time Bar. It is not modifiable by the user. Edit Controls The parameters in this tab let you modify the qualities of existing brushstrokes.
The types of strokes available are: • Persist: Paint strokes are static, and remain onscreen from the frame in which they were drawn until the last frame of the QuickPaint node. • Frame: Paint strokes appear only in the frame in which they were drawn. • Interp: Paint strokes remain onscreen from the frame in which they were drawn until the last frame of the QuickPaint node. Their shape can be keyframed over time, to create interpolated animation effects.
Paint Globals The parameters in this tab control how stroke information is captured when using a digital graphics tablet or mouse. snapshotInterval Sets how many strokes are applied before the image is cached. For low-resolution images, you can probably set the value lower, but if you set it too low when working with film plates, you’ll spend all your time caching 2K plates, which is bad. maxPressure Sets the maximum amount of pressure you can apply.
“FORMAT TOOL MASK NUMDATA;TIME,TYPE;X;Y;P;X;Y;P;...X;Y;P;TIME,TYPE;X;Y;P;....X;Y;P; ”, followed by inPoint, outPoint, and so on, up to yOffset. StrokeData Type Function TOOL int • • • • • MASK float The active channels on which the paint is applied. FORMAT Paint = 1 Smudge = 2 Eraser = 3 Reveal = 4 Clone = 5 Reserved for future use. NUMDATA int TYPE float The time the data corresponds to. TYPE int The mode the data corresponds to.
22 Shake-Generated Images 22 This chapter covers the use of the Shake-generated image nodes found within the Image Tool tab. Generating Images With Shake This chapter covers various nodes that generate images directly within Shake. These nodes can be used for a variety of purposes—as backgrounds, as masks, or as inputs to alter the affect of filter or warp nodes. Checker The Checker node generates a checkerboard within the boundaries of the image. It is handy to test warps, or to split a screen in half.
bytes The bit depth of the generated image. There are three settings: 8 bits, 16 bits, or float (1, 2, or 4 bytes per channel). xSize, ySize The width and height of each checker in the pattern. Color The Color node generates a solid field of color within the width and height of the image. Parameters This node displays the following controls in the Parameters tab: width, height The width and height value fields in the Res parameter set the size of the generated image.
ColorWheel The ColorWheel node generates a primitive color wheel. It can also be used as a tool to determine what HSV/HLS commands, such as AdjustHSV and ChromaKey, are doing. Parameters This node displays the following controls in the Parameters tab: width, height The width and height value fields in the Res parameter set the size of the generated image. bytes The bit depth of the generated image. There are three settings: 8 bits, 16 bits, or float (1, 2, or 4 bytes per channel).
Grad The Grad node generates a gradient between four corners of different colors. The count order of the corners is: Corner 1 in the lower-left corner, corner 2 in the lower-right corner, and so on. For a simple gradient ramp, use the Ramp node. For a radial gradient, use the RGrad node. Parameters This node displays the following controls in the Parameters tab: width, height The width and height value fields in the Res parameter set the size of the generated image.
URColor, aUR, zUR The color, alpha channel value, and Z channel value at the upper-right corner. The color defaults to 100-percent blue. ULColor, aUL, zUL The color, alpha channel value, and Z channel value at the upper-left corner. The color defaults to black. Ramp The Ramp node generates a linear gradient between two edges. You can set the direction of the ramp to horizontal or vertical. The Ramp is, among other things, a useful tool for analyzing color-correction nodes.
bytes The bit depth of the generated image. There are three settings: 8 bits, 16 bits, or float (1, 2, or 4 bytes per channel). orientation Toggles between generating a horizontal or vertical gradient. center The point in the frame at which there’s a 50-percent blend of each color. Color1, alpha1, depth1 The color, alpha value, and Z channel value at the left (horizontal) or bottom (vertical) of the frame.
density The density of the pixels, from 0 to 1. A lower density results in fewer random pixels. seed Changes the random pattern of noise that’s created. When Shake generates a random pattern of values, you need to make sure for purposes of compositing that you can recreate the same random pattern a second time.
bytes The bit depth of the generated image. There are three settings: 8 bits, 16 bits, or float (1, 2, or 4 bytes per channel). xCenter, yCenter The pixel defining the center of the gradient. aspectRatio This parameter inherits the current value of the defaultAspect global parameter. If you’re working on a nonsquare pixel or anamorphic image, it is important that this value is set correctly to avoid unwanted distortion in the image. radius The non-blurred radius of the center.
The Text node uses the Shake implementation of the GL Render. It allows you to not only manipulate the characters in 3D space (including X, Y, and Z position, rotation, and scaling), but also in a camera field of view. Because of this, it is better to animate text within the Text (or AddText) node to ensure crisp, clean edges. To select a font in the interface: 1 In the Text node parameters, open the font pop-up menu. To preview a font in the Viewer, right-click the font name in the list.
Text Shortcut Writes %N Locale’s full month name: November %x,%X Full date representation: mm/dd/yy %y Year without century: 00-99 %Y Year as ccyy Examples 1: Text String Writes My name is Peter My name is Peter My name is %U If login = Dufus: My name is Dufus My name is %U.\nToday is %M. %d My name is Dufus. Today is Nov. 12 Mult red = {Mult1.red} Assuming the node Mult1 exists, and the red value is .46: Mult red = .
Parameters This node displays the following controls in the Parameters tab: width, height The width and height value fields in the Res parameter set the size of the frame containing the generated image. bytes The bit depth of the generated image. There are three settings: 8 bits, 16 bits, or float (1, 2, or 4 bytes per channel). text A text field where you enter the text you want to generate in the Viewer. font A pop-up menu that lets you choose a font.
xAlign Three buttons that let you define how the generated text should be aligned, horizontally. The options are: • left: Aligns the text from the left edge. • center: Aligns the text from the center. • right: Aligns the text from the right edge. yAlign Three buttons that let you define how the generated text should be aligned, vertically. The options are: • bottom: Aligns the text from the bottom edge. • center: Aligns the text from the middle. • top: Aligns the text from the top edge.
Tile The Tile node is located in the Other tab. Tile does not generate an image, but makes small tiles of an image within that image. The more tiles created, the slower the processing (for example, more than 40 tiles). Parameters This node displays the following controls in the Parameters tab: nXTile The number of times the image is duplicated and shrunk horizontally. nYTile The number of times the image is duplicated and shrunk vertically.
23 Color Correction 23 Shake’s color-correction and pixel-analyzer functions provide many ways of analyzing and manipulating the color values of your images. Bit Depth, Color Space, and Color Correction By default, Shake works with a color range of 0 to 1 in RGB linear space. Shake allows you to work at different bit depths, so 0 is considered black and 1 is considered white.
For a practical discussion on using this technique, see Chapter 24, “Keying,” on page 681. Note: To view the images in this chapter in color, refer to the onscreen PDF version of this documentation. Concatenation of Color-Correction Nodes A powerful aspect of Shake’s color handling is its ability to concatenate many color corrections. This means that if you have ten concatenating color functions in a row, Shake internally compiles the functions into a single lookup table, then executes that table.
Example 1: Proper Color-Correction Concatenation The following example illustrates the correct method of concatenating color-correction nodes. First, a Brightness node (set to a value of 4) is applied to an image. Next, a second Brightness node (set to a value of .25) is added to the tree. The two nodes concatenate (.25 * 4 = 1) to multiply the image by 1, resulting in no change to the image. This is the ideal result.
Prior to the Blur node, all of the values are boosted to 1 when multiplied by the first Brightness node’s adjustment of 4. After the Blur node, the values are then dropped to a maximum value of .25 when the second Brightness value of .25 is applied. As you can see, the result is altogether different than the result in Example 1. This can be avoided by always making sure that the color-correction nodes in your tree are properly concatenating.
Note: AdjustHSV and LookupHSV only concatenate with each other. Masked Nodes Break Concatenation If you mask a node, concatenation is broken. To avoid broken concatenation, use a node tree structure with KeyMix. Making Concatenation Visible When you turn on enhanced Node View, you can see the links between concatenated nodes. Make sure that showConcatenationLinks is set to enhanced in the enhancedNodeView subtree of the Globals tab, then turn on the enhanced Node View.
In the following example, a computer-generated graphic is composited with a background image. The addition of a ContrastLum node (with a value of .6) results in premultiplication issues—manifested as a fringing around the edges of the image. To eliminate this problem, unpremultiply the graphic prior to color correction by inserting an MDiv node prior to any color-correction nodes in the tree.
The following screenshot shows a correctly set up node tree. Mult, Gamma, and ContrastRGB nodes are inserted between a pair of MDiv and MMult nodes, prior to compositing the two images with a layering node (the Over node). Note: In the above example, all three color-correction nodes concatenate properly, shown by the green line that is visible with enhanced Node View is on.
In the following example, an artifact of Internet pop culture is recreated using a Text node. The default black background color is raised to blue with an Add node. When the image is panned, blue continues to appear in the area that was previously outside of the frame.
To color correct the area outside of the Domain of Definition (DOD, represented by the green bounding box), use the SetBGColor node. For more information on the Infinite Workspace, see “Taking Advantage of the Infinite Workspace” on page 405. For more information on the DOD, see “The Domain of Definition (DOD)” on page 82.
Using the Color Picker The Color Picker tab is a centralized interface that lets you assign colors to node parameters using the ColorWheel, luminance gradient, swatches from a color palette, or numerically, using a variety of color models. You can also store your own frequently used color swatches for future use in the Palette. Color sampling swatches Choose which color to pick when clicking in the Viewer. ColorWheel Click the ColorWheel and luminance bar to choose a color.
Using Controls in the Color Picker You can adjust the controls in the Color Picker in the following ways: m To choose a color from the ColorWheel: Drag the pointer in the wheel to select a point. Crosshairs make it easy to spot the precise color that’s chosen, and the four sampling controls above the ColorWheel reflect the selection. m To change the overall value of the wheel and the selected color: Drag in the luminance bar underneath the ColorWheel. The overall brightness of the ColorWheel changes.
To load a sampled color into a Color control in the Parameters tab: 1 In the Parameters tab, click the Color control for the color parameter you want to adjust. A yellow outline appears around the edge of the Color control, and the Color Picker opens. 2 Select a new color in any of the ways described above (using the ColorWheel or dragging over the image in the Viewer, for example).
m To select a color from the Palette: Click a color swatch. You can also drag and drop between the Palette swatches and other Color Picker swatches. m To assign a color to a Palette swatch: Drag a color sampling swatch (above the ColorWheel) and drop it into the Palette swatches area. The new color appears in the Palette. m To save your own custom color assignments: Choose File > Save Interface Settings.
You can also choose or adjust colors numerically in the Color Picker by manipulating the values of each individual channel. Defining Custom Default Palette Colors If you want to change the default Palette colors that Shake starts with, add the following declaration to a .h file in the ui directory: nuiSetColor(1,1,0,0); nuiSetColor(2,1,0.5,0); nuiSetColor(3,1,1,0); etc...
Use the color channel value fields to enter numeric values or expressions. The numeric ranges representing each color channel can be changed using the ValueRange button, making manipulation of color by expressions easier. The channel slider buttons can also be individually controlled by the same hot keys used for the Virtual Color Picker. These channel sliders let you adjust colors using individual channels from each of three different color space representations: RGB, HSV, and CMYK.
The following chart lists all the keyboard shortcuts for color adjustments within a color control. Keyboard Channel Description R Red Adjusts red channel independently. G Green Adjusts green channel independently. B Blue Adjusts blue channel independently. O Offset Boosts or lowers all color channels relative to one another. H Hue Adjusts all channels by rotating around the ColorWheel. S Saturation Adjusts color saturation, according to the HSV model.
Customizing the Palette and Color Picker Interface These commands are placed in your ui.h file. For more information on customizing Shake, see Chapter 14, “Customizing Shake,” on page 355. Code Description nuiSetColor(1,1,0,0); nuiSetColor(2,1,0.5,0); nuiSetColor(3,1,1,0); Assigns a color to a Palette swatch; the first number is the assigned box. Values are in a range of 0 to 1. nuiPushControlGroup(“Color”); nuiGroupControl(“MyFunction.red”); nuiGroupControl(“MyFunction.
Note: The Pixel Analyzer tab should not be confused with the PixelAnalyzer node, found in the Other tab. For more information, see “The PixelAnalyzer Node” on page 631. Using the Pixel Analyzer is very similar to sampling color values with the Color Picker. When you drag across an image in the Viewer with the pointer, the values update in the Pixel Analyzer. You can usually use the default Pixel Analyzer settings.
Using the Pixel Analyzer Tab to Set Levels The following example shows you how the Pixel Analyzer can be used to perform a similar operation to that of the Auto Levels command in Adobe Photoshop. This method works by using the Pixel Analyzer to automatically find the lowest and highest values in each channel of an image. You can then assign these values to an Expand node in order to push the lowest values to 0 (black), and the highest values to 1 (white).
5 Drag the Minimum color to the Low Color control of the Expand node in the Parameters tab. 6 Drag the Maximum color to the High Color control of the Expand node in the Parameters tab. The image is now adjusted. Load the Expand node into the Viewer to see the result. Before After Pixel Analyzer Controls The Pixel Analyzer has the following controls: Mode • Off: Turns off the Pixel Analyzer. • Pixel: Analyzes the pixels based upon the area scrubbed with the pointer.
Value Range Shake numerically describes color as a range of 0 to 1 (0, 0, 0 is black; 1, 1, 1 is white). However, you can set a different numeric range—for example, 0, 0, 0 as black, and 255, 255, 255 as white. Hexadecimal This button toggles the numeric display to hexadecimal values. Min/Max Basis The Min/Max Basis buttons set the channel for calculation of the Minimum and Maximum swatches. Normally, this parameter is set to L (luminance).
To analyze an area: 1 Attach the PixelAnalyzer node to an image. Double-click the PixelAnalyzer node to load its image into the Viewer and its parameters into the Parameters tab. 2 Position the analysis area box in the Viewer to examine the necessary area of the image, and adjust its size as necessary. Note: To animate the box, use the Viewer Autokey button, or use an expression to assign tracker data to the areaX and areaY parameters of the analysis area. Otherwise, the box remains stationary.
Setting Up the PixelAnalyzer Node Attach a PixelAnalyzer node to the problem image. It will eventually be used as a source of color values by expressions placed within the parameters of color-correction nodes. The color-correction nodes are not attached to the PixelAnalyzer node; instead, they’re branched off of the source image. Three different examples show three different colorcorrection nodes in use—different situations may require different approaches, depending on the image.
Method 3: Using a Mult Node to Correct All Three Channels Method 2 assumes uniform variation across all three channels, which is probably wishful thinking. On the other hand, it’s fast and easy. A more accurate approach might be to feed similar expressions into the RGB channels of a Mult node. The following expressions are entered into the red, green, and blue parameters of a Mult node: (PixelAnalyzer1.area1AverageRed@@1)/PixelAnalyzer1.area1AverageRed (PixelAnalyzer1.area1AverageGreen@@1)/PixelAnalyzer1.
areaMinimum The minimum value found within the analysis area over the span of the analysisRange. areaMaximum The maximum value found within the analysis area over the span of the analysisRange. areaWindowParamameters subtree The areaWindowParameters subtree contains parameters that define the size and location of the region that encompasses each analysis area, including the following: • areaX, Y: The center of the analysis area.
Consolidated Correctors The consolidated correctors (ColorCorrect, ColorMatch, ColorReplace, HueCurves) are your primary tools for tasks such as matching skin tones, shadow levels, spill suppression, and so on. Functions performed by the atomic-level nodes are also performed by these, but are combined with many other tools which provide more control over the result. The following table includes general guidelines to help you understand why there are so many nodes in the Color Tool tab.
Node Description HueCurves A node that isolates and adjusts an image based on its hue. Ideal for spill suppression. Invert Turns black to white and vice versa. Works best on normalized images between 0 and 1. LogLin Performs logarithmic to linear, and linear to logarithmic color space conversion. Lookup/HLS/HSV Applies lookup expressions or curve manipulation to your image. It is faster than ColorX for non-pixel based lookups. LookupFile Pulls a lookup table from a file.
Add The Add node adds color to the R, G, B, A, or Z channel. Specifically, this node adds color to black areas, including those beyond the image frame, in case you move the image later. Any correction that occurs outside of the DOD can be corrected with the SetBGColor node. Shake’s color is described in a range of 0 to 1, so adding -1, -1, -1 makes your image completely black. If you add the fifth value, depth, you effectively add a Z channel with your add value to the image.
Clamp The Clamp node clamps off values above and below a certain range. For example, if your redHi value is .7, any value above that is set to .7. You can isolate the red, green, blue, and alpha values. Parameters This node displays the following controls in the Parameters tab: Low Color The low value that all values are set to if they are less than this number. 0 is no change. aLo A low value control for the alpha channel.
High Color The new highest value in the image. A value of 1 equals no change. aHi A high value control for the alpha channel. ContrastLum The ContrastLum node applies a contrast change on the image, with a smooth falloff on both the low and high ends. You can also move the center of the contrast curve up and down (for example, move it down to make your overall image brighter).
Parameters This node displays the following controls in the Parameters tab: Value The contrast value. A higher value means it pushes the RGB values toward 0 and 1. A low value is low contrast. A value of 0 represents no change. Center The center of the contrast curve. A lower value makes that channel brighter. A higher value makes the image darker. Generally, these values are between 0 and 1. SoftClip The roll-off value to give a smooth interpolation. A value of 0 equals no roll-off.
aLo A low color control for the alpha channel. High Color Pixels greater than or equal to Hi value go to 1. At 8 or 16 bits per channel, pixels greater than this value are clamped at 1. aHi A high color control for the alpha channel. Fade The Fade node multiplies the RGBA channels. It differs from Brightness in that Fade also affects the alpha channel. For individual channel control, use Mult. A neat trick is to fade to 0. This effectively deactivates all nodes above the Fade node in the tree.
rGamma The red gamma value. gGamma The green gamma value. bGamma The blue gamma value. aGamma The alpha gamma value. Invert The Invert node inverts the color curve, so white becomes black and black becomes white. A predominantly yellow image becomes predominantly blue if the red, green, and blue (RGB) channels are selected in the channels field. Invert also works on the Z channel, but assumes the Z is normalized, for example, between 0 and 1. If this is not the case, you have an unpredictable result.
Parameters This node displays the following control in the Parameters tab: Weight The default R, G, and B values are set according to the human eye’s sensitivity to color, but you can balance the colors differently to push a certain channel. The default values are: • R = .3 • G = .59 • B = .11 Mult The Mult node multiplies the R,G, B, A, or Z channels. To uniformly increase the red, green, blue, and alpha channels, use the Fade node.
Parameters This node displays the following control in the Parameters tab: value A slider that defines the saturation multiplier. Solarize The Solarize node is a partial inverse that reverses the high or low end, depending on the value of the hi/lo flag. With values above (“hi,” or 1) or below (“lo,” or 0 ), the thresholds are reversed.
Parameters This node displays the following controls in the Parameters tab: Color Anything below this value goes to black. alpha All areas in the alpha channel below this value go to black. cCrush If this is set to 1, everything above the cut-off values goes to 1. softClip Provides a roll-off value. Utility Correctors These tools are more applicable for preparing data for other operations. ColorSpace The ColorSpace node converts an image from one color space to another color space.
Parameters This node displays the following controls in the Parameters tab: inSpace Selects the incoming color space. outSpace Selects the output color space. For example, if you use one ColorSpace, you probably use rgb as your inSpace, and then something like hsv to convert it to hue/saturation/ value space. After applying your operations, you usually apply a second ColorSpace node, with hsv as your inSpace and rgb as your outSpace.
Expressions can use the following variables: • The variables r, g, b, a, and z refer to the value of the original channels (red, green, blue, alpha, and Z). • The variables x and y are the coordinates of the pixel. • The variables width and height are the width and height of the image. • The variable time is the current frame number (time). Many operators can be represented by an arithmetic expression, such as reordering, color correction, and gradient generation, or even circle drawing.
Note: This node only does color correction—it does not change your bit depth or your file type. When Shake imports the Cineon files, typically a 10-bit file, it automatically promotes the files to 16 bits. This process has nothing to do with the color correction. The default values are supplied by Kodak—if you apply a LogLin in Shake, you should get the same visual result as if you plugged in the same numbers into any other software package’s logarithmic converter.
rNGamma Generally, this number is not touched. The .6 is an average of the response curves, and may differ from stock to stock and even channel to channel. You can look it up on Kodak’s website—see products/Film/Motion Picture Film, and then check the characteristic curves. rDGamma The display gamma, according to Kodak, to compensate for the monitor lookup table. This was set to neutralize the Cineon system’s standard monitor setting. Its inclusion here is more of a heritage thing.
Parameters This node displays the following controls in the Parameters tab: rExpr Use this function to change the input red value, always represented by “x.” gExpr Use this function to change the input green value, always represented by “x.” bExpr Use this function to change the input blue value, always represented by “x.” aExpr Use this function to change the input alpha value, always represented by “x.
Sample Lookup Tables The following table lists the Lookup equivalents of other Shake color-correction nodes. Function Brightness Invert Math Expression f(x) = x * value f(x) = 1-x Lookup Expression x*1.5 1-x Function Compress Do Nothing Math Expression f(x) = x * (hi-lo) + lo f(x) = x Lookup Expression “(x*.4)+0.3” (if lo = 0.3 and hi = 0.7) “x” Graph (white is result, gray is input) Graph (white is result, gray is input) The following examples do custom lookups.
Function Spline Lookup Linear Lookup Lookup Expression CSplineV(x,0, 0@0, 1@.25, 0@.75, 1@1 ) LinearV(x,0, 0@0, 1@.25, 0@.75, 1@1 ) Graph (white is result, gray is input) LookupFile Use the LookupFile node to apply a lookup table to any image by reading a text file. The file should consist of an arbitrary number of rows, and each row can have three or four entries, corresponding to red, green, blue, and possibly alpha.
Parameters This node displays the following controls in the Parameters tab: lookupFile A text field where you enter the path to the lookup file. channels The channels to which the lookup operation is applied. LookupHLS The LookupHLS node performs exactly like Lookup, except it works on the HLS channels instead of RGB channels. Parameters This node displays the following controls in the Parameters tab: sExpr Use this function to change the input value, always represented by “x.
hExpr Use this function to change the input value, always represented by “x.” aExpr Use this function to change the input value, always represented by “x.” LookupHSV The LookupHSV node performs exactly like Lookup, except that it works on the HSV channels instead of RGB channels. Note: You cannot clone LookupHSV nodes in the node tree using the Paste Linked command.
MDiv The MDiv node divides the color channels by the alpha channel. When you color correct a rendered (premultiplied) image, first apply an MDiv node to the image to make the image a non-premultiplied image, perform the color correction, and then add an MMult node to return the image to its premultiplied state. For more information on premultiplication, see “About Premultiplication and Compositing” on page 421.
Reorder The Reorder node lets you shuffle channels. The argument to this command specifies the new order. A channel can be copied to several different channels. The letter “l” refers to the luminance pseudo-channel which can be substituted in place of the RGBA. If an expression is on a channel that does not exist, Shake creates the channel. You can use the Z channel as well. For example: shake -reorder zzzz places the Z channel into the RGBA channels for viewing.
channels The channels to be set. value The value of the channel. SetAlpha The SetAlpha node is simply a macro for Set and Crop that sets the alpha to 1 by default. It exists because in the Infinite Workspace, color corrections extend beyond the frame of an image. By using the Crop in the macro, the Set node is cut off, making the image ready for transformations. To remove the alpha channel from an image (turn an RGBA image into an RGB image), set the alpha value to 0.
Parameters This node displays the following controls in the Parameters tab: mask Specifies the channels that are reset. Color The new value to set the red, green, and blue channels to. alpha The new value to set the alpha channel to. depth The new value to set the Z channel to. VideoSafe For information on the VideoSafe node, see “VideoSafe” on page 208. Consolidated Color Correctors The consolidated color-corrector nodes are more complex than the other nodes.
Parameters This node displays the following controls in the Parameters tab: sourceColor These color controls let you select the HSV values of the target color you want to change. destinationColor The color you want to use as the replacement for the color value selected as the sourceColor. hueOffset A value that is added to the hue of the selected destination Color, thereby changing the color.
satOffset This is what is added to the saturation of the selected destination Color, thereby changing the intensity of the color. satRange The range of saturation that is added to the HSV value selected in sourceColor to include a wider field of values. satFalloff The amount of falloff from the affected amount of saturation to the unaffected amount of saturation. A greater satFalloff value includes more saturated values at the edges of the satRange.
The ColorCorrect Subtabs The following table describes the ColorCorrect Parameter subtabs. Subtab Description Master Applies the same correction to the entire image. Low Controls Applies the correction primarily to the darkest portion of the image; the correction falls off as the image gets brighter. Mid Controls Applies the correction primarily to the middle range of the image.
m Click the Color control, then select a color from the Viewer or the ColorWheel (in the Color Picker). m Use the Virtual Color Picker. Press the relative key, R (red), G (green), B (blue), H (hue), S (saturation), V (value), L (luminance), M (magenta), or T (temperature), and drag left or right on the parameter line. (You can do this anywhere on the line, not just over the Color control.) m To group the R, G, and B sliders, press V (value) and drag left or right.
The bottom portion of the tab contains buttons to toggle the channels from RGB display to a different color space model. You can display RGB, HSV, HLS, CMY, and TMV. For example, if the current image is displayed in the RGB color model, click HSV and the numbers are converted to HSV space. Notice the Add color does not change—only the numerical value. Note: The “TMV” color space is Temperature/Magenta-Cyan/Value. When the ColorCorrect node is saved into a script, the values are always stored in RGB space.
Working With Low, Mid, and High Ranges The following section discusses the differences in working with low, mid, and high color ranges in the ColorCorrect node. The first image is the original image. Thanks to Skippingstone for the use of images from their short film Doppelganger. In the following examples, a Gain (multiply) of 2 is applied to each channel. The first example multiplies all pixels by 2. The pure blacks stay black, the whites flare out.
You can control the range of the image that is considered to be in the shadows, midtones, and highlights in the Range Curves subtab. This tab displays your final color lookup operator as a curve, your mask ranges (to turn on the display, click the Ranges button at the bottom), and controls for the center of the low and high curves.
To control the mask areas, turn on the Ranges curve display at the bottom of the Range Curves tab. The left image below shows the default ranges. A curve of the final lookup is displayed in this illustration as a yellow line for clarity. Notice that the Low and High range curves’ (gray curves sloping in from left and right) centers are set at .5. If you adjust the low or high values, you modify that range, as well as the mid-range curve.
The Misc Tab The Misc tab contains several functions. • Invert: Invert uses the formula 1-x, so float values may have odd results. • reorderChannels: Enter a string to swap or remove your channels as per the standard Reorder method. For more information, see “Reorder” on page 657.
Order of Calculations Calculations are made in the following order: • MDiv (optional) • ColorReplace • Invert • Lookup Curves • Gamma • Mult • Add • Contrast • Reorder • MMult (optional) ColorMatch The ColorMatch node allows you to take an old set of colors (source color) in an image and match them to a new set (destination color). You can match the low, middle, and high end of the image. You can also perform Contrast, Gamma, and Add color corrections with Gamma as an inverse gamma to preserve highlights.
Parameters This node displays the following controls in the Parameters tab: lowSource The low end of the RGB of the source color. lowDest The low end of the RGB destination color. midSource The middle of the RGB of the source color. midDest The middle of the RGB destination color. highSource The high end of the RGB of the source color. highDest The high end of the RGB destination color. Contrast Contrast values for the three channels. Gamma The Gamma values.
Add Adds color to the input image. Blacks are modified when this is raised. min Sets the clipping for the function. max Sets the clipping for the function. ColorReplace The ColorReplace node allows you to isolate a color according to its hue, saturation, and value, and then replace it with a different color. Other areas of the spectrum remain unchanged. This is especially useful for spill suppression. To pull a mask of the affected source color, enable affectAlpha in the ColorReplace parameters.
hueFalloff This describes the amount of falloff from the affected to the unaffected hue region. A greater hueFalloff value includes more color values at the edges of the hueRange. satRange The range of the saturation from the Source color; 1 is the entire range. satFalloff This describes the amount of falloff from the affected amount of saturation to the unaffected amount of saturation. A greater satFalloff value includes more saturated values at the edges of the satRange.
Parameters This node displays the following controls in the Parameters tab: saturation Removes saturation from the hue range you identify. satLimit Sets the limit for saturation values. rSuppress Removes red from the hue area you identify when you drag the control point downward. rHue Adds red to the hue range you identify. luminance Removes luminance from your area. gSuppress Removes green from the hue area you identify when you drag the control point downward.
gHue Adds green to the hue range you identify. bSuppress Removes blue from the hue area you identify when you drag the control point downward. bHue Adds blue to the hue range you identify. Other Nodes for Image Analysis The PlotScanline and Histogram nodes, found in the Other tool tab, let you analyze images from the node tree to better understand how the data is being manipulated. Note: You can also apply a Histogram or PlotScanline using the viewer scripts.
When a node such as ContrastLum is inserted above the PlotScanline node, you can begin to understand the node. In the ContrastLum node, value is set to 1.5 and the center and softClip parameters are adjusted. The effect on the ramp is reflected in the plot. This also works for non-color correctors, and makes it an interesting analysis tool for the Filter–Grain or Warp–Randomize node.
PlotScanline The PlotScanline node is an analysis tool that examines a line of an image and graphs the intensity of each channel per X position. It greatly helps to determine what a colorcorrection node is doing. Although it can be attached to any image for analysis, it is often attached to a horizontal Ramp to observe the behavior of a color correction. Switch the Viewer to view the alpha channel (press A in the Viewer), and see the behavior of the alpha channel.
Parameters This node displays the following controls in the Parameters tab: width The width of the PlotScanline. You likely want to set the width to 256 on an 8-bit image to get one-to-one correspondence. height The height of the PlotScanline. You likely want to set the height to 256 on an 8-bit image to get one-to-one correspondence. line The Y-line of the image to be analyzed. On a horizontal ramp, this does not matter, as they are all identical.
Example 2 A 256 x 256 8-bit Color. Since the color is set to (approximately) .75, .5, .25, each channel exists at only one position in the Histogram. Example 3 A 256 x 256 8-bit 4-corner Grad. The four corner values are of red (1, .5, .5, .5), of green (0, 1, .5, .5), and of blue (.5, 0, 0, 0). This reflects that most of red’s values are around .5, ramping downward to 1, and no value is less than .5. In the Viewer, press R, G, B, or C to toggle through the different channels.
Parameters This node displays the following controls in the Parameters tab: width The width of the Histogram. You probably want to set the width to 256 on an 8-bit image for one-to-one correspondence. height The height of the Histogram. You probably want to set the height to 256 on an 8-bit image for one-to-one correspondence. ignore Tells Shake to ignore black or white pixels. For example, if you have a small element on a large black background, your histogram is skewed toward black.
24 Keying 24 Shake provides powerful, industry-standard keying tools in the Primatte and Keylight nodes, along with additional keying nodes such as LumaKey and SpillSuppress. When combined with Shake’s other filtering, masking, and color-correction nodes, you have detailed control over every aspect of the keying process. About Keying and Spill Suppression The first part of this chapter presents different strategies for pulling keys in Shake.
Pulling a Bluescreen or Greenscreen In the Key Tool tab, the two primary nodes used to pull bluescreen and greenscreen keys are Primatte and Keylight. In the Shake 4 Tutorials, there are lessons devoted to each. Other functions in the Key tab include the ChromaKey, DepthKey, DepthSlice, LumaKey, and SpillSuppress nodes. These are discussed in the second half of this chapter. The ColorReplace node, although located in the Color tab, is also considered to be another key-pulling node.
Because ColorReplace puts white in the SourceColor area of the alpha channel, use the Invert node to invert the image for the Over node. The initial settings yield blue fringes. In the ColorReplace parameters, set satFalloff to 1 to correct this. Also, if pure black or pure white pixels start to show transparent, set the valRange and valFalloff numbers to approximately .2 and .5. You can see there is some crunchiness, particularly in the hair.
You can combine keys with the holdout matte input. Typically, you pull a basic key for soft edges and reflections. You also pull a second key which is very hard, and then soften it with filters. In the following example, the first image shows the initial key coming out of the Keylight node. The reflections are good, but there is some transparency near the seat belt and steering wheel. Next, a key is pulled with Primatte on the same bluescreen.
Next, filters are attached to the Primatte node. A DilateErode is added, and the xPixels parameter set to 1 (this closes up any holes in the alpha channel). You can also use a Median filter to do the same thing. A second DilateErode is applied, with the xPixels set to -5. This eats away at the matte. This filtering process cleans up the matte, making it more solid. A Blur softens it, and is fed into the HoldOutMatte input (the third input) of the Keylight node. The result is a solid matte with soft edges.
Another way to combine keys applies only to the Primatte node, which features a useful arithmetic parameter. Normally, when you pull a key in Primatte, the alpha mask is replaced in the foreground image. When the arithmetic parameter is switched from replace to add, multiply, or subtract, you can combine the mattes within Primatte. In the following node tree, an initial key is pulled with ColorReplace, with the affectAlpha button turned on.
The following example uses a SwitchMatte node to assign the information from the combined keys to the foreground image. The resulting combined image data is then composited against the background using an Over node. Blue and Green Spill Suppression Once the composite is pulled from the keyers and put back into the KeyMix or Over node, you can start to work with spill suppression. Blue spill occurs when light is reflected off of the bluescreen and onto the foreground material.
The following examples use the woman.iff and bg.jpg files in the /Tutorial_08/images directory. Notice that there is quite a bit of blue spill on the woman’s shirt. In the following tree, the Primatte output is set to alpha only; a holdout matte is created for the line under her arm (with a QuickPaint node); and foreground and background scrubs are added. The composite is done with an Over node that has preMultiply enabled.
Using Color Replace—Method One This technique is nice because it is fast, but often simply replaces blue spill with a different color. In the following tree, a ColorReplace node is applied to the foreground, and replaces the blue with the color of the wall. As always, increase the satFalloff to a value near1. The head looks great, but spill remains on the shirt, and there is now a yellow edge around the skirt. To correct this, drop the ColorReplace valRange to 0 and the valFalloff to approximately .4.
Using Color Replace—Method Two A better technique is to use ColorReplace to mask a color correction. Replace ColorReplace2 with a Monochrome node, then pipe Primatte directly into it. Next, attach the output of ColorReplace1 as the Monochrome1 mask, and turn on the affectAlpha parameter in ColorReplace. This process turns off all saturation in the blue areas and turns those areas gray. This is good since the eye can detect luminance levels better than saturation levels.
HueCurves The HueCurves node, located in the Color Tool tab, enables you to boost colors or saturation based on the hue of the pixel you want to affect. HueCurves works by loading a parameter into the Curve Editor and tuning it—ignoring the value fields in the node parameters. The X axis is the hue, and the Y axis depends on the parameter you are using. For the following example, load the saturation curve into the Curve Editor and grab the control point around .66, since blue has a hue of 66 percent.
A black line appears around the pillar. As mentioned earlier, it is better to composite after pulling your key because it gives you more flexibility. 7 So, rewire the tree with an Over node. Make sure you turn on preMultiply in the Over node parameters and set the Keylight output to unPremult. 8 Next, attach a DilateErode node to the Keylight node. 9 In the DilateErode channels parameter, enter “a” (replace rgba) to affect only the alpha, then set xPixels to -1.
The next image illustrates a disabled preMultiply parameter in the Over node (because the mask/RGB premultiplied relationship is upset). White lines appear around the edges. This introduces another problem: The electrical power lines have disappeared from the lower-right corner of the image. Because the details are so fine, the DilateErode node has chewed the lines away. The easiest way of correcting this in this example is to use a manually painted mask, which limits the effect of the DilateErode node.
3 Open the Mask subtree in the DilateErode parameters, then enable invertMask. The edges are now dilated everywhere except around the wires area. For more information on the QuickPaint node, see “About the QuickPaint Node” on page 579. Applying Effects to Bluescreen Footage Problems can occur when you apply effects to keyed footage. For example, suppose you want to blur the foreground image, but not the background.
Problem 1: Edge Ringing When the blur is applied, a blue edge is introduced along the woman’s neck line. Problem 2: Accidentally Blurring Both Layers One might be tempted to place the Blur node after the Keylight node in the tree. This also produces an incorrect result—the background is blurred as well. Problem 3: Artifacts Introduced by Masking Lastly, one might be tempted to mask the blur using the key from Keylight. This also produces an incorrect result.
Filtering Keys: The Correct Way The problem with the three examples above is that the keying node, in this case Keylight, is being made to do too much—by having to simultaneously key, suppress spill, and composite within the same node, there is no good place to apply a filter. The solution is to pull a key for purposes of creating a mask, but to use other nodes to perform the actual compositing. In the following example, the Keylight output parameter can be set to either “comp” or “on Black.
On the other hand, if your foreground subject has slicked back hair, a crisp suit, and there are no translucent areas to worry about, you may be able to pull a perfectly acceptable key. The following example presents an impeccably shot bluescreen image, recorded using a high-quality DV camera. When you key the image and place it over a background (a red field is used in this example), the result is marred by blocky, aliased-looking edges all around your foreground subject.
Although the information in video is transferred from the YUV colorspace into the RGB colorspace, you can still examine the original YUV channels. Attach a Color–ColorSpace node to the FileIn and set the outSpace to be YUV. With the pointer over the Viewer, press the R, G, and B keys to look at the new YUV channels.
This converts the image back to RGB space. The key is greatly improved. In particular, the original blockiness around the edge is gone. Unfortunately, you’re still missing any fine detail that you might otherwise have had were the footage shot using a different format. Without blur on UV channels With blur on UV channels Note: Using this method when you use straight YUV files, you can bypass the RGB to YUV conversion by turning off yuvDecode in the FileIn node.
To correct a DV key (method two): 1 As in the first method, attach a ColorSpace node to the FileIn node containing the DV footage, then set the outSpace parameter to YUV. 2 Next, attach a Reorder node to the output of the ColorSpace node. Set the channels parameter to rrra to reassign the Y channel (the least compressed channel) to all three channels. The result will be a sharp grayscale image.
6 Now, attach the outputs of the LumaKey and the Keylight nodes to a Max node, to combine both alpha channels into one. The LumaKey matte The Keylight matte The above screenshots show the results of each individual key, combined into the single alpha channel below. As you see, the holes in the LumaKey matte are filled by the Keylight matte, and the loss of detail around the edge of the Keylight matte is restored by that in the LumaKey matte.
7 As an optional step, you may find it necessary to insert a DilateErode node between the Keylight and Max nodes in order to erode the output matte from the Keylight so it doesn’t interfere with the edge created by the LumaKey. This produces a mask that you can then recombine with the original foreground image and a background image using a KeyMix node. You’ll probably have to deal with some spill suppression, but you can use the same techniques described in “Blue and Green Spill Suppression” on page 687.
ChromaKey The ChromaKey node examines the HSV values of an image and pulls a matte based upon the parameters. In the interface, you can scrub a color in the Viewer. However, disable the matteMult parameter before you scrub. The hue, saturation, and value of an image each has a set of parameters to describe the exact HSV values you are keying, as a range from that midpoint, a falloff value, and a sharpness value to describe the falloff curve.
satSharpness Describes the falloff curve from satRange to satFalloff. • 0 = linear drop-off • 1 = smooth drop-off valRange Plus and minus from the value specified by the HSVColor parameter. valFalloff Describes the falloff range from valRange that is picked, with the values ramping down. valSharpness Describes the falloff curve from valRange to valFalloff. • 0 = linear drop-off • 1 = smooth drop-off matteMult Toggle to premultiply the RGB channels by the pulled mask.
hiVal Any pixel above this value (as calculated by its depth) turns white. loSmooth A roll-off factor to provide a smooth drop-off. hiSmooth A roll-off factor to provide a smooth drop-off. matteMult Toggle to premultiply the RGB channels by the pulled mask. • 0 = no premultiply • 1 = premultiply DepthSlice Similar to DepthKey, the DepthSlice node creates a slice in the alpha channel based on Z, as defined by a center point, and a drop-off range.
Keylight Keylight is an Academy Award-winning keyer from Framestore CFC based in England. It accurately models the interaction of the bluescreen or greenscreen light with the foreground elements, and replaces it with light from the new background. With this approach, blue spill and green spill removal becomes an intrinsic part of the process, and provides a much more natural look with less tedious trial-and-error work.
• status: Displays an image with different colors, each of which indicates what portions of the foreground image are handled in which way by Keylight. This mode is useful for helping you to troubleshoot your key. • Black pixels: Areas that become pure background in the composite. • Blue pixels: Areas that become spill-corrected foreground. • Green pixels: A blend of foreground and background pixels. • Pure green: Mostly foreground and dark green is mostly background.
The transparency of the foreground is measured by calculating the difference between the dominant screen color (blue by default, otherwise the value of the screenColour parameter) and a weighted average of the other two colors (red and green). With the example of a cyan screen, there is a greater difference between the blue and the red than between the blue and the green, since cyan has more green than red.
colourspace Keylight models the interaction of the blue/green light from the screen with the foreground elements. For these calculations to work correctly, you need to specify how pixel values relate to light levels. This is the function of the colourspace menu. Therefore, with Cineon plates (or other logarithmic files) you have the option to pull the key with or without a Delog operator before the key pull.
hiVal Any pixel above this value (as calculated by its luminance) turns white. loSmooth A roll-off factor to provide a smooth drop-off. hiSmooth A roll-off factor to provide a smooth drop-off. matteMult Toggle to premultiply the RGB channels by the pulled mask. • 0 = no premultiply • 1 = premultiply Primatte (Plug-in) The Primatte plug-in is the latest update of Photron’s Primatte keying software.
In Primatte, you assign color to one of four zones by clicking one of the eight large operator buttons, then scrubbing for a color in the Viewer. These four zones are arranged around a center point in 3D color space, with each zone situated like a layer of an onion. The following diagram shows the operator/zone assignments. Note that the “decolor all” button scales the entire 3D space, and shifts all color either toward or away from the foreground.
• status: Presents an image with different colors, displaying which parts of the image fall into the four Primatte zones. This mode is useful to help you troubleshoot your key. • Black–Zone 1: All background • Blue–Zone 2: Transparent foreground • Green–Zone 3: Suppressed foreground • Red–Zone 4: All foreground arithmetic Determines how Primatte affects the foreground matte channel. • Replace (0): Replaces the fg matte channel completely.
operator Each button that appears in the group of controls labelled “operator” allows you to modify the key created by Primatte, using a color you select with the Color control. The effect of all the operators you click is cumulative, and each operation you perform is saved in a history of operations that’s accessible via the currentOp slider. Every time you click an operator, an additional operation is added to the history of operations represented by the currentOp slider.
• decolor all: When this mode is selected, the value parameter appears at the bottom of the Parameters tab. Adjusting the value parameter shrinks or expands the polyhedron between zone 4 (all foreground) and zone 3 (foreground plus spill suppress). Positive values expand the shell, effectively shifting across the entire image more color from the foreground into the suppressed area. Negative values contract the shell, thereby slipping more values away from the suppressed area into the foreground area.
This initial pixel scrub that defines the center is always operation 0 in the currentOp slider. To readjust the center, move the currentOp slider all the way to the left, to operation 0. Note: Readjusting the center operation will change the effect of all subsequent operations you have already performed.
screenColor Select color to suppress. • 0 = Suppress blue • 1 = Suppress green. gGain then converts to bGain.
25 Image Tracking, Stabilization, and SmoothCam 25 Shake provides several methods of tracking, stabilizing, and smoothing moving subjects in your scripts. Additional tools are provided to process the keyframed results of these operations, giving you even more detailed control. About Image Tracking Nodes Shake provides four image tracking and stabilization nodes: Tracker, Stabilize, MatchMove, and SmoothCam. • Stabilize: The Stabilize node is used to correct unwanted movement in a shot.
• SmoothCam: This node differs from the others above in that it doesn’t track small groups of pixels. Instead, it evaluates the entire frame, using motion analysis to derive the movement of the camera. Once derived, this node has two modes. It can smooth the shot, eliminating unwanted jitter while maintaining the general motion of the camera. It can also lock the shot, stabilizing a subject within the frame that’s isolated with a mask.
Using referenceBehavior The referenceBehavior parameter controls if and when the reference pattern is ever updated. By default, the reference pattern is set to use the start frame (the first frame at which you start tracking) throughout the entire track, so even the samples within the last frame of the track are compared to the very first frame.
For this reason, most trackers don’t handle significant rotational movement very well— they (Shake’s included) only test for panning changes, not rotational. If they did, they would have to multiply the amount of panning samples by the amount of degrees for the number of samples to take, which would be prohibitively costly at this stage. If you are tracking an object with rotational movement, try using a referenceBehavior set to update every frame.
Stabilize Additions If you are using the Stabilize node, include the following additional steps with the general steps above. 1 Determine if you need one-, two-, or four-point tracking. Note: For two- or four-point tracking, select “2 pt” or “4 pt” in the trackType parameters. In the Stabilize node parameters, set applyTransform to active in order to stabilize the plate. 2 If you are using the Stabilize node for matchmoving, toggle the inverseTransform parameter from stabilize to match.
• Track point: The center crosshairs m To move the tracker: Click a blank area inside of the search region or the track point, then drag. m To resize the tracking region or the reference pattern: Drag a corner and the boxes uniformly scale in the X or Y axes. The larger the search region, the slower the track. m To scale the search region non-uniformly: Drag an edge of the search region. This is good for “leading” the track point. For example, a bus in a clip moves to the right.
Note: For four-point MatchMove and Stabilize operations, the trackers should be positioned in a counterclockwise order, starting in the lower-left corner. This ensures the proper alignment of your element when the transformation is applied. If the reference pattern you are tracking goes offscreen, or becomes obscured by another object, Shake’s default behavior is to stop the tracking analysis. You can use the Offset Track button to reposition the reference pattern in the Viewer.
4 To reset the search area back to the original tracking point, click the Reset Track button. Reset Track button You can turn off a tracker using the controls in the Parameters tab. m To turn off a specific tracker: Click the Visibility button located next to the track name in the Parameters tab. Visibility button All visible trackers are processed when you click the track button, regardless of whether they have previously tracked keys.
Button Description Track Display Click to toggle between track display options: • The left button displays all trackers, curves, and keyframes. • The middle button displays just the trackers and keyframes. • The right button displays just the trackers. You can also control visibility of individual trackers as described below. FG/BG These buttons appear on the Viewer shelf when the MatchMove node is active.
Parameter Description matchSpace The pixels are matched according to the correlation between the selected color space—luminance, hue, or saturation. When an image has roughly the same luminance, but contrasting hues, you should switch to hue-based tracking. You can also adjust the weight of the color channels in the matchSpace subtree. referenceTolerance A tracking correlation of 1 is a perfect score—there is an exact match between the original reference frame and the sampled area.
Parameter Description update if below reference tolerance This updates the reference sample from the previous frame if the correlation is below the referenceTolerance. This basically says, “If I can’t get a good match, then resample.” This is excellent for gradual perspective and scale shifts in the tracking area. failureTolerance If the correlation of a track falls below this value, it initiates the failureBehavior.
Parameter Description trackNCorrelation The correlation value of that key to the original sample. A score of 1 is a perfect score. 0 is a completely unusable score. trackNWindow Parameters These multiple parameters control the windowing of the tracking box, and are not relevant to exported values. Tracking Shortcut Menu Right-click in the text field of a trackName to open a shortcut menu with options for manipulating your tracks.
Picking a Good Reference Pattern The ideal reference pattern is one that doesn’t change perspective, scale, or rotation, and does not move offscreen or become obscured by other objects. The ideal pattern also maintains overall brightness or color, is very high contrast, and is distinct from other patterns in the same neighborhood. Meanwhile, in the real world, we have to contend with all of these factors in our footage.
The following example shows a track marker placed on a TV screen so the client could place an image on the TV. The default tracker reference pattern is unnecessarily large. The only interesting detail is the black cross in the middle. Otherwise, most of the pattern matches up with most of the rest of the image—green. To adjust for this, limit the reference pattern to more closely match the black crosshairs.
Manually Coax Your Track Another technique you can use is to manually insert tracking keyframes. For example, if you have 100 frames to track, you can put in a keyframe every 5 or 10 frames with the Autokey feature. A helpful trick is to set an increment of 5 or 10 in the Time Bar. Press the Left Arrow or Right Arrow to jump by the increment amount.
Increasing Contrast and Preprocessing the Image It is often helpful to apply a Monochrome node to an image, and drop the blue channel out if you have particularly grainy footage. Another good strategy is to activate the preProcess flag in the tracker. This applies a small blur to the footage to reduce irregularities due to video or film grain. In some cases, you may want to modify your images to increase the contrast in the reference pattern, either with a ContrastLum node or ContrastRGB node.
The second strategy is to use the Offset Tracker button (in the Viewer shelf ). When the reference pattern becomes obscured, turning on the Offset Tracker button lets you move the tracking control, picking a new reference pattern and search region in a different area from the original reference pattern. The offset between the original reference pattern and the new one is calculated in order to maintain continuity in the resulting track path.
Use the + and – keys (next to the Delete or Backspace key) to zoom in and out of the clip. The zoom follows the pointer, so place the pointer on the key point in the Viewer and zoom in. Press the Home key (near the Page Up and Page Down keys on your keyboard) or click the Home button in the Viewer shelf to return to normal view. You can also adjust a tracking curve in the Curve Editor.
5 Select Tracker1.track1 and Tracker1.track2 as the first two inputs, respectively, and leave the last two inputs set to none. The following illustration shows Stabilize1 to remind you that any tracking node can be a track source. 6 Click OK. The third track, track3, is in the middle of the first two tracks. This works by creating an expression in both the track3X and track3Y parameters. The expression for the X parameter looks like this: (Tracker1.track2X+Tracker1.
To smooth a track curve: 1 Right-click the track you want to smooth, then choose Smooth Tracks from the shortcut menu. The Smooth Track window appears. 2 Enter a value (or use the slider) in the smoothValue field. The default is 5, which means that 5 track points centered on the currently evaluated point are used to compute the current point’s new, smoothed value. This is a standard Gaussian (bell-curve type) filter.
After the track curve is smoothed: Linking to Tracking Data m m m Referencing track point data works similarly to referencing any other parameter within Shake. The twist here is that since you can rename the track point, you can change the name of the referred parameter. For example, if you have a Tracker node named Tracker1, and a track point set to its default name “track1,” do one of the following: To reference the X track data, use: Tracker1.track1X.
At this point, you have a track and a smoothed version of that track. The following example shows the Y curves of the two tracks. 6 Create a Stabilize node. 7 In the Stabilize node, expand track1, then enter the following expression in the track1X and track1Y parameters: • In track1X, enter: Tracker1.track1X - Tracker1.track2X • In track1Y, enter: Tracker1.track1Y - Tracker1.track2Y Thus, you get only the difference between the two curves—the jitter.
In the applyScale and applyRotate parameters, enable “live” to use the mathematical calculation of the four curves (track1X, track1Y, track2X, and track2Y)—live mode takes the track1 and track2 expressions and creates scale or rotational curves you can view in the Curve Editor. To convert curves into editable data (generate keyframes), click “baked” in the applyScale and applyRotate parameters.
Tracking File Format The following is a sample saved track file for use with the Save Track File or Load Track File command (right-click in the track name text field to access the shortcut menu). TrackName track1 Frame X Y Correlation 1.00 462.000 210.000 1.000 2.00 405.000 192.000 1.000 etc... Note: The Save Track File or Load Track File command is different from the Load Expression command.
Parameters This node displays the following controls in the Parameters tab: applyTransform The foreground element is only transformed if applyTransform is active. trackType You can do one-point, two-point, or four-point matchmoves. Different options appear with the different types. • 1 pt: Pans the foreground element to match the tracking point. You can optionally turn off the X or Y movement.
refFrame The reference frame that is used to calculate the null state of the transformation. For example, scale has a value of 1 and rotate has a value of 0 at the reference frame. outputType A pop-up menu that lets you choose the compositing operation used to combine the foreground element you’re adding to the scene against the background that you’re tracking. Each menu option follows the standard Shake operator of the same name. To pass on a tracked foreground without compositing, select Foreground.
• 1/32: Area is sampled at every .03125 pixels (1024 times more than with a sampling of 1). • 1/64: Area is sampled at every .015625 pixels (4096 times more than with a sampling of 1). tolerances The tolerances subtree contains subparameters that let you control this node’s behaviors when the tracking quality goes down. • matchSpace: The pixels are matched according to the correlation between the selected color space—luminance, hue, or saturation.
• update if above reference tolerance: This option updates the reference sample from the previous frame if the correlation is above the referenceTolerance. The intent is to update every frame unless you know the point is obscured. If you use a predict mode and know there are obstructions, this option keeps the reference area from updating if the point is completely obscured.
trackRange The trackRange parameter is the potential frame range limit of your track. By default, the range is set to the clip range. For Shake-generated elements such as RGrad, it takes a range of 1. You can set new limits using Shake’s standard range description, for example, 10-30x2. If you stop tracking and start again, the process starts from the current frame until it reaches the lower or upper limit of your trackRange, depending on whether you are tracking forward or backward.
inverseTransform Inverts the transformation. Use this to “unstabilize” the shot. For example, you stabilize a shot with a Stabilize, apply compositing operations, and then copy the first Stabilize to the end of the node tree. By inverting the transformation, you return the shot to its former unstable condition. trackType You can do one-point, two-point, or four-point matchmoves. Different options appear with the different types. • 1 pt: Pans the foreground element to match the tracking point.
• shutterOffset: A subparameter of motionBlur. Controls the offset from the current frame that the blur is calculated. Default is 0; previous frames are less than 0. The global shutterOffset parameter is added to this. • aspectRatio: This parameter inherits the current value of the defaultAspect global parameter. If you’re working on a nonsquare pixel or anamorphic image, it is important that this value is set correctly to avoid unwanted distortion in the image.
• matchSpace: The pixels are matched according to the correlation between the selected color space—luminance, hue, or saturation. When an image has roughly the same luminance, but contrasting hues, you should switch to hue-based tracking. You can also adjust the weight of the color channels in the matchSpace subtree. • matchSpace (subtree): Three subparameters with sliders let you weight how closely the tracking operation follows each color channel of the image being tracked.
• failureTolerance: If the correlation value of the tracker’s analysis falls below the value in this field, Shake initiates the failureBehavior. • failureBehavior: A pop-up menu containing the following options: • stop: The tracker stops if the correlation is less than the failureTolerance. You can also press Esc to manually stop tracking.
track1Name, track2Name… The name of the track. To change the name, click in the text field and type a new name. The number of tracks corresponds to the number of points you selected in the trackType parameter. Each trackName parameter contains the following subparameters: • track1X: The actual X value of the keyframed track point at that frame. Use this to link a parameter to a track point. This parameter defaults to the expression width/3.
Parameters This node displays the following controls in the Parameters tab: trackRange The trackRange parameter is the potential frame range limit of your track. By default, the range is set to the clip range. For Shake-generated elements such as RGrad, this parameter takes a range of 1. You can set new limits using Shake’s standard range description, for example, 10-30x2.
• update every frame: The source sample is updated from the previous frame. This usually creates an inherent drift in the track, as tiny errors accumulate. This method is for movements that have drastic changes in perspective and scale. • update from keyframes: If you are using a failureBehavior of “predict location and don’t create keys” or “don’t predict location,” a keyframe is not necessarily saved every frame. In this case, you may only want to update from the last frame with a valid keyframe.
tolerances The tolerances subtree contains subparameters that let you control this node’s behaviors when the tracking quality decreases. matchSpace Not to be confused with the matchSpace parameter above—the matchspace subtree has three subparameters with sliders that let you weight how closely the tracking operation follows each color channel of the image being tracked. In general, the color channels with the most contrast for the feature you’re tracking should be weighted most heavily.
track1BottomSearch: height/2-height/15 track1TopSearch: height/2+height/15 track1CenterX: width/2 track1CenterY: height/2 track1Visible: This parameter is the same as the visibility button that’s immediately to the right of the trackName parameter. • track1Enabled: If trackEnabled is not turned on, that tracker will not be used during the next track analysis. • • • • • Add, Delete, Save, Load These buttons allow you to create and remove additional tracking regions.
Masking Important Features The SmoothCam node has two inputs. The first one is for the input image to be processed. The second input is for an optional matte with which you can isolate a subject or area that you want the SmoothCam node to ignore while performing its analysis. When creating a matte to use with the SmoothCam node, white areas are ignored, and black areas are analyzed.
3 Adjust the translationSmooth, rotationSmooth, and zoomSmooth sliders to increase or decrease the amount of smoothing that is attempted. At 0, no smoothing is attempted in that dimension. At higher values, SmoothCam attempts to smooth a wider range of variations in the movement of the image from one frame to the next. • translationSmooth: Smooths the X and Y motion of the shot. • rotationSmooth: Smooths rotation in the shot. • zoomSmooth: Smooths a zoom within the shot.
Try Editing the Analysis Data If neither of the prior solutions helps, try loading the confidence parameter into the Curve Editor, then look for frames where the confidence parameter falls to 0. If the image transformation at these frames stands out, you can try loading the translationX, translationY, rotation, and/or zoom parameters within the motion subtree into the Curve Editor, then delete any keyframes that create unusual spikes at those frames.
in This option maintains the frame size of the input image as that of the output image. The result is a moving black area that encroaches around the edges of the output image. Union Intersection In You can use one of the above three clipMode options to produce the output image most useful for your purposes. Note: Whichever clipMode you use, areas of the image that end up being clipped are preserved by Shake’s Infinite Workspace, available for future operations.
Parameters in the SmoothCam Node This node displays the following controls in the Parameters tab: analysisRange The range of frames of the input image to analyze. By default, this parameter inherits the number of frames in the source media file represented by the FileIn node to which it’s connected, not the timeRange in the Globals tab. processedRange This is not a user-editable parameter. It indicates the overall frame range that has been analyzed.
• in: Maintains the frame size of the input image as that of the output image. The result is a moving black area that encroaches around the edges of the output image. steadyMode The SmoothCam node has two modes: Smooth and Lock. • Smooth: This mode smooths the apparent motion of the camera, while allowing the general movement in the frame to proceed. It’s useful for removing jitter from a camera movement. When enabled, this mode has three sliders for each of the dimensions that can be smoothed.
• zoomLock: Locks an image that is being zoomed. Note: Don’t turn on zoomLock unless you’re absolutely positive that the image is being dynamically zoomed. • perspectiveLock: Locks an image experiencing a change in perspective, similar to a reverse corner-pin. Motion The values within the parameters in the motion subtree are not meant to be editable, or even directly intelligible.
26 Transformations, Motion Blur, and AutoAlign 26 Shake’s transformation nodes provide many ways to geometrically manipulate the position, size, and orientation of images in your composition. The parameters within these nodes can also be animated— either manually or using expressions—to create motion and accompanying motion-blur effects. About Transformations Shake has a wide variety of nodes that can be used to create various kinds of transformations.
Concatenation of Transformations Many of the transform nodes concatenate, similar to the way color-correction nodes concatenate. Like color corrections, compatible transform nodes that are connected to one another are concatenated so that each operation is collapsed into a single calculation, optimizing both processing time and image quality. You can tell which transform nodes concatenate by the letter “C” in the upper-left corner of the icon in the Transform tab.
For example, you cannot apply a Rotate node, an Over node, a Blur node, and then a Move2D node and have the Rotate and the Move2D concatenate. Instead, it’s best to make sure that the Rotate and Move2D nodes are placed together in the node tree. In many cases, a simple change like this results in dramatic improvements in the speed and quality of your images.
Inverting Transformations The Move2D and CornerPin nodes have an inverseTransform parameter. This aptly named parameter inverts the effect of the transformation, numerically. For example, a pan of 100 with inverseTransform activated becomes a pan of -100. The parameters themselves are not changed, just their effects on the composition. In the case of Move2D, you can use inverseTransform to turn imported tracking data into stabilization data.
Accelerating Viewer Interactivity There are two fast ways you can speed up Shake’s performance when using onscreen transform controls to perform transformations: To quickly scrub through an animation, set the Update mode (located in the upperright corner of the interface) to “release” then move the playhead. To select release from the Update mode list, click and hold the button labeled, “manual” or “always,” then select “release.
The following table shows the common onscreen control buttons. Button 768 Description Onscreen Controls– Show Displays the onscreen controls. Click to toggle between Show and Hide mode. Onscreen Controls– Show on Release Hides onscreen controls while you modify an image. To access this mode, click and hold the Onscreen Controls button, then choose this button from the pop-up menu, or right-click the Onscreen Controls button, then choose this option from the shortcut menu.
Button Description Path Display–Keyframe Displays only the keyframe positions in the Viewer. To access this mode, click and hold the Path Display button, then choose this button from the pop-up menu. Path Display–Hide The motion path and keyframes are not displayed in the Viewer. To access this mode, click and hold the Path Display button, then choose this button from the pop-up menu. Transform Controls The most commonly used transform node is Move2D.
Drag the center control to move the point about which scaling is performed, affecting the xCenter and yCenter parameters. There is an additional method you can use to scale images in the Viewer. To scale an image in the Viewer without using the scale handles: 1 Select an image. 2 With the pointer positioned over the Viewer, press E or I. 3 When the dimension pointer appears, drag in the direction you want to scale the image. The colors in the dimension pointer correspond to the pan controls.
Rotate Drag the blue rotate control to rotate the image about the center point, affecting the angle parameter. Drag the white center control to move the center point itself, affecting the xCenter and yCenter parameters. To rotate an image without positioning the pointer directly over it, press W or O, then drag in the Viewer. The dimension pointer appears, allowing you to to rotate the image in any direction.
After an image is rotated with the Move2D node, the horizontal and vertical panning controls (arrowheads) lock movement to the new orientation of the image. Move3D Similar to the Move2D node, the Move3D node adds three colored dimensional angle controls to control xAngle (red), yAngle (green), and zAngle (blue) parameters. This lets you simulate 3D transformations with 2D images.
Crop This onscreen transform control, available in the Crop node, lets you drag any corner to crop two sides of an image at once. Drag any outside edge to crop that edge by itself. This affects the cropLeft, cropBottom, cropRight, and cropTop parameters. Drag the crosshairs at the center to move the entire crop box (simultaneously affecting all four crop parameters), while the image remains in place.
Onscreen Controls Across Multiple Transformations If you apply multiple transformations to an image, all downstream onscreen controls are transformed along with the image. This lets you accurately visualize that control’s effect on the image. Note: This is also true for the onscreen controls of other nodes, like the RGrad and Text nodes. In the following example, an RGrad node is connected to a CornerPin node. The CornerPin node is used to place the RGrad in perspective.
In this example, the CornerPin node is composited over the original RGrad node. As shown in the above image, manipulating the RGrad1 node while viewing the Over1 node results in the display of multiple controls. Changes made with one control modify both. To break this link, copy the original RGrad node and connect it to the new node. Important: The MatchMove node is the only exception to this behavior. For nodes above the MatchMove node, the onscreen controls appear without transformation.
Node Changes Resolution Changes Pixel Scale Breaks Infinite Workspace Changes Relative Aspect Ratio SetDOD No No Yes No Resize Yes Yes No Yes Fit Yes Yes Yes No Zoom Yes Yes No Yes Node Example Example Parameters Notes (No node) Resolution = 100 x 100 pixels The unmodified image Scale, Move2D xScale = .5 yScale = .5 Scale is a subset of the Move2D function. There is no processing speed increase when using Scale instead of Move2D. Scale, Move2D xScale = 1.
Node Example Parameters Notes Window Example -33, -33, 166, 166 Window is identical to Crop, except that you specify the output resolution in the third and fourth parameters. Window 33, 33, 34, 34 ViewPort 33, 33, 67, 67 ViewPort is identical to Crop, except that it does not cut off the Infinite Workspace, and is therefore primarily used to set a resolution. SetDOD 33, 33, 67, 67 Used to limit the calculation area of the node tree to within the DOD; considerably speeds up renders.
Creating Motion Blur in Shake Motion blur can be applied to any animated transformation. Each transform node has its own motion blur settings, so you can fine-tune each node’s effect individually. There is also a global set of motion blur parameters that adjusts or replaces the existing values, depending on the parameter. Note: You can also use the global motion blur parameter to temporarily turn motion blur off.
In the following example, two elements are composited together to simulate a car moving forward with spinning wheels: an image of a car body and a single graphic representing the wheel graphic. The wheel graphic is used twice, once for the back wheel and once for the front wheel. The colored dots on the wheels will illustrate the improper and proper arrangements of nodes necessary to produce realistic motion blur for this simulation.
The result is inaccurate when motion blur is applied. This is because the SpinWheel node applies the blur for the turning wheel, and then three nodes later, the MoveCar node applies the blur to the already-blurred wheels. Instead of the individual paths of the color dots on the wheels, the result is a horizontal smear. The following image shows the WheelsOverCar node immediately before the entire car is panned.
Note: To create a cloned node, copy the node (press Command-C or Control-C) and clone the node using the Paste Linked command in the Node View shortcut menu (or press Command-Shift-V or Control-Shift-V). Because the SpinWheel and MoveCar1 nodes are transformations, these nodes concatenate. The SpinWheel, PositionFrontWheel, and MoveCar2 nodes also concatenate. The result is three transformations, the same amount as the previous tree, but with an accurate blur on the wheels.
The following example uses a previously rendered a clip of a swinging pendulum. To add blur to a non-animated object with the useReference parameter: 1 Locate the center of rotation for the pendulum, then type the center values in the Move2D center field. 2 Approximate the rotation, then animate the angle to match the rotation. In this example, the angle is -40 at frame 5 and 40 at frame 24. 3 Type the expression “time” into the referenceFrame value field (in the useReference subtree).
The element remains static, but the blur is still applied as if it were moving. Frame 5 Frame 12 Frame 24 For a lesson on this subject, see Tutorial 4, “Working With Expressions,” in the Shake 4 Tutorials book. The AutoAlign Node The AutoAlign node is unique among the various transform nodes in that it can take multiple image inputs and combine them into a single output, similar to a layering node.
Unlike similar photographic tools, the AutoAlign node works with both stills and image sequences. As a result, you could film three side-by-side shots of an expanse of action, and later turn these into a single, extremely wide-angle background plate. Similarly, you can set a single still image to align with the same image features in a second shot with camera motion.
As you can see in the above example, the resulting image may have an irregular border, depending on the amount and position of overlap, and the warping required to achieve alignment. If necessary, the border can be straightened with a Crop node. Aligning Overlapping Images You can also use this node to align two images that almost completely overlap. An obvious use of this is to align an image with something in the frame that you want to remove with a second “clean plate” image.
Using the AutoAlign node to align the second image with the first, you can quickly match the clean plate still to the moving image sequence, and then output the newly aligned and animated clean plate for use by a paint or rotoscoping operation to paint out the safety line. AutoAlign Limitations Successful use of the AutoAlign node is highly dependent on the content of the input images, and results will vary widely from shot to shot.
AutoAlign Image Requirements Although the AutoAlign node is a very flexible tool, it produces the best results with material that is produced with this node in mind. • There should be at least a 15-to-20-percent overlap between any two images for the AutoAlign node to work properly (the amount that’s necessary may vary depending on the image).
If you’re not satisfied with the result later in the operation, change the mode to robust and re-analyze the images. 6 Click the “analyze” button. Shake steps through each frame in the image sequences and analyzes each set of aligned images at every frame in the designated analysisRange. Note: The analysis can be interrupted at any time by pressing Esc.
The order in which they are connected is not important. 2 Use the clipLayer and lockedPlate pop-up menus to choose the input to which the clean plate image is connected. In this example, you’ll be choosing Input1. Leave the mode at the default setting of Precise. 3 Set the analysisRange to the number of frames you want to align. This parameter defaults to the maximum number of frames within the longest image sequence that’s connected to the AutoAlign node. 4 Click “analyze.
5 Once the analysis has concluded, changing blendMode to mix and scrubbing through the Time Bar shows you how well the resulting alignment works. The Mix setting, in the case of two images that almost completely overlap, results in an a 50 percent blend of both images. In the above image, the ripples in the snow appear to align perfectly.
7 The auto-aligned clean plate can now be used in paint or rotoscoping operations to remove unwanted rigging from the actor in the mountaineer shot. For example, you can connect the original Mountaineer image to the first input of a QuickPaint node, and the output from the AutoAlign node to the second input. 8 With this setup, you can use the Reveal Brush to paint out the rigging against the backdrop of the clean plate.
AutoAlign Parameters The AutoAlign node displays the following controls in the Parameters tab: analyze Click this button to perform the analysis that is the first step in aligning two or three images. This analysis creates a preprocessed data set that is used to perform the actual alignment. Images only have to be analyzed once, and the resulting transform data is stored inside the Shake script.
• 0.5: Indicates an uncertain analysis. Despite the uncertainty, Shake has generated a keyframe at these frames. • 0: Indicates that Shake has no confidence in the analysis. No keyframe has been generated at these frames. • mMatrix, nMatrix: These parameters contain the data accumulated by clicking the “analyze” button. mode Two options—precise and robust—let you change the method used to perform the analysis. In general, set this mode to precise the first time you analyze the input images.
Note: If necessary, you can preprocess images connected to the AutoAlign node with other color-correction nodes to even out differences in gamma and contrast that aren’t addressed by the matchIllum parameter. The Transform Nodes In addition to the AutoAlign node, Shake features numerous other transform nodes. The following section includes information on the transform nodes, which are located in the Transform Tool tab.
seed When Shake generates a random pattern of values, you need to make sure for purposes of compositing that you can recreate the same random pattern a second time. In other words, you want to be able to create different random patterns, evaluating each one until you find the one that works best, but then you don’t want that particular random pattern to change again. Shake uses the seed value as the basis for generating a random value.
Parameters This node displays the following controls in the Parameters tab: x0, y0, x1, y1, x2, y2, x3, y3 Eight parameters controlling the position of each corner in the corner-pin operation. xFilter, yFilter A pop-up menu that lets you pick which method Shake uses to transform the image. For more information, see “Filters Within Transform Nodes” on page 862. inverseTransform A button that inverts the transform.
Flop The Flop node flops the image left and right. Unlike the Flip node, this does not buffer the image into memory. You can also use the Scale or Move2D node to invert the image by setting the yScale value to -1. There are no parameters for the Flop node. MatchMove For information on the MatchMove node, see “MatchMove” on page 740. Move2D The Move2D node combines many of the other transform nodes, including Pan, Scale, Shear, and Rotate.
Note: Entering a negative value into the xScale or yScale numeric field reverses the image along that axis. xShear, yShear These parameters let you shear the image horizontally and vertically. The sliders let you adjust the shearing of the image anywhere between 0 and 1 (1 creates 45 degrees of shearing), but you can enter any value you want into the numeric field. xCenter, yCenter These parameters let you move the horizontal and vertical position of the center point around which all transformations occur.
useReference Applies the transform to the image or doesn’t. If it doesn’t, and you have animated values, useReference applies a motion blur to the image, but does not actually move it. This is good for adding blur to plates. See below for an example. • 0 = Move image • 1 = Smear-mode; image is not moved • referenceFrame: A subparameter of useReference used for image stabilization. By default, this parameter is set to “time,” that is, in reference to itself.
xScale, yScale, zScale These parameters let you change the scale of the image along any axis. By default, the yScale parameter is locked to the xScale parameter. The sliders let you adjust the scale of the image from 0 to 4 times the current size, but you can enter any value into the numeric field. Note: Entering a negative value into the xScale, yScale, or zScale numeric field reverses the image along that axis.
• shutterTiming: A subparameter of motionBlur used to specify shutter length. 0 is no blur, whereas 1 represents a whole frame of blur. Note that standard camera blur is 180 degrees, or a value of .5. This value is multiplied by the global shutterTiming parameter. • shutterOffset: A subparameter of motionBlur representing the offset from the current frame at which the blur is calculated. Default is 0; previous frames are less than 0. useReference Applies the transform to the image or doesn’t.
Pan The Pan node pans the image with subpixel precision. To wrap an image around the frame (for example, anything that moves off the right edge of the frame reappears on the left), use the Scroll node. Parameters This node displays the following controls in the Parameters tab: xPan, yPan These values let you move the image horizontally and vertically. 0, 0 represents the center of the frame, and the xPan and yPan sliders allow adjustments up to plus or minus the total width and height of the image frame.
motionBlur Motion Blur quality level. 0 is no blur, whereas 1 represents standard filtering. For more speed, use less than 1. This value is multiplied by the global motionBlur parameter. • shutterTiming: A subparameter of motionBlur used to specify shutter length. 0 is no blur, whereas 1 represents a whole frame of blur. Note that standard camera blur is 180 degrees, or a value of .5. This value is multiplied by the global shutterTiming parameter.
• shutterTiming: A subparameter of motionBlur used to specify shutter length. 0 is no blur, whereas 1 represents a whole frame of blur. Note that standard camera blur is 180 degrees, or a value of .5. This value is multiplied by the global shutterTiming parameter. • shutterOffset: A subparameter of motionBlur representing the offset from the current frame at which the blur is calculated. Default is 0; previous frames are less than 0.
Parameters This node displays the following controls in the Parameters tab: left, right, bottom, top As their names imply, these parameters let you set the outer boundaries of the DOD. For more information, see “The Domain of Definition (DOD)” on page 82. Shear The Shear node skews the image left and right, or up and down. Motion blur can also be applied.
27 Warping and Morphing Images 27 Shake provides powerful warping and morphing tools that are flexible enough to use for a wide variety of compositing tasks, from creating or correcting lens distortions, to morphing one subject into another. About Warps Shake’s various linear transformation nodes, such as Move2D, Move3D, Rotate, and Scale, operate on entire images so that each pixel is moved, rotated, or scaled by the same amount.
Parameters This node displays the following controls in the Parameters tab: overSampling The actual number of samples per pixel equals this number squared. For better antialiasing, increase the number in the value field. xExpr, yExpr The expression for where the pixel information is pulled. Expressions of x and y return the same image. Expressions of x+5, y+5 pull the color from the pixel five units up and to the right of the current pixel.
The following image is a checkerboard warped with a QuickShape node. Because the shape is black and white, with little gray, it is difficult to make out the distortion in the checkerboard. As the following image demonstrates, it is often a good idea to insert a blur between a high-contrast distortion image and the IDisplace node.
This technique combines well with the Relief macro in the “Cookbook” chapter of this manual. Parameters This node displays the following controls in the Parameters tab: xScale, yScale The number of pixels that the foreground image is offset by the background image. xDOffset, yDOffset A panning factor applied to the image. Intensity is usually 0 to 1; 1 is 100 percent of the x/yScale factor. xChannel, yChannel The channel from the background image that is used to distort the foreground image.
LensWarp This node lets you make subtle or large adjustments to an image to either correct for, or simulate, different types of film and video lenses. As a corrective measure, you can use this node to remove barrel distortion in an image. You can also use this node to simulate the lens used in one image, in order to warp another image you’re compositing over it so that they appear to have been shot using the same lens. This node affords more appropriate control over the result than the PinCushion node.
To finish drawing an open shape, double-click to draw the last point and end the shape. Note: The LensWarp node does not use Bezier curves. 3 If you’re correcting an image sequence, scrub through the frame range to find more curved features, then trace these as well. The more features you identify in different areas of the frame, the more accurate the final result will be. 4 When you’re finished, click the “analyze” button in the LensWarp parameters to calculate the result.
Button Description Delete Control Point Select a point and click this button to remove it from the shape. Enable/Disable Lets you show or hide the transform control at the center of Shape Transform each shape. Hiding these controls will prevent you from Control accidentally transforming shapes while making adjustments to control points.
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.
Shake uses the seed value as the basis for generating a random value. Using the same seed value results in the same random value being generated, so that your image doesn’t change every time you re-render. Use a single value for a static result, or use the expression “time” to create a pattern of random values that changes over time. For more information on using random numbers in expressions, see “Reference Tables for Functions, Variables, and Expressions” on page 941.
Shake uses the seed value as the basis for generating a random value. Using the same seed value results in the same random value being generated, so that your image doesn’t change every time you re-render. Use a single value for a static result, or use the expression “time” to create a pattern of random values that changes over time. For more information on using random numbers in expressions, see “Reference Tables for Functions, Variables, and Expressions” on page 941.
The following examples are on a grid. By modifying x and y, you specify from what pixel the information is pulled. For example, x+5, y+5 shifts the image left and down by 5 pixels.
Expr Value xExpr float xc=(x-width/2); float yc=(y-height/2); float r=sqrt(xc*xc+yc*yc); float newr=r*sin(r/100); width/2+ newr*xc/r yExpr float xc=(x-width/2); float yc=(y-height/2); float r=sqrt(xc*xc+yc*yc); float newr=r*sin(r/100); height/2+ newr*yc/r Expr Value xExpr ((x/width-0.5)*sin(3.141592654*y/height)+0.
Expr Value xExpr float xc=(x-width/2); float yc=(y-height/2); float r=sqrt(xc*xc+yc*yc); float a=atan2(yc,xc); float newA= a+3.141592654/2*r/200; width/2+r*cos(newA) yExpr float xc=(x-width/2); float yc=(y-height/2); float r=sqrt(xc*xc+yc*yc); float a=atan2(yc,xc); float newA= a+3.
Expr Value xExpr float xc=(x-width/2); float yc=(y-height/2); float r=sqrt(xc*xc+yc*yc); float a=atan2d(yc,xc); float newA= a+((int)a)%8-4; width/2+r*cosd(newA) yExpr float xc=(x-width/2); float yc=(y-height/2); float r=sqrt(xc*xc+yc*yc); float a=atan2d(yc,xc); float newA= a+((int)a)%8-4; width/2+r*sind(newA) Expr Value xExpr float xc=(x-width/2); float yc=(y-height/2); float r=sqrt(xc*xc+yc*yc); float newr=r*r/200; width/2+ newr*xc/r yExpr float xc=(x-width/2); float yc=(y-height/2); float
Parameters This node displays the following controls in the Parameters tab: overSampling The actual number of samples per pixel equals this number squared. For better antialiasing, increase the number. xExpr, yExpr The expression to be placed. See above for examples. xDelta, yDelta Sets the maximum distance that any pixel is expected to move, but doesn’t actually move it. A given pixel in an image may be affected by any pixel with the Delta distance.
Using this formula yields the following memory usage table: Number of Threads 2K Image Calculation 4K Image Calculation 8K Image Calculation 1 49MB 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 renderControls subtree of the Globals tab) to 1. This reduces the memory requirements for this operation.
The following example shows multiple instances of these same basic shapes employed to create a more complex effect—that of lava within a still image flowing forward. Boundary shape Source shape Target shape Connection line • Source Shapes: These are shapes you draw that conform to the subject of the source image you want to deform.
• 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 either the overallDisplacement parameter, or that shape’s Displacement parameter if it is being animated independently. These shapes 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.
In some instances, you can create a more convincing effect using multiple source/ target shape pairs. In the following example, four source/target shape pairs are used to create the effect of the lava flowing forward. Multi-shape warp with OverallDisplacement at 0 Multi-shape warp with OverallDisplacement at 1 In this example, a single large shape is used to pull the entire outside shape of the lava forward.
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.
Connection lines can be moved, and even animated, to control the speed and direction of deformation. Additional connection 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 nodes both work by pushing and pulling pixels from the region of an image defined by the source shapes to the region defined by the target shapes.
It’s important to understand that boundary shapes don’t eliminate distortion from the surrounding image; they minimize it. Warp with boundary shape 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. Important: Target shapes should never cross boundary shapes. Doing so may create unwanted distortion, possibly tearing in the resulting image.
For example, if you want to isolate a warping operation to a particular region, you can create a closed boundary shape to lock off just that area. 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 open boundary shapes to “pin down” specific areas of an image that you don’t want to be affected by a warping effect.
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, and so on. If necessary, you can refer to the RotoShape documentation for more information on creating and modifying shapes. Warper and Morpher Viewer Shelf Controls When a Warper or Morpher node is selected, the following buttons appear in the Viewer shelf.
Button Description Spline/Linear Mode Toggles selected to act as either corner points or Bezier points. Delete Control Point Deletes selected points on a shape. Key Current Shape/ Key All Shapes Toggles between two shape keyframing modes. In All Shapes, all shapes are keyframed whenever any one shape is modified with Autokey on. In Current Shape, only the selected shape is keyframed when Autokey is on.
Button Description Lock Shapes 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 Shape Lock buttons in the Viewer shelf supersede the Lock buttons in the Parameters tab.
If necessary, zoom into the image in the Viewer to better trace the necessary features of the subject you want to warp or morph. 4 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, drag to one side of the point until the angled point becomes a curve. Added point Drag to create a Bezier point.
Important: 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 Parameters 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.
• Hold the Shift key down and drag to add points to a selection. • Hold the Command or Control key down, then drag to remove points from the selection. • Move the pointer over the edge, or the transform control, of a shape, and press Control-A or Command-A to select every point on that shape. 4 When the selected points are highlighted, 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 change a curve by editing a point’s tangent handles: 1 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). 2 Make sure the Lock/Unlock Tangents button is set to Unlock. 3 Do one of the following: • To change the length of one of the tangent handles independently from the other, while keeping the angle of both handles locked relative to each other, drag a handle to lengthen or shorten it.
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: 1 Make sure that Enable/Disable Shape Transform Control is turned on.
• Drag the X handle to resize the shape horizontally, or drag the Y handle to resize the shape vertically. Scale height (y) handle Scale width (x) handle • Drag the rotate handle to rotate the shape about the axis of the transform control. Rotate handle Showing and Hiding Shapes Individual shapes may be hidden, if necessary, to help you isolate one or more shapes when making adjustments. Hiding shapes simply makes them invisible.
m m 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 that corresponds to the shape you want to show or hide. Shapes that are checked are shown, while shapes that are unchecked are hidden. In the Parameters tab, click the Visibility button of the shape parameter that corresponds to the shape you want to show or hide.
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. Important: 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 soft edges are not used.
After the shapes are connected, the source shape appears with a light blue path, and the target shape appears with a dark blue path, indicating 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.
3 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: 1 Click the Edit Connections button. 2 Shift-click either a source or target shape at the location where you want a new connection line to be created.
You can also lock individual source and target shapes using the lock button to the left of each shape parameter in that node’s Parameters tab. However, the Lock Shapes buttons in the Viewer shelf always supersede these individual shape-locking parameter controls. See “Parameters in the Warper Node” on page 846 for more information.
Shape Colors By default, the paths of source shapes are light blue; paths of target shapes are dark blue; paths of connection lines are purple; paths of boundary shapes are orange; and paths of unassigned shapes are yellow. These colors can all be changed using the following parameters in the shapeColors section of the colors subtree in the Globals tab.
rotoTransformIncrement This parameter allows you to 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.
Parameters in the Warper Node A simple example of a Warper node used to warp an image with a single pair of source/ target shapes would appear with the following parameters. (For Warper nodes with more source/target shape pairs defined, there will be more shapeName and connectionName parameters listed.
addBorderShape A button that allows you to use the border of the image as a control shape to limit the warping effect. By default this parameter is turned on, and is the recommended 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.
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: 1 Attach the Warper node to an image. 2 First, draw and, if necessary, animate your source shapes (see “Drawing New Shapes” on page 832). These shapes define the parts of the subject you want to warp.
Next, you need to create a corresponding target shape for each source shape you created. Target shapes define the contour of deformation to which pixels identified by each source shape are moved. 4 Create target shapes using the same shape-drawing techniques used in step 2. Note: 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.
After this second click, the source/target shape pair is defined, the shape colors change, and a connectionName parameter appears in the Parameters tab. Because the overallDisplacement parameter defaults to 1, the effect is immediately seen (see “Connecting Source and Target Shapes” on page 840). 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.
In this example, the connection lines are straightened in the eyes (see “Modifying Connection Lines” on page 841). Final adjusted source/target shape pairs with modified connection points 8 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.
Note: In addition to viewing the actual warp effect, you can view the position of the displacement targets, as defined by the overallDisplacement and connectionDisplacement parameters, by turning on the Displaced Target Shape Visibility button in the Viewer shelf. 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. Pink displaced target shapes indicate the value of the displacement parameters.
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, you 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. 11 Right-click the shape you just created, then choose Set as Boundary Shape from the shortcut menu.
You can also individually animate the displacement caused by each source/target shape pair you’ve defined. To do so, open the connectionName subtree to reveal the connectionDisplacement parameter. Animating specific parameters can create a more organic-looking effect. Before After Using the Morpher Node The Morpher node blends two images together to create the effect of one subject changing shape to turn into another.
Because 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. Additional Controls and Parameters in the Morpher Node Most of the Morpher node’s controls are identical to those of the Warper.
How to Morph Two Images 1 In the Node View, attach a Morpher node to two images. This example creates the effect of the man’s face turning into that of the woman. The image of the man is the source, connected to the morpher1.Source input. The transformed image of the woman is connected to morpher1.Target input. Source image Target image If the images need to be manipulated to make them line up, do this first.
If it is necessary to isolate the subject of the source and target images, you may want to insert RotoShape or keying nodes prior to the Morpher node. 3 Move the Time Bar playhead to the first frame of the clip where you want the morph effect to take place, then choose Source Image from the Select Display Image popup menu. 4 Click the Add Shapes button in the Viewer shelf, then draw shapes as necessary to match the features of the subject. If necessary, animate your shapes to follow the animation.
6 To create a set of target shapes to connect to the source shapes you created in step 4, do one of the following: • The easiest method is to right-click each source shape, then choose Duplicate and Connect from the shortcut menu (or press Control-D or Command-D).
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 rightclicking in the Viewer, then choosing Shape Visibility > Hide All Shapes from the shortcut menu.
To add a new keyframe, move the playhead to a frame where you want to make an adjustment, click the Autokey button for the overallDisplacement parameter in the Parameters tab, then 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 between the source and target images, and a value of 1 results in the end of the morph—the final target image.
28 Filters 28 The filter nodes in Shake not only enable simple image manipulation—they also provide numerous ways to modify alpha channel data, allowing you to create useful images for masking functions. About Filters While color corrections change the value of an individual pixel according to a mathematical equation (for example, *2, -.5, and so on), filters calculate the new value of a pixel by examining its neighbors, and passing it through what is called a spatial filter.
The result—is merely a blend between sharp and blurred elements—is not very compelling. (Note that the Ramp node has a default alpha value of 1 for both ends; you should change the alpha1 value to 0.) To get a better result, use the dedicated IBlur node instead, with the Ramp node as the second input image, rather than a mask input. Filters Within Transform Nodes Filter operations aren’t limited simply to blurs, emboss effects, and other convolution operations assigned to filter nodes.
To further maximize the quality of transforms, some nodes in Shake (such as CornerPin) let you use separate filter operations for horizontal and vertical transforms. Keep in mind that the default filter option uses mitchell for scaling up, and sinc for scaling down. Applying Separate Filters to X and Y Dimensions If a node does not already have separate filtering options for X and Y transforms (such as the Resize node), you can set up independent filtering for each dimension in two steps.
The Filter Nodes The following sections describe each filter node, and include parameters, defaults, and examples. ApplyFilter The ApplyFilter node applies a blur effect like the Blur node, but additionally allows you to choose separate filters for the X and Y dimensions. You can then scale the default base range (in pixels) of the predefined filters. For instance, if the default number of pixels sampled on either side of the base pixel is 3 pixels, an xScale of 2 increases that range to 6 pixels.
Shake’s Blur is one of the few nodes that can deactivate the Infinite Workspace —its “spread” parameter gives you the choice of blurring pixels inside or outside of the image boundaries. If your final image appears clipped and you aren’t sure why (for example, you haven’t applied any Crop commands), go back and check the Blur node spread parameter. Toggle the spread parameters to Outside Frame (1), and the clipping should disappear.
• • • • sobelH: horizontal embossing sobelV: veritcal embossing BabuV: another vertical edge detection BabuH: another horizontal edge detection You can use these convolution matrixes as is, or as models to create your own matrixes. Creating Custom Convolution Kernels Convolution kernels consist of properly formatted data, which is used by the Convolve node to produce the desired image processing effect. This data is included by default in the include/nreal.
Parameters This node displays the following controls in the Parameters tab: channels Lets you set which channels Shake should blur. You can choose one or all of the red, green, blue, or alpha channels. The default is “rgba.” kernel A pop-up menu that allows you to select any of the kernels included in the include/ nreal.h file, or wherever else you may have added convolution kernels of your own. percent A slider that lets you mix the modified image and the original image together to produce a blend of both.
Defocus The Defocus blur node is a more accurate model of the blurring that occurs through an out-of-focus real-world camera lens. It flares out the high points, resulting in a circular, hexagonal, or octagonal shape around the highlights.
percent A slider that lets you mix the modified image and the original image together to produce a blend of both. By default, this parameter is set to 100 percent, resulting in 100 percent of the modified image being output. shape A pop-up menu that lets you choose the shape of the flaring in the resulting image. The fast modes give you low quality but process quickly. The circle, square, hexagon, and octagon give you a superior look, but are significantly more processor-intensive to render.
Parameters This node displays the following controls in the Parameters tab: channels Lets you set which channels Shake should blur. You can choose one or all of the red, green, blue, or alpha channels. The default is “rgba.” xPixels, yPixels The number of pixels added (dilate) or taken from (erode) an edge. Positive values add to the edge; negative values eat away at the edge. borders This parameter determines whether Shake considers or ignores the border pixels at the edge of the image.
directionFilter Enables an effect similar to Emboss. directionFilterangle This parameter changes the lighting angle when the directionFilter parameter is turned on. despeckle Similar to a median filter, this parameter removes isolated pixels up to the despeckle radius (in pixels), and can be useful for eliminating noise from the resulting image. xBlur, yBlur Blurs the resulting image after the edge detection has been performed. By default, the yBlur parameter is linked to the xBlur.
Emboss With the Emboss node, you control the gain and light direction to simulate a raised texture over an image. Note: The Emboss node converts your image to a BWA image (since there is no color information). If you use extreme gain, you may start to see terracing on your image. To correct this, insert a Bytes node before the Emboss node, and boost your image to 2 bytes per channel. You can get interesting patterns with a Bytes node set to 2 bytes, followed by a Blur node, and then the Emboss node.
4 Ensure that the FilmGrain parameters are still active. 5 In the Viewer, drag to create boxes in the areas you want to sample. Note: The sampled areas should be very flat without detail that may disrupt the grain analysis. Small elements are perceived as grain detail, so the best sample areas are featureless walls, exposure cards, and so on. You can sample as many areas as you want. 6 To undo a sample, do one of the following: • To undo a box drawing, click the Undo Last Region button in the Viewer shelf.
Shake uses the seed value as the basis for generating a random value. Using the same seed value results in the same random value being generated, so that your image doesn’t change every time you re-render. Use a single value for a static result, or use the expression “time” to create a pattern of random values that changes over time. For more information on using random numbers in expressions, see “Reference Tables for Functions, Variables, and Expressions” on page 941.
filmResponse Determines the extent to which the grain inherits its color from the input image instead of simply black and white. Progressively higher positive values result in the grain matching the color of the input image more closely. Progressively higher negative values result in the color of the grain becoming somewhat muted. This parameter defaults to 0. The rFilmResponse, gFilmResponse, and bFilmResponse subparameters let you customize the filmResponse of each individual color channel.
seed The random seed for the grain. When Shake generates a random pattern of values, you need to make sure for purposes of compositing that you can recreate the same random pattern a second time. In other words, you want to be able to create different random patterns, evaluating each one until you find the one that works best, but then you don’t want that particular random pattern to change again. Shake uses the seed value as the basis for generating a random value.
Grain Example In the following example, the first node tree consists of a Ramp node and a PlotScanline node. The PlotScanline node is added to analyze the image. Because the ramp is black to white, a linear line appears in the plot scanline from left to right when no grain is applied. When a Grain node is inserted between the Ramp node and the PlotScanline node, noise is introduced that disturbs the line. There is more noise (grain) near the lower, dark area of the plot scanline.
The next image is the result of increasing the lGain (or rGain, gGain, and bGain on a per-channel basis), and increasing the range of the grain. This results in making the diagonal line both lighter and darker simultaneously. The following two images show the result of modifying the Bias and Gain. In the first image, the rBias is lowered (looking only at the red channel) to -.5. The grain shifts downward from the diagonal line, making it darker.
IBlur The IBlur node blurs the image, with the amount of blur set by a second control image. Maximum blur occurs in the white areas of the second image, and no blur occurs in the black areas. In the following example, the first node tree uses a Ramp that is approximately one-half of the height of the image as a mask for a blur. Some bad blending occurs in the lower portion of the image.
Parameters This node displays the following controls in the Parameters tab: xPixels, yPixels The amount of blur as described in pixels, for example, 200 blurs 200 pixels to either side of the current pixel. By default, yPixels is linked to xPixels. spread Tells Shake whether or not to consider areas outside of the frame. A button to the right of the parameter name lets you set the mode. • 0 = Compute “In Frame Only.” • 1 = Compute “Outside Frame.
channels Lets you set which channels Shake should blur. You can choose one or all of the red, green, blue, or alpha channels. The default is “rgba.” percent A slider that lets you mix the modified image and the original image together to produce a blend of both. By default, this parameter is set to 100 percent, resulting in 100 percent of the modified image being output. shape A pop-up menu that lets you choose the shape of the flaring in the resulting image.
invert Inverts the controlChannel. IDilateErode The IDilateErode node isolates each channel and cuts or adds pixels to the edge of that channel. For example, to chew into your mask, set your channels to “a,” and then set the xPixels and yPixels values to -1. By default, you work on whole pixels. To switch to subpixel chewing, enable “soften.” Note that the soften parameter really slows the node. If you use the soften feature, use low values for xPixels and yPixels.
controlChannel The channel of the controlling image to use to control the amount of the effect. invert Inverts the controlChannel. IRBlur The IRBlur node is an image-based version of the RBlur node, using the alpha mask of a second image (by default) to control the amount of radial blurring on an image. This is useful for faking motion blur effects. In this example, the foreground objects (cubes) are rendered on a beach in a 3D software package with the depth information.
blurQuality The amount of samples. A quality of 1, the maximum, is 64 samples. mirror Considers points beyond the center area if your amplitude is high enough when enabled. steps The number of steps. The intensity of the control image is divided up X amount of zones, with X equal to steps. stepBlend Controls the blending between the number of regions (see below). If you put this at 0, each step has a constant blur value. If this is 1, there is a continuous blend between the different regions.
steps The number of steps. The intensity of the control image is divided up X amount of zones, with X equal to steps. stepBlend Controls the blending between the amount of regions (see below). If you set this parameter to 0, each step has a constant blur value. If the setting is 1, there is a continuous blend between the different regions. controlChannel The channel of the controlling image to use to control the amount of blur. channels The channels of the input image to sharpen.
spread Tells Shake whether or not to consider outside of the frame. A button to the right of the parameter name lets you set the mode. • 0 = Compute “In Frame Only.” • 1 = Compute “Outside Frame.” Because of the Infinite Workspace, it is sometimes handy to compute outside of the frame as well, for example, if the Blur is placed after a Scale command. Note that if nothing is outside of the frame (black), you see a black edge. channels Lets you set which channels Shake should blur.
Parameters This node displays the following controls in the Parameters tab: xCenter, yCenter The center point of the blur. By default, these parameters are set to width/2, height/2. iRadius The distance from the center that contains the blur sample area. oRadius The outer edge for the blur area. aspectRatio This parameter inherits the current value of the defaultAspect global parameter.
Sharpen Un-sharp masking is used for the sharpening filter. This process blurs the image slightly, takes the difference between the blurred result and the input image, and adds that back over the input image. High values of x and yPixels (for example, greater than 3 percent of the image size) return undesirable results. You can also use the sharpen filter in the Convolve node, but ringing may result.
The following example is from a 3D render. Ringing appears around the background letters of the text when normally passed into a ZBlur. Instead, separate the circle into foreground and background elements with the 3D render. These are then blurred and composited in Shake. Parameters This node displays the following controls in the Parameters tab: amount The maximum amount of blur. near The value of distance toward the camera at which maximum blur occurs.
focusRange The distance away from the focusCenter, both toward and away from the camera, that remains unblurred. steps The number of steps that the total range is divided between. stepBlend The mixing of the different steps. 0 is no mixing and good for getting a feel for your step ranges. 1 is complete, linear blending. ZDefocus The ZDefocus node is identical to the Defocus blurring node, except you can create a realistic depth of field by using the image’s Z channel.
shape A pop-up menu that lets you choose the shape of the flaring in the resulting image. The fast modes give you low quality but process quickly. The circle, square, hexagon, and octagon give you a superior look, but are significantly more processor-intensive to render. The options are: • fast gaussian • fast box • circle • square • hexagon • octagon boostPoint The image value where the superwhite boosting starts. If boostPoint is set to .75, RGB values above .75 are boosted to increase flaring effects.
Part III: Optimizing, Macros, and Scripting This section covers advanced techniques and tips that allow you to streamline your workflow in Shake.
29 Optimizing and Troubleshooting Your Scripts 29 This chapter provides tips and techniques for optimizing your Shake scripts, to maximize image quality and minimize render times. Additional information on troubleshooting frequently encountered issues is also provided. Optimization This section contains information about how to improve your scripts—maximizing image quality and processing efficiency. Use Only the Color Channels You Need In Shake, you can combine images that use different channels.
m To strip out the RGB channels, leaving the alpha: Enter the following command-line function: shake mymask.#.tif -bri 0 -fo mynewmask.#.iff m To strip out the alpha channel, force the RGB as a monochrome 1 channel: Enter the following command-line function: shake mymask.#.tif -mono -setAlpha 0 -fo mynewmask.#.iff Note: Shake automatically optimizes itself to read only the channel it needs.
To take advantage of this feature, try not to mask or insert non-concatenating nodes between two or more concatenating nodes. In the following example, the second tree is more efficient because the color-correction and transform nodes have been grouped together, allowing them to concatenate. The effect of the second tree is identical to that of the first, but it’s more computationally efficient. Because of their arrangement, these nodes cannot concatenate.
In the following example, one of the balloon images has a color correction, Defocus operation, and a Move2D node with a high motion-blur setting. The Defocus and motion-blur settings are processor-intensive, so once the first balloon image’s settings have been finalized, that portion of the node tree above the Over1 node at the top can be rendered with a FileOut as a self-contained file.
Use the SetDOD Node to Reduce Rendering Time This node limits the portion of the image the renderer needs to concentrate on, as well as quickly masks off a large portion of the image. SetDOD optimizes memory, IO activity, and render times. In this example, even though the only interesting portion of the image is the ball in the middle, Shake inefficiently has to consider the entire image. To limit the area Shake must consider, apply a Transform–SetDOD node to optimize the render.
The Unbreakable Rules of Premultiplication If you don’t read the full explanation of the mathematics of premultiplication in “About Premultiplication and Compositing” on page 421, here are the two rules you must always follow when creating a composition in Shake: • Rule Number 1: Always color correct unpremultiplied images. To unpremultiply an image, use an MDiv node. • Rule Number 2: Always filter and transform premultiplied images. To premultiply an image, use an MMult node.
Solution You can load Shake's viewer lookup controls into the Parameters tab, then change the viewerGamma parameter to .818 to preview how your composition will look in the Final Cut Pro Canvas. This only changes how your image is displayed in the Shake Viewer, and does nothing to change the gamma of the script’s final rendered image.
Important: QuickTime movies compressed using the Animation codec (which only supports the RGB color space) are also assumed to have been created with a gamma of 1.8. As a result, these clips are also boosted to 2.2 when edited into a sequence set to 8or 10-bit YUV rendering. Note: For more information on setting the rendering options of a sequence in the Video Processing tab of the Sequence Settings dialog, refer the Final Cut Pro User Manual.
Don’t Mask Concatenating Nodes Masking a node breaks concatenation. This is bad. It slows your render and decreases quality, adds possible ringing on the mask edges, and forces multiple mask mixes. Instead, feed the tree into a KeyMix node.
Don’t Apply the Same Mask to Multiple Successive Nodes Even if the nodes do not normally concatenate, but appear one after the other along the same branch of the node tree, you get cleaner edges with the use of a KeyMix node. In the example below, a circular mask is applied to three filter effects. Each filter works on the previous node, so problems appear on the edges. The solution is again to use a KeyMix node. This yields a faster render (does not mix the mask multiple times) and a clean edge.
30 Installing and Creating Macros 30 If there’s a particular image-processing tree you’ve created that you would like to save for future use, you can turn it into a macro. Macros act like other nodes within Shake, except that you create them yourself using Shake’s other nodes as the initial building blocks. You can then add your own expressions, scripting, and user interface elements to extend their functionality.
This is referred to as the startup directory, and is used for both .h preference files, and for the installation of macros. Installing Macros Within a Script You can also place macros inside of a script itself by copying and pasting it with a text editor. This guarantees that your macro is found by Shake when rendering that script on any machine. However, when you do this, you do not have access to any interfacebuilding functions.
Preference File Load Order Sometimes, macros have to be loaded in a specific order. This is mainly true if one macro uses another macro to perform its task. If you need to explicitly control the order in which macros are loaded, this can be accomplished in a variety of ways. m To explicitly control macro load order, do one of the following: Add an include statement at the beginning of the file. For example, if macros.h relies on common.h being loaded before, start macros.h with: #include
Creating the Node Structure First, create the node structure for the function (what you want to occur in the node). This can be very simple or very complex. To help illustrate macro building, the following example creates a function that randomly scales, pans, and rotates your image, similar to CameraShake, but with more moving parameters. Important: The QuickPaint, ColorCorrect, HueCurves, and Lookup nodes should not be used inside of macros.
Making a Macro Since the above steps are tedious to manually recreate, create a macro. To create a macro: 1 In the node tree created above, select the Move2D node, and press Shift-M (or rightclick and choose Macro > Make Macro from the shortcut menu). The MacroMaker is launched. In the top portion of the Shake MacroMaker window, you specify the file name, the save location, and the tab where the node appears. 2 In the Macro Name field, enter RandomMove. 3 In the Macro Toolbox field, enter Transform.
Setting Value Store Macro in • User directory: Saves the macro in your $HOME/nreal/include/ startup as MacroName.h and a second ui file in $HOME/nreal/ include/startup/ui as MacroNameUI.h. • Shake Directory: Saves the macro in the Shake distribution directory, as /include/startup/MacroName.h and /include/startup/ui/MacroNameUI.h. For more information on these directories and their functions, see “Creating and Saving .h Preference Files” on page 355.
7 Click OK. The new push-button node appears in the Transform tab. 8 Add the new node to the Node View. In the RandomMove parameters, only the motionBlur settings are available, and have automatically collapsed into a subtree (due to the default Shake behavior). To modify the macro: 1 If you placed your macro in your User Directory, go into your $HOME directory, and then into the nreal/include/startup subdirectory. In the startup directory, a new file called RandomMove.h appears. 2 Open the RandomMove.
Edit the macro in this file. The parameters motionBlur, shutterTiming, and shutterOffset are declared in the first few lines, and then the assigned default values. The image input In is also assigned a value of 0, so there is no expected image input when the macro is created. image RandomMove( image In=0, float motionBlur=0, float shutterTiming=0.5, float shutterOffset=0 ) ... 3 Modify the behavior of the macro. Each turbulence function has a frequency of 2, for example, turbulence(time,2).
Modifying the Macro Interface The macro file in the startup directory merely creates the function. The interface is built by Shake each time it is launched. Therefore, the MacroMaker also creates a second file in the startup/ui subdirectory that creates a button and sets slider ranges for the node. For example, if you created the new frequency slider in the above example, you may have noticed that the slider only goes from 0 to 1. You can modify this in the ui file.
Note: You must strip out the alpha channel of the image. You can do this in Shake with a SetAlpha node set to a value of 0. Set the FileOut to your $HOME/nreal/icons directory, with the name TabName.Name.nri, and render the file. 3 In the RandomMoveUI.h file, remove the @ sign on line 3, and save the text file. 4 Restart Shake. The RandomMove node appears with the icon. Note: In all cases of the above code, case sensitivity is important.
Notice that the default parameter value is optional, so if you use this particular function, all four values must be supplied: float angle( float x1, float y1, float x2, float y2 ) { return atan2d(y2-y1,x2-x1); } Because the macro is so simple (one function), there is no Macro Body per se; the function is attached to the return statement, which indicates what is spit out of the macro. To use this function, use something like the following: myAngle = angle(0,0,100,100); that returns 45.0.
The LumaKey node is used to extract only the highlights. The highlights are blurred, and then applied back on the original image with the Screen node, which is nice for glows and reflections. The Mix node is used to control how much of the original image shows through. The example image shows the original image on the left, and the macro results on the right. Photo courtesy of Photron The following are the nodes reformatted as a macro. The macro parameters are bold.
Type: shake -help softglow to return: -softglow [blur] [lowClip] [hiClip] [percent] File Name Versus Macro Name Names of files have nothing to do with names of macros. Only the function name is important when called in the script. You can also have multiple macros per file. Loading Image Macros Into the Interface When you start the Shake interface, the macros do not appear in the interface. A separate file and set of functions are required to load the macros in the interface.
Typical Errors When Creating Macros The following table contains a list of typical errors in macro creation. When diagnosing a macro, first run the macro in the command line: shake -help myFunction. If nothing appears, there is a problem with your startup .h file. If it works fine, move on to the interface, and read any error messages in the Console tab. The Console tab is your number-one diagnostic tool.
Each of these has a default value assigned. Note that the image has 0, which indicates “no input.” These values are applied to both the command line or the graphical user interface defaults. If you do not supply a default argument, you must enter a value when you call the function. It is therefore recommended that you enter defaults. The second location is in the ui.h file when the function is called. To override the startup defaults, enter your own in the ui.h file.
The macro that is created in the following example is called VidResize. It takes an image of any size and resizes it to video resolution. There are slider controls to specify NTSC or PAL (vidformat), to maintain the aspect ratio (keepAspect), and if you do keep the aspect ratio, the color of the exposed background area. The following image represents the original node tree. To create the VidResize macro: 1 Quit Shake. 2 To load the macro, copy the VidResize.
bgRed, bgGreen, bgBlue, 0, 0 ); Select1 = Select(keepAspect, Resize1, SetBGColor1, 0, 0); return Select1; } The ui file looks like this: nuiPushMenu(“Tools”); nuiPushToolBox(“Transform”); nuiToolBoxItem(“@VidResize”,VidResize()); nuiPopToolBox(); nuiPopMenu(); The only tricky portions in the macro so far are the Select function, and the logic to choose the height. When the branch of Select equals 1, the first image input is passed through. When it equals 2, the second branch is fed through.
The keepAspect slider now goes from 1 to 2. Inappropriate Behavior in All the Wrong Places If you start to see controls on parameters that you have not created, or if you see other functions that have odd behaviors, make sure you have specified what function receives the control. If you set: nuiDefSlider(“depth”, 1, 2); anytime Shake sees a parameter named “depth” (for example, if somebody makes a macro to set bit depth to a certain value), it takes a range of 1 to 2.
The keepAspect parameter has an on/off button. Attaching Color Pickers and Subtrees Using a slider to select a color is not nearly as impressive to your arch foes as using the Color Picker, so attach bgRed, bgGreen, and bgBlue to a color control to interactively pick your color. For the format information, see “Using Parameters Controls Within Macros” on page 379. Since this is an interface change, edit the ui VidResizeUI.
The Color control is added to the interface. Attaching Button Toggles Next, attach a button to toggle the vidFormat. Since the 0 and 1 settings are not very intuitive for the video format selection, create buttons labeled “NTSC” and “PAL.” The following examples show two ways to attach a button toggle.
The new lines list the normal button, followed by the focus button. The icons directory is automatically scanned, but notice you have specified the ux subdirectory. The value returned is always 0 for the first entry, 1 for the next entry, 2 for the third entry, and so on. You can have as many entries as you want. Each button click moves you to the next choice. 4 Save the file and start Shake again. 5 Create the VidFormat node again. The vidFormat parameter has a PAL/NTSC toggle.
The numbers immediately to the left of the icon listing, for example, the 0 in “0|ux/ vr_ntsc”, show the value returned when that button is clicked. The nice thing about radio buttons is that they can return strings, float, or int. For example, the channel parameter in the KeyMix node selects the channel to do the masking, with R,G,B, or A returned, all strings. Because your macro VidResize only understands 0 or 1 to be meaningful, use 0 and 1 as your return values.
To attach a pop-up menu: 1 Add the following code to the ui file to create a pop-up menu: nuiPushMenu(“Tools”); nuiPushToolBox(“Transform”); nuiToolBoxItem(“@VidResize”,VidResize()); nuiPopToolBox(); nuiPopMenu(); nuxDefExprToggle(“VidResize.keepAspect”); nuiPushControlGroup(“VidResize.Background Color”); nuiGroupControl(“VidResize.bgRed”); nuiGroupControl(“VidResize.bgGreen”); nuiGroupControl(“VidResize.bgBlue”); nuiPopControlGroup(); nuiPushControlWidget(“VidResize.
); Select1 = Select(keepAspect+1, Resize1, SetBGColor1, 0, 0); return Select1; } 3 Save the file and start Shake again. The pop-up menu appears in the parameters.
Script Controls Command-Line Equivalent Description SetPixelScale(1,1): -pixelscale 1 1 Pixel scale and ratio for the script. See Chapter 4, “Using Proxies,” on page 137. SetDefaultWidth(720); SetDefaultHeight(480); SetDefaultAspect(1); SetDefaultBytes(1); SetDefaultViewerAspect(1); If a node goes to black or if you create an image node such as RGrad, it takes this resolution by default.
shake uboat.iff -autofit 166 w This calculates an image that is 166 x 125 pixels in size. It is not necessary to calculate the height on your own. Here is the code: image AutoFit(image img=0, int size=166, int sizeIs=1) { curve w=0; curve h=1; return Resize(img, sizeIs ? size*width/height :size , sizeIs ? size : size*height/width ); } The first line creates the parameters. Note that calculate is expecting an integer. The next two lines assign a value to both w and h.
{ curve string rdLetter = stringf(“%c”, ’A’+(int)floor(rnd1d(seed,time)*26)); return Text( width, height, bytes, time < staticFrame?“{rdLetter}”:“{letter}”, font, xFontScale, yFontScale, 1, xPos, yPos, 0, 2, 2, red, green, blue, alpha, 0, 0, 0, 45 ); } Text Manipulation II: RadioButton This is an excerpt from the RadioButton function that is used to generate radio buttons for the interface. The radio button code requires four icons to support it: name.on.nri, name.on.focus.nri, name.off.nri, and name.off.
Text Manipulation III: A Banner This little trick takes a string of letters and prints it, one letter at a time. It declares a variable within the string section of a Text node: Text1 = Text(720, 486, 1, {{ string logo = “My Logo Here”; stringf(“%c”, logo[(int) clamp(time-1, 0,strlen(logo))]) }}, “Courier”, 100, xFontScale, 1, width/2, height/2, 0, 2, 2, 1, 1, 1, 1, 0, 0, 0, 45); This uses strlen to determine the length of the string and extract the letter that corresponds to the current frame.
Text Manipulation V: Extracting Part of a String This function can be used to extract the file name from a FileOut or FileIn node so you can print it on a slate. Use it in a Text function. const char *getBaseFilename(const char *fileName) { extern const char * strrchr(const char *, char); const char *baseName = strrchr(fileName, ’/’); return baseName ? baseName+1 : fileName; } To use it, place a line in the text parameter of a Text function, such as: {getBaseFilename(FileIn1.
Expressions and Scripting 31 31 One of the more powerful aspects of Shake is its ability to use a wide variety of expressions and script code directly within any parameter of the application. What’s in This Chapter This chapter covers a variety of advanced topics relating to expressions and scripting directly within Shake. The following topics are covered: • • • • • • “Linking Parameters” on page 935. “Variables” on page 937. “Expressions” on page 939.
For example, the Move2D node links the yScale parameter as equal to the xScale parameter by default. To show the expression editor, enter any letter into the value field, then press Return. A plus sign appears next to the parameter. Click the plus sign (+) to expand the parameter and enter your expression. m To link to a parameter within a different node: Enter the node name, followed by a period, followed by the parameter name. For example: node.
Viewing Links in the Node View To help you make sense of what’s happening in the node tree, you can view the links connecting one node to another. Links are indicated for cloned nodes, as well as for nodes that use expressions referencing a parameter within another node. m To view the links between nodes in the Node View, do one of the following: Right-click in the Node View, then choose Enhanced Node View from the shortcut menu. m Press Control-E.
When referring to a variable from a different node, place the node name before the variable: node_name.width In some cases, problems may occur. For example, in a Resize node, if you set the Resize equal to width/2, you potentially cause a loop because it is changing width based upon a value that is looking for the width. To solve this, Shake always refers to the input width, height, and bit depth when you refer to these from inside of that node.
• Slider Low Val: For float and int variables, the lowest value the slider will represent. • Slider Hi Val: For float and int variables, the highest value the slider will represent. 4 When you’re done, click OK to create the variable and go back to your project, cancel to close the window without creating a new variable, or next to continue creating new variables. New local variables that you create appear within a subtree at the bottom of the other node parameters.
You can type an expression in any field. Some nodes, such as ColorX, WarpX, and TimeX, even support locally declared variables. For more information and a list of examples, see “ColorX” on page 647. If you are using the command-line method, you may have to enclose your expressions in quotes to avoid problems with the operating system reading the command. For example, don’t use: shake my_image.iff -rot 45*6 Instead, use: shake my_image.iff -rot “45*6” Examples Explanation 1/2.2 1 divided by 2.2.
Reference Tables for Functions, Variables, and Expressions All of the math functions available in Shake can be found in the include/nreal.h file. You can declare your own functions in your own .h file. To set an expression on a string (text) parameter, you need to add a : (colon) at the start of the expression; otherwise, it is treated as text rather than compiled and evaluated.
Image Variables Definition bytes The number of bytes in that image. This takes the input bit depth when called from inside of the node, and the output bit depth when called from outside of the node. width Width of the image. Takes the input width when called from inside of the node, and the output width when called from outside of the node. height Height of the image. Takes the input height when called from inside of the node, and the output height when called from outside of the node.
Math Functions Definition log10(x) Returns base 10 log. log10(10) = 1 M_PI A variable set to pi at 20 decimal places. max(a,b) Returns maximum between a and b. max(5,10) = 10 max3(a,b,c) Returns maximum between a, b, and c. max3(5,2,4) = 5 min(a,b) Returns minimum between a and b. min(5,10) = 5 min3(a,b,c) Returns minimum between a, b, and c. min3(5,2,4) = 2 a%b Modulus. 27%20 = 7 pow(x,y) Returns x to the y power. pow(2,4) = 16 round(x) Rounds number off. Values below x.
Noise Functions These are ideal for WarpX and ColorX. rnd2d(seed,seed,seed) 2d random value. rnd3d(seed,seed,seed,seed) 3d random value. rnd4d(seed,seed,seed, seed,seed) 4d random value. Trig Functions (in radians) Definition M_PI A variable set to pi at 20 decimal places. acos(A) Arc cosine in radians. asin(A) Arc sine. atan(A) Arc tangent. atan2(y,x) Returns the radian verifying sin(a) = y and cos(a) = x. cos(A) Cosine. sin(A) Sin.
String Functions Definition stringf( “xyz”, ...) Since you basically can write books on this, here is an example. Otherwise, it is recommended to purchase a book on C. There are also several examples in Chapter 30, “Installing and Creating Macros,” on page 905. This example takes the scriptName parameter and uses the system function echo to print it: extern “C” int system(const char*); const char *z= stringf(“echo %s”,scriptName); system(z); printf( “xyz”, ...
Curve Functions Definition CSpline(cycle, value@key1, value@key2, ...) Cardinal-spline interpolation, also known as Catmull-Rom splines. CSplineV(time_value, cycle, value@key1, value@key2, ...) Cardinal-spline interpolation, also known as Catmull-Rom splines. JSpline(cycle, value@key1, value@key2, ...) Jeffress-spline interpolation. JSplineV(time_value, cycle, value@key1, value@key2, ...) Jeffress-spline interpolation. NSpline(cycle, value@key1, value@key2, ...) Natural-spline interpolation.
Using Signal Generators Within Expressions This section illustrates the use of the various signal generators that are available for Shake expressions. They can be used to create either predictable or random patterns of values, and mathematically customized to adjust their offset, frequency, and amplitude. Signal Generators The following noise and trig functions all generate changing values over time.
fnoise() and turbulence() have additional frequency factors to the noise. fnoise(time,2) fnoise(time,5) turbulence(time,2) turbulence(time,5) Offsetting a Generator Function To offset a function’s starting value, add a value to time.
Changing the Frequency of a Generator Function To change a function’s frequency, multiply or divide time by a value.The exceptions are the noise functions fnoise() and turbulence()—both of which have frequency controls of their own (values are not modified below 1, so you may still have to modify time).
You might have guessed that rnd(1.05) is between those, but it in fact equals .0174, not .458. This is why it is called discontinuous noise. Examining the neighboring values does not help you to arrive at a safe guess for the in-between values. For this reason, frequency changes have no practical effects on the curve. rnd(time) Setting Ranges for Expressions The noise generators return values between 0 and 1. sin() and cos() return values between -1 and 1.
In this example, to break a noise() function into 5 steps between 0 and 1, multiply the value by 6 (float values of 0 to 6), knock off the decimal places with a floor() function (returning values of 0, 1, 2, 3, 4, 5), and then divide by 5, returning values of 0, .2, .4, .6, .8, and 1. noise(time) floor(noise(time)*6)/5 Another helpful expression is modulus, written as a%b. This divides a by b and returns only the remainder. This is helpful to fit an infinite range of values into a repeating limit.
See Tutorial 8, “Working With Macros,” in the Shake 4 Tutorials for information on making macros interactively or in a script. Scripting Controls To generate a test script, go to the Tutorial_Misc/truck/ directory within the Tutorial_Media directory. Enter the following command to create a script and save it as start.shk: shake truck.iff -outside sign_mask.iff -over bg.iff -savescript start.shk The truck is composited over the background, with the sign mask as a holdout mask, and a script named start.
// Input nodes bg = SFileIn(“bg.iff”, “Auto”, 0, 0); sign_mask = SFileIn(“sign_mask.iff”, “Auto”, 0, 0); truck = SFileIn(“truck.iff”, “Auto”, 0, 0); // Processing nodes Outside1 = Outside(truck, sign_mask, 1); Over1 = Over(Outside1, bg, 1, 0, 0); The first section contains controls for the script. The controls are all optional or can be overridden on the command line. The following sections discuss the body of the script, the sections listed under the “Input nodes” and “Processing nodes” comments.
Because the above script was created with a local filepath (in the Tutorial_Media/ truck directory), the images can only be found if the script is run from the truck directory. For example, a local directory for the truck image might be: /myMachine/documents/truck/truck.iff In order to run the script from any location—so the images can be found regardless of the location of the saved script—the absolute path of the images is required.
Therefore, the left side of the above lines is the variable that you assign a value. The right side is the value, usually coming from a function such as SFileIn, Outside, or Over. The function is called by its name, followed by its arguments between parentheses. The arguments, called parameters, are very specifically organized and always specify the same thing.
The result appears as follows in the interface: Only four parameters are entered for the Mult node—the alpha and depth parameters are omitted. Therefore, the alpha and depth parameters default to a value of 1. You can also see that Mult looks for two types of data: An image (labeled In) and floats (labeled red, green, blue, and so on.). A float is any number that contains a decimal place, for example, 1.2, 10.00, .00001, or 100,000.00. The following table lists the five types of data.
does not work because you are drastically mixing your data types (plugging an image into a float). There is one exception to this: when you enter 0 as an image input, indicating that you do not want to designate any image input. To Designate That a Function Has No Image Input Place a 0 in the image position. This example has no image input for the background image, the second argument: MaryAnn = Over(Thurston, 0); So far, you have only assigned variables to image types.
sign_mask.iff”, “Auto”, 0, 0); Lovey = SFileIn(“/Server02/VolumeX/Scene12/truck/ truck.iff”, “Auto”, 0, 0); MaryAnn = Mult(Lovey, mulVal, mulVal, mulVal); Thurston = Outside(MaryAnn, Skipper, 1); Ginger = Over(Thurston, Gilligan, 1, 0, 0); 3 Load the script into the interface with Load Script. 4 Open the local Parameters subtree in the Globals tab to reveal the mulVal slider. In short, if you load a script to be modified in the interface, you probably want to declare it as a curve type of data.
Function Formats So, where are all of these functions and how do you find their formats? Typically, they are organized by the type of data they manipulate. Here is a handy way to get a function format: Create the node(s) in the interface, select and copy the node(s) (press Command-C or Control-C), and paste the nodes into a text editor. For more information: • For image functions, see their relative chapters. For example, for information on the Rand function, see “Rand” on page 602.
In the interface, you can also use the Select node to switch between any number of input nodes. (For more information on the Select node, see “Select” on page 471.) This strategy allows you to stay within the interface without resorting to the script. However, the difference is that Shake only builds the part of the script that it needs for conditional statements listed below. Select has the overhead of all of its input nodes. Finally, ++i or --i is supported for increments.
If there is no initialization or reinitialization, “while” often makes more sense than “for.” Do/While This variation of “while” is different in that it tests at the bottom of the loop, so the statement body is done at least once. In the “while” above, the test may be false the first time and so nothing is done. Note on all of the other statements, a semicolon was not needed. This expression does need it at the end.
32 The Cookbook 32 “The Cookbook” contains tips and techniques for Shake that don’t fit neatly into other categories. Cookbook Summary The Cookbook contains a wide variety of techniques that have been accumulated over the years, and is provided to give you some shortcuts and ideas for different approaches to different kinds of shots.
• Brightness + Mult: These nodes concatenate in the following node tree. This setup does not work well if you use a pure color in a single Mult node (in this case, pure blue with a value of 0,0,1) because the zeroes drop the midtones out completely on the red and green channels. The Brightness node is set to approximately 3, helping to maintain the red and green channels when the blue multiplier brings them back down (.3, .3, .8 in Mult1).
The curve looks like the following (the curves are Linear to mimic a Tint function from a different package): • ColorMatch: This is similar in theory to the Lookup node, as it allows you to push the lows, mids, and highs. However, the internal math helps reduce solarization (hills and peaks in the curves), so you maintain a little bit more of the input color. You can get interesting adjustments of your values if you adjust the source points on the ColorMatch.
• ColorCorrect: This is an Add on the Mid areas using -.2, -2, .5. • Using Mix: You may end up with several nodes to achieve a particular color correction. This may be awkward to tune. Therefore, a convenient way to quickly adjust a result is to mix it back into the input image with a Layer–Mix node. Naturally, it is always faster to process by adjusting the original color nodes, but using a Mix may be easier for you to keep a handle on things.
Filtering Tips This section illustrates creative uses of Shake’s filtering nodes. Volumetric Lighting This script can be found in doc/html/cook/scripts/volumetric.shk. This simple hack gives you fake volumetric lighting by using Filter–RBlur. One of the key principles is that RBlur is dog-slow, so it is better, if you can, to apply a radial blur on a low-resolution element and then scale it up. To get the volume effect, subtract one RBlur from another. You should also drop your quality down (to .
Keying Tips This section covers keying techniques. Keying Clouds This script can be found in doc/html/cook/scripts/clouds.shk. The images used are the moon.iff and sky.iff files found in the Tutorial_Media directory. This is one potential technique for keying clouds, but may also be useful for flames. It discusses several approaches.
In this next attempt, there are three main branches. The first, identical to the second attempt, manipulates the moon. The second branch, terminating in a KeyMix node, works on the RGB of the clouds. The KeyMix mixes a darkened cloud image with a brighter cloud image through the RGrad node, giving it the “glow” through the clouds. The third branch works on the key of the clouds.
A luminance key is used here. The blue channel has less contrast than the red channel, so first insert a Color–Monochrome node, then boost the rWeight up and the g- and bWeight down before you key. Red channel Blue channel A Color–LookupHLS node manipulates the luminance, then switches that into the alpha with Color–Reorder (a macro begging to happen) to key the deep part of the clouds in the lower-right corner.
You still get black edges, so sprinkle Filter–DilateErode nodes liberally. For the nodes attached to ISub, the first chews into the edge, and the second DilateErode softens it by activating the soften parameter. As a final touch, the x/yCenter of RGrad is linked to the Move2D x/yPan, adding an offset for the center of the moon, Move2D1.xPan+155, Move2D1.yPan+160. You can modify the position of the moon and the glow on the clouds follows. Vignette This script can be found in doc/html/cook/scripts/vignette.
This tree involves a lot of masking. Remember, rotoscoping is your friend. (Just not a very fun friend.) The first branch, down to KeyMix1, pulls a key on the sky. The first Keylight pulls a hard key to be fed into the second Keylight. This is the core key for the bridge. This is keymixed with a Primatte-based key for the blue area through RotoShape1. Once the key is pulled, a Monochrome is applied and composited over a Ramp. This is then tinted with ColorMatch.
The image is then defocused with a mask. This result is masked by the node Inside1 with a square mask (Blur2) to get the black frame.
Layering Tips The following examples illustrate tips for layering. Bleeding Background Color Into the Foreground This script can be found in doc/html/cook/scripts/edgelight.shk. This script, which has an exaggerated effect for purposes of illustration, helps blend in some of the background color onto the foreground material. Note this is one variation—there are several ways to do this.
• Keylight: Extracts an unpremultiplied plate. • Reorder: Places the alpha into the RGB. • Bytes: Boosts it up to 16 bits—you are sure to get banding on the Blur+Emboss in 8 bits. • Emboss: Extracts a sense of lighting direction. The elevation is set to 0. • Blur2: If you do not blur the background, it makes her look transparent. • IMult1: Blends the color into the “lit” areas. Note it is assumed that Blur2 has an alpha of 1. If not, you must insert a Color–SetAlpha. • Screen: You can also use an IAdd.
The script begins with a Color–Reorder that puts the alpha into the RGB channels. It then Filter–Blurs it, inverts that, removes the alpha channel with a Color–SetAlpha set to 0, and then is added back onto the plate. The Color–MDiv is used because the IAdd disrupts the premultiplication status. The Color–Gamma can be used to tune the intensity of the flare. Finally, preMultiply is activated in the Layer–Over.
Transform Tips This section covers advanced techniques for transforming images. Spiral Down This animates something in a spiral pattern, running ever smaller (or larger) concentric rings. First, right-click in the parameters area, choose Create Local Variable from the shortcut menu, then name the local variable “mul.” You control the speed toward the center and the direction by animating the mul value.
To burn the path in: 1 Set timeRange in the Globals tab (1-50, for example). 2 Right-click over the xPan expression, then choose Save Expression from the shortcut menu. 3 In the lower-right corner of the Browser is a setting for Auto or Raw. Set it to Raw. 4 Enter a name for your curve, for example, “curveX.txt.” 5 Do the same thing for yPan, saving it as “curveY.txt.” 6 Create a second Pan node. 7 Right-click, then select Load Expression on the xPan parameter. 8 Set your format in the Browser as Raw.
Creating Depth With Fog The uboat.iff image can be found in the Tutorial_Media directory. The background is a simple Ramp. The trick is to apply depth-cueing to the U-boat: The first composite, without any fog, is not so stellar: The second approach is to use Key–DepthKey (distance of 45) to pull a transparency key.
This more complex approach uses the DepthKey as a mask for a color correction, in this case, Compress, which has identical hi and lo colors. A KeyMix is used to get the concatenation with Mult and Compress. The Mult is used to tint the boat green; Compress gives the feeling of depth: Text Treatments The following series of scripts plays with text treatments, and is stored as doc/html/ cook/scripts/car_ad_text.shk, numbers 1 through 8. Script 1 • • • • 980 Blur1: Only yPixels is set.
Script 2 This script depends on Ramp2D, a macro stored in doc/html/cook/macros. The script will not load without this macro loaded into your $HOME/nreal/include/startup directory. It creates an animated mask traveling across the text, driving both a IDilateErode and an IBlur node. The IDilateErode has a value of -4 for X and Y. The Solarize is used to boost up the middle of the Ramp2D and to drop the outer ends to black. Like script 1, you only set the yPixel blur in IBlur1.
This uses the noise() function to randomize the xCenter of the RGrads. The text is then held Inside of these two animated shapes, and a process similar to Script 1 is applied: • RGrad1 xCenter expression: noise(time/4)*Text1.width • RGrad2 xCenter expression: noise(time/4+100)*Text1.width By adding 100 to the noise function’s seed, you do not have an overlap in the animation. You can also change time/4 to increase or decrease the frequency, that is, time/10 or time/2. See “Expressions” on page 939.
Script 6 This is the same as Script 5, except the Screen is replaced with the Relief macro, found in doc/html/cook/macros. The script does not open without the Relief macro. The affect parameter of Relief is set to image 2. Script 7 This is the same as Script 6, but the result is fed back over the motion-blurred text.
Script 8 This script is driven off of the position of the RGrad. The center of the RBlur is set to the center of the RGrad, and the right parameter of SetDOD1 is set to RGrad1.xCenter+10, which unmasks the text as the RGrad moves to the right. Installing and Using Cookbook Macros All Shake macros can be found installed on your hard drive in the Shake directory, inside the doc/html/cook/macros directory.
Command-Line Macros The following macros are designed to make some quick fixes. They are available for use from the command line. FrameFill Macro This is used in an emergency to fill in a missing frame when you have to go to film in, say, two minutes. It takes the frames next to the missing frame and averages them together. For example: shake -framefill bus2.#.jpg -t 41, 45 UnPin Macro This is used to extract a texture map from an image.
Image Macros The following macros add Shake-generated image nodes to the Image tab. Flock Macro The following bird clip can be found in doc/html/cook/macros/Flock/bird. This takes a cycling clip and propagates copies of it offset in time, position, and scaling. There is a clip of birds provided as an example that you can use, royalty free. You can use the box to roughly position the birds. The birds are also positioned with two extra movements, a gentle cosine function and some random noise.
Rain Macro This macro can be used to generate rain to throw into a background. The rain is divided into three sheets, fg, mid, and bg. The lighting controls affect the height of the sheets. By using a low value, you can get a fake feeling of depth. Sort of. Ramp2D Macro This uses the NGLRender drawing routines to draw a polygon on the screen to give you a ramp between any two points. The wedgeSize parameter should be brought down if you start to see artifacts along the edges.
RandomLetter Macro This generates a random letter up until the staticFrame number, at which point it becomes a letter of your choosing. Frame 5 Frame 6 Slate Macro This generates a slate giving information on the show, animator, frame range, and so on. Although you can use it to generate a frame, typically you attach it to the end of your script before the FileOut. If you create the FileOut first, you can link the Slate to print the FileOut file.
Color Macros The following macros give you additional ways to manipulate color in your scripts. AEPreMult Macro This macro is intended to be used on an image that has a solid non-black background color which is still considered “premultiplied.” By applying this function, you turn the background color to black. This may not work with all images.
In this example by Richard Liukis for his short film, Taste It All, the plates were scanned with an unfortunately strong green cast. The shots were telecined down to video, color corrected with DaVinci, and edited. This same color correction needed to be applied to the film plates, so the video version and the logarithmic plates were both read in to Shake. A Color–LogLin was applied to the 2K plates, followed by a ColorGrade. You can see the green is even more pronounced in the default LogLin.
This example has a slightly high saturation, a slight blue cast, and punchier whites (but then again, 30 seconds were spent on it). Note because the tree is made of three concatenating color corrections, it was not necessary to convert up to float bit depth before the LogLin. Deflicker Macro This macro is helpful for reducing the flicker on an image.
Temp Macro This macro slides the midtones to warmer or cooler colors. Color-temperature-cool, not Fonzie-cool.
Relief Macro In the following, Example 1 has affect set to image1; the other two are set to image2. Example 1: affect = image1 Example 2: affect = image2 Example 3: Relief + IDisplace Key Macros These macros help you further manipulate keyed images. AlphaClamp Macro This macro clamps the alpha channel to 0 and 1. This is helpful for float images and when pulling LumaKeys, as you can arrive at negative values that can have unwanted effects in your RGB channels.
DeSpill Macro The HueCurves node has a problem with processing float values. This macro mimics Keylight’s spill suppression, allowing you to pick a spill color. KeyChew Macro This is intended to give a more natural chewing or expansion of the matte edge than the result from DilateErode. This macro works only on the alpha channel. It also eliminates any mid-range alpha areas (reflections and shadows). Note: This clamps your alpha channel to between 0 and 1, so be careful with float images.
This resizes the woman.sgi image from the Tutorial_Media directory to 2048 x 1383, maintaining its aspect ratio. PreTrack Macro This macro helps when tracking noisy film plates. It drops the blue channel out, which tends to have the thickest grain, and also applies a slight blur to the footage. Once the track has been done, disable or remove the PreTrack node. Note: The Tracker nodes have the ability to add blur while tracking.
Warping With the SpeedBump Macro This macro creates a nifty bump with a shadow on your title. Utility Macros The following macros let you address Maya’s Z-depth output, float elements used with the screen node, and let you manipulate the DOD. MayaZ Depth Macro The MayaZ macro converts the -1/z values that Maya outputs for the Z channel. ScreenFloat Macro This macro lets you use the Screen function with float elements. You have to set the high value.
Candy Macro With this macro, the drop shadow appears only on the background image’s alpha plane. It just seemed like a good idea at the time. If you do not prefer that, disable shadow generation with the useShadow parameter and use the normal AddShadow or DropShadow node.
MakeNodeIcon Macro This macro is used to make the icons for the function tabs. Typically, you insert an image that is 700 x 300 pixels and the macro fits everything inside. Have fun. AltIcon Macro This macro is used to make the alternative icons. You insert a roughly 250 x 250 image into the macro. It requires the Relief macro to be installed. It also calls on the font Arial. If you do not have this font, search for the word in the macro file and substitute an appropriate font.
RadioButton Macro This macro is used to create those swell radio buttons. You typically use this only in command-line mode, as it does some automatic output file naming for you. The first step is to create and specify a directory where you want to place the icons. This is typically $HOME/nreal/icons/ux/radio, as they tend to pile up, but you can place them anywhere. Open the radiobutton.
So, an example: shake -radiob “Not A Dufus” 53 NotADufus -t 1-4 -v This creates four files, NotADufus.on.nri, NotADufus.on.focus.nri, NotADufus.off.nri, and NotADufus.off.focus.nri, that are all 53 pixels wide and say “Not A Dufus” with different states of being illuminated and focused. Wallpaper Macro This helps with button icons, but it is also an interesting way to quickly generate animated backgrounds. It takes one vertical line from the input image and copies it across the image.
Using Environment Variables for Projects You can set up projects using environment variables to better manage your different shots. Environment variables point Shake to the right directories without too much difficulty even if you move your project to different drives or machines. What is an environment variable? It is a word that is known by the computer to have a certain value.
2 Create a directory that $myproj points to, that is, if you set it to /Documents/shot1, then create /Documents/shot1. 3 When you relaunch Shake, it should launch to $myproj. In the Directories pull-down menu, you also see $myproj listed. 4 When you read an image from this location, Shake keeps the environment variable ($myproj) in the path. Therefore, whenever you move the entire project, reset the environment variable to point to the new path.
To set per-project settings for Shake: 1 As an example, in your project directory, create startup/ui directories: /usr/shot1/startup/ui 2 In your startup directory, place a file to relocate your cache. Create a text file called cache.h and add these lines, obviously changing MyShotName: diskCache.cacheLocation=“/var/tmp/Shake/MyShotName”; diskCache.cacheSize = 500; The second line indicates the size in MB of your cache. Set it to something appropriate according to how much disk space you have to spare.
Keyboard Shortcuts and Hot Keys A Appendix A Keyboard Shortcuts in Shake In some instances, the keyboard shortcuts vary on different platforms. In the following tables, the Mac OS X commands appear first, followed by the equivalent Linux commands. Note: In many instances, both platform options work on Mac OS X. General Application Commands The following keyboard shortcuts are for general project management. Command Description Command-N or Control-N Create New script.
Navigating in Time The following keyboard shortcuts let you move the playhead backward and forward in time while you work. Command Description Forward Arrow Move forward one frame. Back Arrow Move back one frame. . Begin forward playback. Up Arrow Jump to next keyframe. Down Arrow Jump to previous keyframe. Home Fit the current time range into the Time Bar. Shift-. Begin cached playback. T Toggle the Time Bar between timecode and frame display.
Saving and Restoring Favorite Views The following keyboard shortcuts let you define and restore favorite views in the Viewer, Node View, Curve Editor, Time View, or Parameters tab. Command Description Shift-F1-5 Save favorite view of any interface area (Viewer, Node View, Curve Editor, Time View, or Parameters tab) to be accessable via the F1, F2, F3, F4, or F5 key. F1-5 Restore favorite view framing. Results in that area being panned and zoomed to the saved position.
Flipbook Keyboard Shortcuts The following keyboard shortcuts are available for any open Flipbook. Command Description . (period; consider it as >) Play forward. , (comma; consider it as <) Play backward. Shift-> Ping-pong playback. Shift-drag Shuttle playback. Option-drag or Alt-drag Reveal compare buffer, if set. Control-> Play through once. Space bar Stop playing and rendering. ? Continue rendering. R, G, B, A, C View a specific channel.
Node View The following keyboard shortcuts and modifiers help you work within the Node View. Command Description Shift When you move a node and the grid is enabled, holding down Shift allows the node to move freely. When the grid is disabled, holding down Shift locks it to the grid. Grid width and height parameters are in the guiControls subtree of the Globals tab. Del (near Home/End keys) or Delete Delete the selected nodes.
Command Description T Turn on/off selected node thumbnails. If you haven’t yet created a thumbnail (R), this does nothing. C Display the RGB channels for thumbnails. A Display the alpha channel of thumbnails. Selecting Nodes The following keyboard shortcuts let you select different ranges of nodes in the Node View. Command Description Command-A or Control-A Select all nodes. Shift-A Select all nodes attached to the current group.
Command Description B Open a macro into a subwindow so you can review wiring and parameters. You cannot change the nodes inside of the subwindow. Option-B or Alt-B Close the macro subwindow when the pointer is placed outside of the open macro. QuickPaint The following keyboard shortcuts are available in the QuickPaint node. Key Function F9 Use last brush. F10 or P Pick color. F11 Toggle between hard/soft brush. Z Magnet drag in Edit mode.
Command Description W Scales the selected points, with the initial click point the center of scaling. E A non-linear scaling of the points. K Insert a key at the frame the pointer is at over the selected spline. V Toggle visibility of selected curves. X, Y Allow movement only on X or Y axis. H Flatten tangents horizontally. Command-click or Control-click tangent Break tangent. Shift-click tangent Rejoin broken tangents. Del (near Home/End keys) or Delete Delete active keyframes.
MultiPlane Node Keyboard Shortcuts The following keyboard shortcuts let you choose angles from the multi-pane Viewer interface presented by the MultiPlane node. To switch a pane’s angle, position the pointer within that pane, and press one of these keys on the numeric keypad. Numeric Keypad Description 0 (numeric keypad) Cycle through every angle in the Viewer pane with the pointer positioned within it.
Keyboard Modifiers for Color Adjustments The following chart lists all the keyboard shortcuts for color adjustments within a color control. To use, press one of the listed channel keys, and drag within the color control to make the listed adjustment. 1014 Keyboard Channel Description R Red Adjust red channel independently. G Green Adjust green channel independently B Blue Adjust blue channel independently. O Offset Boost or lower all color channels relative to one another.
The Shake Command-Line Manual B Appendix A Shake started in its infancy as a command-line compositor—you can conceivably execute a 500-node script that is typed out in a Terminal. “Conceivably,” but not practically, since nodes such as Primatte, Stabilize, QuickPaint, and RotoShape have unwieldy formats. And, of course, you would have to type out 500 nodes on the command line, which is impractical.
m To display images: Type the name of the images, for example: shake truck.iff bg.iff sign_mask.iff Note: For instructions on how to use the Flipbook Viewer, see “Previewing Your Script Using the Flipbook” on page 90. m To convert or save a file: Append the -fileout, or -fo: shake truck.iff -fo test.rla The above command saves an image called test.rla in the .rla format. For a list of supported formats and their extensions, see “About Image Input” on page 107.
The -t option is extremely flexible. You can choose to render frame ranges, stepped ranges, individual frames, or any combination. Time Range Number of Frames Frames Rendered -t 1-100 100 1, 2, 3... 100 -t 1-100x2 50 1, 3, 5... 99 -t 1-100x20 5 1, 21, 41... 81 -t 1-20,30-40 31 1, 2, 3... 20, and 30, 31, 32... 40 -t 1-10x2,15,18,20-25 13 1, 3, 5... 9, 15, 18, 20, 21, 22... 25 -t 100-1 100 100, 99, 98...
The following is a good example of a common command-line test of 3D-rendered imagery: shake truck.iff -outside sign_mask.iff -over bg.iff As long as there is no ambiguity, it is not necessary to type the entire function name. For example: shake bg.iff -bri 2 calls the Brightness function since there are no functions starting with bri. However, calling: shake bg.iff -con 2 informs you that it cannot choose between Conform, Constraint, ContrastLum, ContrastRGB, or Convolve.
Getting Help How do you know what Blur is expecting? Aside from using the product non-stop for five years, you can also type: shake -help blur to return what arguments that function takes. Blur has six arguments: -blur [xPixels] [yPixels] [spread] [xFilter] [yFilter] [channels] Often, you don’t need to specify every argument. Shake gives you an error message if it expects more arguments than you have supplied. For additional information, refer to the relative function pages.
Occasionally, you want to perform different operations on two different images within the same command. This can be done with the branching commands -fi (FileIn) and -label. Label a branch with the -label function, and start a new branch with the -fi function. The following example blurs the background, and then assigns it a temporary label of BG. It then reads the truck, brightens it (the truck, but not the background), and composites the result over the blurred background: shake bg.
I/O Functions Description -fo FileOut. Writes the image to disk in the format of the file extension. If no extension is given, it is saved in .iff format. -savescript Saves all of the previous commands into a script for later execution. Also helpful to get scripting formats. -script Reads a script and tests it. All branches are viewed; all FileOut nodes are rendered to disk. Viewing Controls Description -compare Example: shake bg.iff -blur 20 -compare bg.
Render Controls Description -motion Sets the motion blur quality. In the command line, you must enable override (set it to 1). When executing a script, you either multiply what is saved as the global motion blur value (override = 0), or override it (override = 1). -node Only executes that node. For use with -exec. -nocache Disables the call to the cache, forcing complete recomputation of each element.
Masking Controls Description -oddonly Only executes the previous commands on the odd fields of the image, and mixes it back in with the image you supply. -roi Only executes a square portion of the image that you specify. Labeling Controls Description -curve [type] Creates a global variable available to the script that is loaded or other functions executed. See below for an example.
Color Functions Description -mult [a] [z] Multiplies color on a per-channel basis. -saturation Saturation change. Channel Functions Description -colorspace Example: shake bg.iff -colorsp rgb hls Converts images to a different colorspace. Indicate the source space and the destination space. -copy Copies a channel from your listed image to the incoming image.
Resizing Functions Description -addborders Pads the image out with black around the edges. -crop Crops the image to the two corners you specify. The origin is in the lower-left corner. -fit Resizes the image to the resolution you specify, maintaining the aspect ratio. -resize Resizes the image to the resolution you specify.
Video Field Functions Description -interlace Interlaces the two images. When clipMode is set to 1, the BG resolution is taken; when set to 0, the incoming image resolution is taken. 0 = even field, 1 = odd field. -oddonly Only executes the previous commands on the odd fields of the image, and mixes it back in with the image you supply. -pulldown [offset] Example: shake bus/bus2.40-79#.
Cool Text Tricks Description shake -addtext %F -t 1-20 Prints the padded current frame. shake -addtext “%D, %d %M” Prints the current date. Converting Image File Formats Description shake alien.#.iff -t 1-50 -fo temp.@.sgi Writes 50 unpadded images in the .sgi format. shake fan.@.iff -t 1-5 -fo fan.#.tif Writes 5 padded images in the .tif format. Adding and Removing Channels Description shake alien.0001.iff -lum -fo toto.iff Creates a black-and-white image with an alpha channel. shake alien.
Resizing Images Description shake bg.iff -zoom 2 1 Zooms the image to twice as wide. shake bg.iff -resize 720 486 Zooms the image to NTSC resolution. shake bg.iff -fit 720 486 Zooms the image to NTSC resolution, maintaining the original aspect ratio. Renumbering Clips Description shake bus2.40-79#.jpg -t 1-40 -fo toto.#.iff -v Shifts frame numbering to start at 1. shake bus2.#.jpg -t 40-79 -fo toto.#-39.iff -v Also shifts frame numbering to start at 1. shake bus2.#.jpg -t 40-79 -fo toto.118-#.
Animating Parameters Description shake truck.iff -pan “cos(time*.5)*100” “sin(time)*50” motion .5 1 -t 1-13 Uses the cos and sin functions to animate the truck in a figure eight. shake bg.iff -rotate “cos(time*.5)*50+25” -t 1-13 motion .5 1 Substituting Values with -curve If you have the following in a script called myscript.
the following line is listed: shake truck/truck.iff truck/bg.iff truck/sign_mask.iff So press Return. Repeating Previous Commands There are two ways to repeat previous commands: • Press the Up Arrow on the command line. Each time you press it, the previous command is listed, stepping back through your history. Change portions of the command with the Left Arrow and Right Arrow keys. Press the Down Arrow key to take you to the next command in the history list. • Press the ! key.
.h files locations of 355 .plist file 395 .
Aspect ratios anamorphic film 216 Assign color in Primatte 711 Associated Nodes command 258 Atomic-level correctors 451, 635, 637 Atop 457 function description 457 math and LayerX syntax 452 Audio 277–288 and QuickTime 277 extracting curves from 285 loading and refreshing files 278 mixdown 288 mixing and exporting 288 previewing 280 scrubbing 283 slipping sync 283 viewing 283 viewing and editing 282 Audio Panel 26 AutoAlign node Nodes AutoAlign 783 AutoFit macro 994 Autokey button 71, 768 for animating colo
deleting and duplicating 496 frustum 520 linking from other MultiPlane nodes 496 manipulation 517 CameraShake 794 function description 794 Camera tracking data 494 Candy macro 997 Cardinal splines 317 Channel functions in command-line mode 1024 variables 942 Channels about 414 changing the number of 416 editing in command-line mode 1027 in YUV color space 698 shuffling with Reorder 657 viewing 415 Checker 597 function description 597 ChromaKey 703 function description 703 parameters list 703, 704 CinemaScop
ColorSpace 646 function description 646 usage described 636 Color space DV footage 697 models 664 RGB 697 Shake’s color range 611 Color swatches (Pixel Analyzer tool) 628 Color timing 442 Color values animating 625 displaying in the Terminal 52 ColorWheel 599 function description 599 ColorX 647 function description 647 usage described 636 using expressions with 648 Command line rendering from 336 Command Line field 25 Command-Line Manual 1015–1030 Command-line mode appending functions 1017 argument flow 101
CornerPin 754, 773, 795 function description 795 setting up controls 388 Create Local Variable 81 Crop 182, 186, 773 scaling properties of 775 ct / ct16 files 171 Cursor 54 Curve Editor 25, 291–322 about 294 buttons 299 curve processing 309 editing HueCurves 672 loading and viewing curves 295 navigating in 298 placing into a Parameter Tab 386 right-click menu 298, 316 setting colors for 362 splitting panes 300 Curves adding jitter 312 applying functions to 309 autoloading 296 averaging 313 cycle types 315,
E EdgeDetect 870 function description 870 Edge treatment 691 Edit Connections button 830 Edit Menu 34 Edit mode painting 580 Edit Shapes button 830 Edit Shapes mode 547 Effects applying to blue screen footage 694–696 Emboss 872 function description 872 modifying image channels with 416 Enhanced node view 221 Environment variables 393 Mac OSX 395 testing 399 Exit command 33 Expand 641 function description 641 usage described 636 Exporting interlaced footage 203 Expressions 939 and Lookup function 652 arithme
Filters 861–891 and premultiplication 433 ApplyFilter 864 Blur 864 box 862, 863 characteristics 862 Convolve 865 default 863 defined 861 Defocus 868 DilateErode 869 dirac 863 EdgeDetect 870 Emboss 872 FilmGrain 872 gaussian 863 Grain 875 IBlur 879 IDefocus 880 IDilateErode 882 impulse 863 in command-line mode 1025 IRBlur 883 ISharpen 884 lanczos 863 masking 539, 861 masking versions 539 Median 885 Mitchell 862 Mitchell method 863 PercentBlur 885 Pixelize 886 quad 863 RBlur 886 Sharpen 888 sinc 863 sinc meth
ColorX 647 Common 458 Compress 639 Constraint 459, 542 ContrastRGB 640 Convolve 865 Copy 460 CornerPin 754, 795 Crop 186 declaring in expressions 941 Defocus 868 DeInterlace 206 DepthKey 704 DepthSlice 705 DilateErode 869 DisplaceX 807 DropShadow 470 EdgeDetect 870 Emboss 872 Expand 641 Fade 642 Field 207 FileOut 334 FilmGrain 872 Fit 183 Flip 796 Flop 797 formats of 959 Gamma 642 Grad 600 Grain 875 Histogram 677 HueCurves 672, 691 IAdd 461 IBlur 879 IDefocus 880 IDilateErode 882 IDisplace 808 IDiv 461 IMul
Twirl 816 Under 468 VideoSafe 208 Viewport 187 Warper 807 WarpX 816 Window 189 Xor 468 ZBlur 888 ZCompose 469 ZDefocus 890 Zoom 185 Function tabs hot keys 1008 G Gamma 642 function description 642 usage described 636 Gamma/Offset/LogLin button 63 Gaussian filter 863 gif files 171 Global parameters 74, 91 Global variables 941 Grad 600 function description 600 Grain 875 function description 875 graphic example 877 parameter list 876 Graphs of Lookup function 652 Green screen keys 682 Green spill 687 Grid Sna
Images absolute paths of 954 anamorphic 209 changing the number of channels 416 command-line functions 1015, 1016 high-resolution 130 input and output 107 interlaced 194 resizing in command-line mode 1027 saving 108, 333 unpremultiplying 426 viewing channels 415 with different color channels 414 Image sequences 108 Image variables 941 Importing interlaced images 196 Photoshop files 32, 476 Impulse filter 863 IMult 462 combining with keyers 683 function description 462 math and LayerX syntax 452 Include file
adding duplicates 293 animating parameters with 291 copying and pasting 314 delete button 71 deleting 292, 303 inserting for tracking 731 Manipulator Box 304 modifying 303 move modes 307 navigating in the Time Bar 294 selecting 302 text fields 305 toggling on and off 71 transform hot keys 305 Keyframing rules for 293 shapes 558 Keying 681 defined 681 DV footage 696 edge treatment 691 from a green or blue screen 682 reflections 684 with ColorReplace node 682 Keylight parameter list 709 Keylight plug-in 682,
Looping QuickTime and still images 263 LumaKey 709 function description 709 Luminance In YUV color space 697 M Machine settings directory location 357 Macintosh and Delete key 18 keyboard info 18 setting environment variables 394 macroCheck 370 MacroMaker 907 image of 909 parameter list 909–910 Macros 907, 914 adding custom icons to 913 AEPreMult 989 AltIcon 998 attaching button toggles 924 attaching color pickers and subtrees 923 attaching parameter widgets 919 attaching pop-up menus 926 AutoFit 994 basic
Max 465 combining with keyers 683 function description 465 math and LayerX syntax 453 Maya file compatibility 173 importing Z channel info 704 Maya .
AddShadow 470 AddText 456 AdjustHSV 659 aligning 246 ApplyFilter 864 Atop 457 Blur 864 Brightness 638 Bytes 413 CameraShake 794 Checker 597 ChromaKey 703 Clamp 639 cloning 252, 936 Color 598 ColorCorrect 661 ColorMatch 669 ColorReplace 671 ColorSpace 646 ColorWheel 599 ColorX 647 Common 458 Compress 639 connecting 231, 232 Constraint 459, 542 ContrastRGB 640 Convolve 865 Copy 460 copying 239, 257 copying and pasting 239 CornerPin 754, 795 creating 226 creating multiples with one button 377 Crop 186 cutting
Pan 802 pasting 239 PercentBlur 885 PinCushion 814 Pixel Analyzer 631 Pixelize 886 PlotScanline 676 QuickPaint 579 QuickShape 572 Ramp 601 Rand 602 Randomize 814 RBlur 886 renaming 243 Reorder 657 replacing 237 Resize 184 RGrad 603 Rotate 802 RotoShape 546 Saturation 644 Scale 803 Screen 467 Scroll 804 Select 471 select by expression 231 select by name 231 select by type 231 selecting and deselecting 228 selecting downstream 258 selecting upstream 258 Set 657 SetAlpha 658 SetBGColor 658 SetDOD 804 setting i
P Padding (when naming image files) 167 Paint tools 580 Paint brush 581 Painting (see QuickPaint) 579 Paint mode 580 Paint strokes attaching to a tracker 586 converting from Frame to Persistent 589 Interpolating 588 modifying 583 modifying parameters 587 PAL 95, 216 Palettes custom 365, 624 pal files 173, 177 Pan 769, 802 function description 802 Panning controls setting up 387 Parameters animating in command-line mode 1028 editing 74 grouping in a subtree 382 linking 79, 935 linking at different frames 937
Premultiplication and 3D renders 616 and filters 433 explained 421 managing 431 typical problems 422 with Over 433 PreTrack macro 995 Previewing audio 280 Primatte plug-in 682, 710 3D polyhedron 714 arithmetic operator 683 assigning colors 711 supplying the background image 710 using the arithmetic parameter 686 Processing cache 350, 351 Processors assigning to interface 368 Proxies 137 and offline images 148 and YUV files 156 changing preset defaults 144 compatibility with other functions 163 customizing t
Randomize 814 function description 814 RandomLetter macro 988 Random noise using ColorX expressions 648 Range 666 raw files 172, 177 RBlur 886 function description 886 Real-time playback 325 Re-center image 325 Recover Script 33 Red channel correction with ColorX expressions 648 Redo 34, 257 Reference pattern 721 Reflections keying 684 Relational operators 941 Relative Path control 40 Relief macro 993 Reload Script 32 Remap parameters 122 Renaming nodes 243 Render command-line mode 1021 Disk Flipbooks 327 F
RotoShape 546 Add Shapes mode 547 parameter list 570 RotoShape keyframes cutting and pasting 559 RotoShapes Add Shapes mode 547 animating 557 creating and modifying 549 Edit Shapes mode 547 parameter list 570 Point modes 564 retiming 561 skeleton relationships 566 transform controls 567 Viewer buttons 568 rpf files 172, 177 S Sample (color) From Viewer 621 Saturation 644 function description 644 usage described 637 Saving expressions 81 interface settings 33 Pixel Analyzer data 632 scripts 32 track files 7
supported platforms 15 user interface 24–31 Shape data importing and exporting 567 Shapes attaching trackers 562 bounding boxes 555 changing color of 555 copying and pasting between nodes 556 drawing and editing 832 drawing with the RotoShape node 548 editing 550 keyframing 558 linking 566 locking tangents 556 reordering 556 showing and hiding 556 timing 560 Shapes (see RotoShapes) 546 Sharpen 888 Shear 805 function description 805 Shift Curves 265 and timing changes 265 Sinc filter 862, 863 Skeleton relati
Thumbnails 253 keyboard shortcuts 253 tiff files 173 Tile 609 function description 609 Tiling with a macro 933 Time Bar 88, 292 frame range settings 371 setting colors for 361 Time Bar area 25 Timecode default mode 371 displaying in the Viewer 66 setting default modes 367 Time range command-line mode 1017 Time shift 284 Time View 261 setting colors for 364 Viewing nodes in 262 Time view 261 TimeX 123 function description 123 Title Bar 31 TMV color space 664 Toggles creating 384 Tools Menu 34 Tool Tabs and N
Undo 34, 257 changing levels of 37 setting levels 368 Undo/Redo button 36 Ungroup 247 UnPin macro 985 Unpremultiplying 426 Update button 37 User Directory 357 User interface 24–31 Utility correctors 635, 646–659 V Value Range in Pixel Analyzer tool 631 Variables 928, 929, 937 adding to the interface 936 environment 393 for channels 942 image variables in each node 941 recognized by Shake 398 Video 191 and aspect ratio 210 aspect ratio 215 common problems 194 field functions in command-line mode 1025 field
Window 189 for cropping 182 function description 189 scaling properties of 775 Windows OS functions 31 panning 28 zooming 28 X Xor 468 function description 468 math and LayerX syntax 453 xpm files 173 Y YCrCb defined 697 YIQToRGB 646 yuv files 173 defined 697 YUVToRGB 646 1053 Index Z ZBlur 888 function description 888 parameter list 889–890, 891 Z channel blurring with ZBlur 888 button 56, 64 defocusing 890 display properties 414 for DepthKey function 704 for DepthSlice function 705 inverting 643 mult