Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore After Effect Learning

After Effect Learning

Published by V Editor43, 2021-09-08 09:39:11

Description: after_effects_reference

Keywords: learn after effects

Search

Read the Text Version

546 Rendering and exporting Name output files automatically The Use Default File Name And Folder preference ensures that all compositions added to the render queue are automatically assigned a unique output filename (except for files created by saving previews, which still use the composition name). When this option is selected, each render item is assigned the same folder name as the previous render item until you change the path. If a composition is rendered more than once, After Effects adds a number to the filename (for example, composition_name_1). Note: Avoid using high-ASCII or other extended characters in filenames for projects to be used on different platforms or rendered using a watch folder. 1 Choose Edit > Preferences > Output (Windows) or After Effects > Preferences > Output (Mac OS). 2 Select Use Default File Name And Folder. Support for paths in templates You can add paths to templates. Absolute paths can be defined in a template. For example, you can define and save a template that always places rendered files in E:\\\\Output\\\\[compName].[extension]. Render settings Render settings apply to each render item and determine how the composition is rendered for that specific render item. By default, the render settings for a render item are based on the current project settings, composition settings, and switch settings for the composition on which the render item is based. However, you can modify the render settings for each render item to override some of these settings. Render settings apply to the root composition for a render item, as well as all nested compositions. Note: Render settings only affect the output of the render item with which they’re associated; the composition itself is not affected. Render settings Change render settings • To change render settings for a render item, click the render settings template name next to the Render Settings heading in the Render Queue panel, and choose settings in the Render Settings dialog box. • To apply a render settings template to selected render items, click the triangle next to the Render Settings heading in the Render Queue panel, and choose a template from the menu. You can choose a custom render settings template or one of the preset render settings templates: Last updated 11/4/2019

547 Rendering and exporting Best Settings: Often used for rendering to final output. Draft Settings: Often appropriate for reviewing or testing motion. DV Settings: Similar to Best Settings, but with Field Rendering turned on, set to Lower Field First. Multi-Machine Settings: Similar to Best Settings, but with Skip Existing Files selected to enable multi-machine rendering. Note: The default render settings template is assigned to a render item when it is created. To change which render settings template is the default, hold down Ctrl (Windows) or Command (Mac OS) as you choose a render settings template from the menu. Create, edit, and manage render settings templates You perform the following tasks in the Render Settings Templates dialog box. To open the Render Settings Templates dialog box, choose Edit > Templates > Render Settings, or click the triangle next to the Render Settings heading in the Render Queue panel and choose Make Template. • To make a new render settings template, click New, specify render settings, and click OK. Enter a name for the new template. • To edit an existing render settings template, choose a template from the Settings Name menu, click Edit, and specify render settings. Note: Changes to an existing template do not affect render items that are already in the render queue. • To specify a default render settings template to be used when rendering movies, individual frames, pre-rendered movies, or proxies, choose a template from a menu in the Defaults area of the Render Settings Templates dialog box. • To save all currently loaded render settings templates to a file, click Save All. • To load a saved render settings template file, click Load, select the render settings template file, and then click Open. Render settings reference Each of these settings overrides composition settings, project settings, or layer switch settings. Log You can choose how much information After Effects writes to a render log file. If you choose Errors Only, After Effects only creates the file if errors are encountered during rendering. If you choose Plus Settings, a log file is created that lists the current render settings. If you choose Plus Per Frame Info, a log file is created that lists the current render settings and information about the rendering of each frame. When a log file has been written, the path to the log file appears under the Render Settings heading and Log menu. Quality The quality setting to use for all layers. (See Layer image quality and subpixel positioning.) Resolution Resolution of the rendered composition, relative to the original composition dimensions. (See Resolution.) Note: If you render at reduced resolution, set the Quality option to Draft. Rendering at Best quality when reducing resolution produces an unclear image and takes longer than Draft quality. Disk Cache Determines whether the disk cache preferences are used during rendering. Read Only writes no new frames to the disk cache while After Effects renders. Current Settings (default) uses the disk cache settings defined in the Media & Disk Cache preferences. Last updated 11/4/2019

548 Rendering and exporting Proxy Use Determines whether to use proxies when rendering. Current Settings uses the settings for each footage item. (See Placeholders and proxies.) Effects Current Settings (default) uses the current settings for Effect switches . All On renders all applied effects. All Off renders no effects. Solo Switches Current Settings (default) uses the current settings for Solo switches for each layer. All Off renders as if all Solo switches are off. (See Solo a layer.) Guide Layers Current Settings renders guide layers in the top-level composition. All Off (the default setting) does not render guide layers. Guide layers in nested compositions are never rendered. (See Guide layers.) Color Depth Current Settings (default) uses the project bit depth. (See Color depth and high dynamic range color.) Frame Blending On For Checked Layers renders frame blending only for layers with the Frame Blending switch set, regardless of the Enable Frame Blending setting for the composition. (See Frame blending.) Field Render Determines the field-rendering technique used for the rendered composition. Choose Off if you are rendering for film or for display on a computer screen. (See Interlaced video and separating fields.) 3:2 Pulldown Specifies the phase of 3:2 pulldown. (See Introduce 3:2 pulldown.) Motion Blur Current Settings uses the current settings for the Motion Blur layer switch and the Enable Motion Blur composition switch. On For Checked Layers renders motion blur only for layers with the Motion Blur layer switch set, regardless of the Enable Motion Blur setting for the composition. Off For All Layers renders all layers without motion blur regardless of the layer switch and composition switch settings. (See Motion blur.) Time Span How much of the composition to render. To render the entire composition, choose Length Of Comp. To render only the part of the composition indicated by the work area markers, choose Work Area Only. To render a custom time span, choose Custom. (See Work area.) Frame Rate The sampling frame rate to use when rendering the movie. Select Use Comp’s Frame Rate to use the frame rate specified in the Composition Settings dialog box, or select Use This Frame Rate to use a different frame rate. The actual frame rate of the composition is unchanged. The frame rate of the final encoded movie is determined by the output module settings. (See Frame rate.) Skip Existing Files Lets you rerender part of a sequence of files without wasting time on previously rendered frames. When rendering a sequence of files, After Effects locates files that are part of the current sequence, identifies the missing frames, and then renders only those frames, inserting them where they belong in the sequence. You can also use this option to render an image sequence on multiple computers. (See Render farming - Render a still-image sequence with multiple computers.) Note: The current image sequence must have the same name as the existing image sequence, and the starting frame number, frame rate, and time span must be the same. You must render to the folder that contains the previously rendered frames. Output modules and output module settings Output module settings apply to each render item and determine how the rendered movie is processed for final output. Use output module settings to specify file format, output color profile, compression options, and other encoding options for final output. You can also use output module settings to crop, stretch, or shrink a rendered movie; doing this after rendering is often useful when you are generating multiple kinds of output from a single composition. Output module settings are applied to the rendered output that is generated according to the render settings. Last updated 11/4/2019

549 Rendering and exporting For some formats, an additional dialog box opens when you choose the format in the Output Module Settings dialog box. You can modify these settings and use settings presets to specify format-specific options, such as compression options. You can apply multiple output modules to each render item, which is useful when you want to make more than one version of a movie from one render. For example, you can automate the creation of a movie and its alpha matte, or you can create high-resolution and low-resolution versions of a movie. Note: Before rendering, check the Audio Output settings in the Output Module Settings dialog box to ensure that they are correct. To render audio, Audio Output must be selected. If your composition does not include audio, do not select Audio Output, so that the size of the rendered file does not increase needlessly. You can set the output module of multiple render queue items at the same time. Select the render queue items, and then choose an output module template from the Output Module Settings menu for one of the items. You can drag an output module to the Project panel to import the finished movie or a placeholder into the project for use as a footage item. (See Import footage items.) Andrew Kramer provides a video tutorial with tips for working with proxies, output modules, and output module templates on the Video Copilot website. Change output module settings • To change output module settings for a render item, click the underlined output module settings template name next to the Output Module heading in the Render Queue panel, and choose settings in the Output Module Settings dialog box. • To apply an output module settings template to selected render items, click the triangle next to the Output Module heading in the Render Queue panel, and choose a template from the menu. You can choose a custom output module settings template or one of the preset output module settings templates. Several templates are provided, including the Lossless template for creating movies for transfer to video, film, or an NLE system. Note: The default output module settings template is assigned to a render item when it is created. To change which output module template is the default, hold down Ctrl (Windows) or Command (Mac OS) as you choose an output module template from the menu. Last updated 11/4/2019

550 Rendering and exporting To change output module settings for multiple output modules at once, select the output modules and then choose an output module template. The template is applied to all selected output modules. Create, manage, and edit output module templates You perform the following tasks in the Output Module Templates dialog box. To open the Output Module Templates dialog box, choose Edit > Templates > Output Module, or click the triangle next to the Output Module heading in the Render Queue panel and choose Make Template. • To make a new output module settings template, click New, specify output module settings, and click OK. Enter a name for the new template. • To edit an existing output module settings template, choose a template from the Settings Name menu, click Edit, and specify output module settings. Note: Changes to an existing template do not affect render items that are already in the render queue. • To specify a default output module settings template to be used when processing movies, individual frames, previews, pre-rendered movies, or proxies, choose a template from a menu in the Defaults area of the Output Module Templates dialog box. • To save all currently loaded output module templates to a file, click Save All. • To load a saved output module template file, click Load, select the output module template file, and then click Open. Add output modules to and remove output modules from render items • To add a new output module with default settings to a single render item, click the plus (+) sign to the left of the Output To heading of the last output module for the render item. • To remove an output module from a render item, click the minus (-) sign to the left of the Output To heading of the output module. • To add a new output module with default settings to selected render items, choose Composition > Add Output Module. • To duplicate selected output modules, press Ctrl+D (Windows) or Command+D (Mac OS). Output module settings For information on using controls in the Color Management area of the Output Module Settings dialog box, see Assign an output color profile. Format Specifies the format for the output file or sequence of files. Include Project Link Specifies whether to include information in the output file that links to the source After Effects project. When you open the output file in another application, such as Adobe Premiere Pro, you can use the Edit Original command to edit the source project in After Effects. Include Source XMP Metadata Specifies whether to include XMP metadata in the output file from the files used as sources for the rendered composition. XMP metadata can travel all the way through After Effects from source files, to footage items, to compositions, to rendered and exported files. For all default output module templates, Include Source XMP Metadata is deselected by default. (See Exporting XMP metadata from After Effects.) Post-Render Action Specifies an action for After Effects to perform after the composition is rendered. (See Post-render actions.) Last updated 11/4/2019

551 Rendering and exporting Format Options Opens a dialog box in which you specify format-specific options. Channels The output channels contained in the output movie. After Effects creates a movie with an alpha channel if you choose RGB+Alpha, implying a depth of Millions of Colors+. Not all codecs support alpha channels. Note: All files created with a color depth of Millions of Colors+, Trillions of Colors+, or Floating Point + have labeled alpha channels; information describing the alpha channel is stored in the file. Therefore, you do not have to specify an alpha interpretation each time you import an item created in After Effects. Depth Specifies the color depth of the output movie. Certain formats may limit depth and color settings. Color Specifies how colors are created with the alpha channel. Choose from either Premultiplied (Matted) or Straight (Unmatted). (See Alpha channel interpretation: premultiplied or straight.) Starting # Specifies the number for the starting frame of a sequence. For example, if this option is set to 38, After Effects names the first frame [file_name]_00038. The Use Comp Frame Number option adds the starting frame number in the work area to the starting frame of the sequence. Resize Specifies the size of your output movie. Select Lock Aspect Ratio To if you want to retain the existing frame aspect ratio when resizing the frame. Select Low Resize Quality when rendering tests, and select High Resize Quality when creating a final movie. (See Scaling a movie downand Scaling a movie up.) Crop Used to subtract or add rows or columns of pixels to the edges of the output movie. You can specify the number of rows or columns of pixels to be added or subtracted from the top, left, bottom, and right sides of the movie. Use positive values to crop, and use negative values to add rows or columns of pixels. Select Region Of Interest to export only the region of interest selected in the Composition or Layer panel. (See Region of interest (ROI).) By adding one row of pixels to the top and subtracting one row from the bottom of a movie, you can change the field order. Audio Output Specifies the sample rate, sample depth (8 Bits or 16 Bits), and playback format (Mono or Stereo). Choose a sample rate that corresponds to the capability of the output format. Choose an 8-bit sample depth for playback on the computer, and a 16-bit sample depth for CD and digital audio playback or for hardware that supports 16-bit playback. Note: The specifications for some formats impose limits on audio parameters. In such cases, audio options may be unavailable for modification in the Output Module Settings dialog box. Also, audio options for some formats are set in the export settings dialog box for that format. For example, to set audio output options for Windows Media, click Format Options in the Output Module Settings dialog box. Warning for mismatch in frame rate or dimensions Some formats enforce constraints on frame dimensions and frame rate. If you choose such a constrained output format, and your composition, its render settings, or its output module settings don’t match the constraints, then After Effects shows a yellow warning icon and the message “Settings mismatch” at the bottom of the Output Module Settings dialog box. Click the warning icon to see a detailed message that describes how the output file will be modified to meet the format constraints. You can go back and change composition settings, render settings, and output module settings if you don't want After Effects to make the changes automatically in the output module. Last updated 11/4/2019

552 Rendering and exporting For more information about output module constraints and the warnings for mismatches in frame rate, dimensions, and pixel aspect ratio, see the Adobe website. Encoding and compression options for movies Compression is essential for reducing the size of movies so that they can be stored, transmitted, and played back effectively. Compression is achieved by an encoder; decompression is achieved by a decoder. Encoders and decoders are known by the common term codec. No single codec or set of settings is best for all situations. For example, the best codec for compressing cartoon animation is generally not efficient for compressing live-action video. Similarly, the best codec for playback over a slow network connection is generally not the best codec for an intermediate stage in a production workflow. For information on planning your work with final output in mind, see Planning your work. After Effects uses an embedded version of the Adobe Media Encoder to encode most movie formats through the Render Queue panel. When you manage render and export operations with the Render Queue panel, the embedded version of the Adobe Media Encoder is called automatically. The Adobe Media Encoder appears only in the form of the export settings dialog boxes with which you specify some encoding and output settings. Note: The embedded version of the Adobe Media Encoder used to manage export settings within After Effects output modules does not provide all the features of the full, stand-alone Adobe Media Encoder application. For information about the full, stand-alone Adobe Media Encoder application, see Adobe Media Encoder Help. For most output formats, you can specify format-specific encoding and compression options. In many cases, a dialog box opens and presents these options when you choose a format to export to or click the Format Options button in the Output Module settings dialog box. (See Output modules and output module settings.) QuickTime (MOV) encoding and compression settings 1 In the Render Queue panel, click the underlined name of the output module. 2 Choose QuickTime from the Format menu. 3 Click Format Options in the Video Output section. 4 In the QuickTime Options dialog box, choose a codec and set options according to the specific codec and your needs: Quality A higher Quality setting produces better image quality but results in a bigger movie file. Key Frame Every In QuickTime terminology, the term key frames refers to something different from the change- over-time keyframes placed in the After Effects Timeline panel. In QuickTime, key frames are frames that occur at regular intervals in the movie. During compression, they are stored as complete frames. Each intermediate frame that separates them is compared to the previous frame, and only changed data is stored. Using key frames greatly reduces movie size and greatly increases the memory required to edit and render a movie. Shorter intervals between key frames enable faster seeking and reverse playback, but can significantly increase the size of the file. Frame Reordering Some codecs allow for frames to be encoded and decoded out of order for more efficient storage. Note: For more information on QuickTime, see the Apple website. 5 Click OK. 6 Specify other settings in the Output Module Settings dialog box. Last updated 11/4/2019

553 Rendering and exporting Post-render actions You can use post-render actions to automate simple tasks that occur after a composition is rendered. A common example of the use of post-render actions is with pre-rendering: Choosing Composition > Pre-render adds the selected composition to the render queue and sets the Post-Render Action option to Import & Replace Usage. Note: You choose Post-Render Action options in the Output Module group, so be aware that changing the Output Module template could also change the Post-Render Action option. (See Output modules and output module settings.) 1 Expand the Output Module group in the Render Queue panel by clicking the arrow to the left of the Output Module heading. 2 Choose one of the following from the Post-Render Action menu: None Performs no post-render action. This option is the default. Import Imports the rendered file into the project as a footage item when the rendering is complete. Import & Replace Usage Imports the rendered file into the project and substitutes it for the specified item. Drag the pick whip to the item to replace in the Project panel to specify it. Use the Import & Replace Usage option to create a chain of dependent render items. For example, you can set one render item to use a watch folder and multiple computers to create a still-image sequence, and then the next render item can render a single movie file from that still-image sequence. (See Network rendering with watch folders and render engines.) Set Proxy Sets the rendered file as a proxy for the specified item. Drag the pick whip to the item in the Project panel item to specify it. Rendering and exporting still images and still-image sequences Render and export a sequence of still images You can export a rendered movie as a sequence of still images, in which case each frame of the movie is output as a separate still-image file. When you render one movie using multiple computers on a network, the movie is always output as a still-image sequence. Many 3D animation programs accept sequences of still images. Sequences of PNG files are often a good choice for transfer of visual elements from After Effects to Flash Professional. If you are creating a movie for transfer to film, you will need to create a sequence of still images that you can then transfer to film using a film recorder. Creating a sequence of PSD files is a good way to transfer frames to Photoshop for touchup and editing. You can then import the image sequence back into After Effects. Last updated 11/4/2019

554 Rendering and exporting When specifying the output filename for a still-image sequence, you actually specify a file-naming template. The name that you specify must contain pound signs surrounded by square brackets ([#####]). As each frame is rendered and a filename created for it, After Effects replaces the [#####] portion of the name with a number indicating the order of the frame in the sequence. For example, specifying mymovie_[#####].tga would cause output files to be named mymovie_00001.tga, filmout_00002.tga, and so on. The maximum number of frames in a still-image sequence is 32,766. Render and export a single frame of a composition You can export a single frame from a composition, either as an Adobe Photoshop (PSD) file with layers intact or as a rendered image. This is useful for editing files in Adobe Photoshop, preparing files for Adobe Encore, creating a proxy, or exporting an image from a movie for posters or storyboards. The Photoshop Layers command preserves all layers from a single frame of an After Effects composition in the resulting Photoshop file. Nested compositions up to five levels deep are preserved in the PSD file as layer groups. The PSD file inherits the color bit depth from the After Effects project. In addition, the layered Photoshop file contains an embedded composite (flattened) image of all the layers. This feature ensures that the file is compatible with applications that don’t support Photoshop layers; such applications display the composited image and ignore the layers. A layered Photoshop file saved from After Effects may look different from the frame viewed in After Effects if the frame uses features that Photoshop doesn’t support. For example, if the frame contains a blending mode that isn’t available in Photoshop, a blending mode that most resembles it is substituted in the layer, but the embedded composite image (viewable only by applications that don’t support Photoshop layers) looks the same. Alternatively, you can render the frame using the Composition > Save Frame As > File command to export a flattened and rendered version of the file to the PSD format. PSD files generated by Save Frame As > Photoshop Layers have the sRGB IEC61966-2.1 ICC color profile embedded if color management is disabled for the project (the project's working color space is set to None). If color management is enabled for the project (the project's working color space is set to something other than None), then PSD files generated by Save Frame As > Photoshop Layers have the color profile embedded that corresponds to the project's working color space. (See Color management and color profiles.) 1 Go to the frame that you want to export so that it is shown in the Composition panel. 2 Do one of the following: • To render a single frame, choose Composition > Save Frame As > File. Adjust settings in the Render Queue panel if necessary, and then click Render. • To export a single frame as an Adobe Photoshop file with layers, choose Composition > Save Frame As > Photoshop Layers. To change the default output settings for the Save Frame As > File command, change the settings for the Frame Default render settings template (See Create, edit, and manage render settings templates.) Last updated 11/4/2019

555 Rendering and exporting Export an After Effects project as an Adobe Premiere Pro project You can export an After Effects project as an Adobe Premiere Pro project without rendering. Note: Projects created using the latest version of Adobe After Effects and saved as Adobe Premiere Pro projects can be opened by the latest version of Adobe Premiere Pro. When you export an After Effects project as an Adobe Premiere Pro project, Adobe Premiere Pro uses the settings from the first composition in the After Effects project for all subsequent sequences. Keyframes, effects, and other properties are converted in the same way as when you paste an After Effects layer into an Adobe Premiere Pro sequence. (See Importing from After Effects and Adobe Premiere Pro.) 1 Choose File > Export > Adobe Premiere Pro Project. 2 Specify a filename and location for the project, and click Save. Note: You can also import Adobe Premiere Pro projects and sequences into After Effects, copy and paste between After Effects and Premiere Pro, and use Dynamic Link to exchange data between After Effects and Premiere Pro. Converting movies Convert footage items between video formats You can use After Effects to convert one kind of video to another. When converting video, keep in mind the following guidelines: • Changes in resolution may result in a loss of picture clarity, especially when up-converting from a standard- definition format to a high-definition format. • Changes in frame rate may require the use of frame blending to smooth out the interpolated frames. For longer footage items, the use of frame blending can result in very long render times. 1 Import the footage you’re converting into a composition using the preset of the format you’re converting to. Example: if you’re converting NTSC to PAL, add your NTSC footage item to a composition with the appropriate PAL composition settings preset. 2 Select the layer with the footage to be converted and choose Layer > Transform > Fit To Comp Width (or Fit To Comp Height). Note: For converting between two formats with the same frame aspect ratio, either of these two Fit commands does the same thing; if the frame aspect ratios differ (for example, going from 4:3 to 16:9), fitting to width or height chooses between cropping or letterboxing the resulting image. 3 Do one of the following: • If your footage has no scene cuts, choose Layer > Frame Blending > Pixel Motion. Pixel Motion provides the best results for interpolation of frames, but may require long rendering times. Last updated 11/4/2019

556 Rendering and exporting • If your footage has scene cuts, or if you want to sacrifice quality for shorter rendering times, choose Layer > Frame Blending > Frame Mix. 4 Choose Composition > Add To Render Queue. 5 In the Render Queue panel, next to Render Settings, choose the appropriate preset from the menu. For example, if you’re converting to DV footage, select DV Settings from the menu. 6 In the Render Queue panel, next to Output Module, choose the appropriate output module preset from the menu, or choose Custom to enter custom settings. For example, if you’re converting to DV PAL, choose the D1/DV-PAL output module preset with the audio sampling rate that you require. 7 Click the name of the output module preset that you chose in step 6 to select additional Format Options. 8 Specify a name and destination for the output file using the controls to the right of the Output To heading in the Render Queue panel. (See Specify filenames and locations for rendered output.) 9 Click the Render button to render your movie. Convert DV footage from PAL to NTSC using pulldown Because After Effects can easily convert film (24 fps) to video (29.97 fps) using 3:2 pulldown, you can perform a clean PAL-to-NTSC transfer by setting up 25-fps PAL video to act like 24-fps film. This lets you apply 3:2 pulldown to the footage when converting to 29.97 fps. This technique works especially well for progressive (noninterlaced) PAL video. 1 Create a new composition with the DV NTSC or DV NTSC Widescreen preset. 2 Import your DV PAL footage into the new composition. 3 Select the layer with the DV PAL footage, and choose Layer > Transform > Fit To Comp Width (or Fit To Comp Height). 4 Do one of the following: • To preserve audio synchronization but slightly lower the pitch, choose Layer > Time > Time Stretch, and then enter 95.904 in the Stretch Factor box. • To preserve audio pitch but not synchronization, or for clips without audio, right-click (Windows) or Control- click (Mac OS) the footage item in the Project panel, select Interpret Footage > Main, select Conform To Frame Rate, and then enter 23.976 in the Conform To Frame Rate box. 5 Choose Composition > Add To Render Queue. 6 Choose Custom from the Render Settings menu. 7 In the Render Settings pane, enable Field Rendering (choose the field order required by your output type), select any option from the 3:2 Pulldown menu, and then click OK. 8 Choose the output type from the Render Queue Output Module menu (for example, Microsoft DV NTSC 32 kHz). 9 Specify a name and destination for the output file using the controls to the right of the Output To heading in the Render Queue panel. (See Specify filenames and locations for rendered output.) 10 Click the Render button to render your movie. Scaling a movie down Several methods exist for producing a reduced-size movie from your composition, each with tradeoffs between speed and quality: Nest the composition Create a new composition at the smaller dimensions, and nest the large composition inside it. For example, if you create a 640x480 composition, place it in a 320x240 composition. Use the Fit To Comp command Last updated 11/4/2019

557 Rendering and exporting to scale the composition to fit the new smaller composition size: Press Ctrl+Alt+F (Windows) or Command+Option+F (Mac OS), and then collapse transformations by choosing Layer > Switches > Collapse. The resulting composition rendered at full resolution and best quality will have excellent image quality, better than if you had rendered using a reduced resolution. Resize the composition This method produces the highest quality reduced-size movie but is slower than nesting. For example, if you create a 640x480 composition and render it at full resolution, you can set the Resize value in the Output Module Settings dialog box to 50% to create a 320x240 movie. For a composition rendered at full resolution, the image quality is excellent when the Resize Quality is set to High. Note: Do not use resizing to change the vertical dimensions of a movie when field rendering is on. Resizing vertically mixes the field order, which distorts motion. Use either cropping or composition nesting if you need to vertically resize a field-rendered movie. Crop the composition This method is ideal for reducing the size of a movie by a few pixels. Use the Crop options in the Output Module Settings dialog box. Remember that cropping cuts off part of the movie, so objects centered in the composition may not appear centered unless the movie is cropped evenly on opposite edges. Note: In some special cases, After Effects will automatically crop rather than scale when creating an output movie with dimensions that don’t match the dimensions of the composition. For example, when creating a 720x480 movie with a pixel aspect ratio of 0.91 or 1.21 from a 720x486 composition, After Effects will crop instead of scale. Crop to a region of interest To render just a portion of the composition frame, define a region of interest in the Composition panel. Then, select the Region Of Interest option in the Output Module Settings dialog box before rendering. (See Region of interest (ROI).) Note: Cropping an odd number of pixels from the top of a field-rendered movie reverses the field order. For example, if you crop one row of pixels from the top of a movie with Upper Field First field rendering, the field-rendering order then becomes Lower Field First. Remember that if you crop pixels from the top of the movie, you need to add to the bottom row of the movie to maintain the original size. If you don’t mind losing one scan line, this technique gives you a way to output two movies from one render, each with a different field order. Render the composition at a reduced resolution This method is the fastest for creating reduced-size movies. For example, if you create a 640x480 composition, you can set the composition resolution to one half, reducing the size of the rendered composition to 320x240. You can then create movies or images at this size. The reduced resolution reduces the sharpness of the image and is best used for creating preview or draft movies. Note: When rendering at reduced resolution, set the quality of the composition to Draft. Rendering at Best quality while reducing resolution does not produce a clean image and takes longer to render than rendering at Draft quality. Scaling a movie up Increasing the size of the output from a rendered composition reduces the image quality of a movie and is not recommended. If you must enlarge a movie, to maintain highest image quality, enlarge a composition that was rendered at full resolution and highest quality using one of the following methods: Nest the composition Create a new composition at the larger dimensions and nest the smaller composition inside it. For example, if you create a 320x240 composition, you can place it in a 640x480 composition. Resize the composition to fit the new larger composition size, and then collapse transformations by choosing Layers > Switches > Collapse. The Last updated 11/4/2019

558 Rendering and exporting resulting composition rendered at full resolution and best quality will have better image quality than if you had resized the movie. However, this method also renders slower than if you created a composition and resized it. Note: To create a draft movie with specific dimensions, use both the Resize option and reduced resolution in the rendered composition. Resize the composition For example, if you create a 320x240 composition and render it at full resolution, you can set the Resize value in the Output Module Settings dialog box to 200% to create a 640x480 movie. For a composition rendered at full resolution, the image quality is usually acceptable. Note: Do not use resizing to change the vertical dimensions of a movie with field rendering. Resizing vertically mixes the field order, which distorts any motion. Use either cropping or composition nesting if you need to vertically resize a field-rendered movie. Crop the composition To enlarge a movie by a few pixels, increase the size using negative values for the Crop options in the Output Module Settings dialog box. For example, to increase the size of a movie by 2 pixels, enter –2 in the Cropping section of the Output Module Settings dialog box. Remember that negative cropping adds to one side of a movie, so objects originally centered in the composition may not appear centered when the movie is cropped. Note: Adding an odd number of pixels to the top of a field-rendered movie reverses the field order. For example, if you add one row of pixels to the top of a movie with Upper Field First field rendering, the field-rendering order then becomes Lower Field First. Remember that if you add pixels to the top of the movie, you need to crop from the bottom row of the movie to maintain the original size. Adobe Photoshop provides fine control over resampling methods used for scaling of images. For fine control of resampling, you can export frames to Photoshop to change the image size and then import the frames back into After Effects. For a list of plug-ins that provide high-quality scaling—including some designed to create high-definition images from standard-definition sources—see the Toolfarm website. For a script that scales multiple compositions simultaneously, see the AE Enhancers forum. Create a composition and render source footage items simultaneously You can simultaneously create a composition from source footage and prepare it for rendering. This process is useful when you want to change some characteristic of the source footage, such as frame rate or compression method, and have that rendered version available in your project. 1 Drag one or more footage items from the Project panel to the Render Queue panel, or select the footage items in the Project panel and do one of the following: • Choose Composition > Add to Render Queue. • Press Ctrl+Shift+/ or Ctrl+M(Windows) or Command+Shift+/ or Command+M (Mac OS). Note: If the Use System Shortcut Keys option is enabled in General preferences (Mac OS), the shortcut is Ctrl+Cmd+M. 2 After Effects creates both a new item in the render queue and a new composition in the Project panel for each footage item. Last updated 11/4/2019

559 Rendering and exporting 3 Adjust the render settings as desired, and click Render. Introduce 3:2 pulldown If you are creating output for film that’s been transferred to video, or if you want to simulate a film look for animation, use 3:2 pulldown. Footage items that were originally film transferred to video and had 3:2 pulldown removed when imported into After Effects can be rendered back to video with 3:2 pulldown reintroduced. You can introduce 3:2 pulldown by choosing one of five different phases. (See Remove 3:2 or 24Pa pulldown from video.) Note: It is important to match the phase of a segment that had 3:2 pulldown removed if it will be edited back into the video footage it came from. 1 In the Render Queue panel, select the render item and then click the underlined text next to the Render Settings heading. 2 For Field Render, choose a field order. 3 For 3:2 Pulldown, choose a phase. 4 Select other settings as appropriate, and then click Render. Chris and Trish Meyer provides an overview of 3:2 pulldown in an article on the Artbeats website. Test field-rendering order When you render a composition containing separated footage, set the Field Rendering option to the same field order as your video equipment. If you field-render with the incorrect settings, the final movie may appear too soft, jerky, or distorted. A simple test can determine the order in which your video equipment requires fields. Note: The field order might get altered if you change the hardware or software of your production setup. For example, changing your device control software or VCR after setting the field order can reverse your fields. Therefore, any time you change your setup, test the field-rendering order. The test takes about 15 minutes and involves creating two movie versions of the same composition (one rendered with Upper Field First and one with Lower Field First), and then playing the movies to see which choice looks right. 1 Create a simple composition with the correct frame size and frame rate. Choose an NTSC or PAL preset in the Composition Settings dialog box, and make the composition at least 3 seconds long. 2 Within the composition, make a layer that is a small rectangular solid. The layer can be any color as long as it contrasts sharply with the composition background. You may want to add a title (such as “Upper Field First”) to the solid to make identification of the movie easier. 3 Apply some fast movement to the solid using keyframes in its Position property. Set keyframes from the upper-left of the Composition panel to the lower-right for 1 second. 4 Save the project, and then drag the composition to the Render Queue panel. 5 Click the underlined Render Settings name, and then choose Upper Field First from the Field Render menu. 6 Click OK, and then click Render to make the movie. 7 In the composition, change the color of the solid in the Composition panel, and add a new title, such as “Lower Field First”, to identify it. 8 Render the composition again, choosing Lower Field First from the Field Render menu in the Render Settings dialog box. Last updated 11/4/2019

560 Rendering and exporting 9 Record both movies to the same device. 10 Play both movies. One movie will look distorted and have jumpy horizontal motion or shape distortion during vertical motion. The other movie will play back smoothly, with sharply defined edges. Use the field order for the smooth-playing movie whenever you render movies with that particular hardware configuration. Automated rendering and network rendering Automating rendering with aerender The executable file aerender.exe is a program with a command-line interface with which you can automate rendering. The executable file is located in the same folder as the primary After Effects application. The default locations for this file are: • Windows: \\Program Files\\Adobe\\Adobe After Effects CC\\Support Files • Mac OS: /Applications/Adobe After Effects CC You can use the aerender application to perform rendering operations on multiple computers as part of a render farm, or you can use the aerender application on a single computer as part of a batch operation. You use the program by entering the command aerender on the command line (or in a batch script), followed by a series of optional arguments. Some of the arguments are simple options that take no arguments of their own (for example, - reuse), whereas others take arguments of their own (for example, -project project_path). Enter the command aerender -help to show usage information. The version and build number of the application are written to standard output (stdout). The render may be performed either by an already running instance of After Effects or by a newly started instance. By default, aerender starts a new instance of After Effects, even if one is already running. To instead use the currently running instance, use the –reuse argument. This example command tells After Effects to render frames 1 through 10 of Composition_1 in project_1.aep to a numbered sequence of Photoshop files using a multi-computer render: aerender -project c:\\projects\\project_1.aep -comp \"Composition_1\" -s 1 -e 10 -RStemplate \"Multi-Machine Settings\" -OMtemplate \"Multi-Machine Sequence\" -output c:\\output\\project_1\\frames[####].psd To render just Composition_1 to a specified file, enter this command: aerender -project c:\\projects\\project_1.aep -comp \"Composition_1\" -output c :\\output\\project_1\\project_1.avi To render everything in the render queue with current settings in the project file, enter this command: aerender -project c:\\projects\\project_1.aep Last updated 11/4/2019

Rendering and exporting 561 Argument –help Description –version –v verbose_flag Print usage message. –reuse Display the version number of aerender to the console. Does not render. –mem_usage image_cache_percentmax_mem_percent verbose_flag specifies the kind of messages reported: –project project_path –comp comp_name ERRORS: Reports only fatal and problem errors. –s start_frame ERRORS_AND_PROGRESS: (default) Reports errors and progress of –e end_frame rendering. –i increment Reuse the currently running instance of After Effects (if found) to –OMtemplate output_module_template perform the render. When an already running instance is used, –RStemplate render_sett ings_template aerender saves preferences to disk when rendering has completed, but does not quit After Effects. If this argument is not used, aerender starts a new instance of After Effects, even if one is already running. It quits that instance when rendering has completed, and does not save preferences. image_cache_percent specifies the maximum percentage of memory used to cache already rendered images and footage. max_mem_percent specifies the total percentage of memory that After Effects can use. For both values, if installed RAM is less than a given amount (n gigabytes), the value is a percentage of the installed RAM, and is otherwise a percentage of n. The value of n is 2 GB for 32- bit Windows, 4 GB for 64-bit Windows, and 3.5 GB for Mac OS. project_path is a file path or URI specifying a project file to open. If this argument is not used, aerender works with the currently open project. If no project is specified and no project is open, the result is an error. comp_name specifies a composition to render. If the composition is in the render queue already, then the first instance of that composition in the render queue is rendered. If the composition is in the project but not in the render queue, then it is added to the render queue and rendered. If this argument is not used, aerender renders the entire render queue; in this case, only the –project, –log, –output, –v, – mem_usage, and –close arguments are used, and all other arguments are ignored. start_frame is the first frame to render. If this argument is not used, aerender uses the start frame in the file. end_frame is the last frame to render. If this argument is not provided, aerender uses the end frame in the file. increment is the number of frames to advance before rendering a new frame. A value of 1 (the default) causes normal rendering of all frames. Higher values render a frame and use it increment times in output, and then skip ahead increment frames to begin the cycle again. Higher values result in faster renders but choppier motion. output_module_template is the name of a template to apply to the output module. If the template does not exist, using this argument causes an error. If this argument is not used, aerender uses the template already defined for the output module. render_settings_template is the name of a template to apply to the render item. If the template does not exist, using this argument causes an error. If this argument is not used, aerender uses the render template already defined for the item. Last updated 11/4/2019

562 Rendering and exporting –output output_path output_path is a file path or URI specifying the destination for the final –log log_file_path output file. If this argument is not used, aerender uses the path –sound sound_flag defined in the project file. –close close_flag log_file_path is a file path or URI specifying the location of the log file. -rqindex index_in_render_queue If this argument is not used, aerender uses standard output (stdout). -mp -continueOnMissingFootage If sound_flag is ON, a sound is played when rendering is complete. Default is OFF. close_flag specifies whether to close the project when rendering is complete, and whether or not to save changes: DO_NOT_SAVE_CHANGES: (default) The project is closed without saving changes. SAVE_CHANGES: The project is closed and changes are saved. DO_NOT_CLOSE: The project is left open if using an already-running instance of After Effects. (New instances of After Effects must always quit when done.) -rqindex works just like -comp, except that it won’t create a render item from the composition automatically. More processes may be created to render multiple frames simultaneously, depending on system configuration and preference settings. (See Memory & Multiprocessing preferences.) The render operation continues even if a source footage item is missing. Lloyd Alvarez provides a script on his After Effects Scripts website that takes items that are ready to render in the render queue and sends them to render in the background using aerender. Network rendering with watch folders and render engines You can render one or more compositions from a project using multiple computers over a network in a fraction of the time that a single computer would require. Network rendering involves copying the project and source files to a networked folder, and then rendering the project. A network of computers used together to render a single composition is sometimes called a render farm. Render farming is when a network of computers is used together to render a single composition. You can set this up to work with render-only versions of After Effects called render engines. You can install render engines in the same manner as the full version of the application. You run the render engine using the Adobe After Effects Render Engine shortcut in the Adobe After Effects CC folder. For more information, see same composition Setup and installation. You cannot use a watch folder and multiple render engines to simultaneously render a single movie file. However, in render farming, you can use multiple render engines to render a movie as a sequence of still-image files. You can then use a post-render action to create a single movie file from that still-image sequence. For more information, see Post- render actions. Network considerations When working with multiple render engines on multiple computers, keep in mind the following guidelines: • When possible, identify folders using absolute file paths so that the paths are correctly identified for all render engines. Identifying folders using absolute file paths may mean mapping network drives to a particular drive letter on all computers (for example, H:\\renders\\watch\\). Avoid using relative paths (for example, \\\\renders\\watch). Last updated 11/4/2019

563 Rendering and exporting • Each Macintosh computer monitoring the watch folder must have a unique name. Because the default names of computers are often identical, you should rename your computers to not use the default name. • Make sure that all servers and clients (computers monitoring the watch folder) have hard drives with unique names. • Do not use the same computer to serve a watch folder and to run After Effects in Watch Folder mode. Use a dedicated server that’s accessible to all render engines to serve your watch folder. • Do not render to or initiate Watch Folder mode on the root of a volume or a shared folder that appears as the root when viewed from another computer. Specify a subfolder instead. Also, avoid using high-ASCII or other extended characters and slashes in filenames. For multiple-computer rendering, After Effects includes the Multi-Machine sample template that you can use as a starting point. When rendering across a network that includes volumes using different network or operating systems, such as Windows, Mac OS, Novell, and UNIX, make sure that you specify output files using a file-naming convention that’s compatible with all rendering or destination volumes. Project considerations Make sure that you install all fonts, effects, and encoders (compressors) used in the project on all computers monitoring the watch folder. If a computer monitoring the watch folder can’t find fonts, effects, or encoders used in a project, the render fails. When you install an After Effects render engine on a computer, it contains all the plug-ins included with After Effects. If a composition uses a plug-in from another manufacturer, the plug-in must be present on all computers to render the composition. However, support for network rendering varies among plug-in manufacturers. Before you set up a network to render effects created by third-party plug-ins, see the documentation for your plug-ins or contact the plug- in manufacturers and get answers to the following questions: • Does the license agreement for the plug-in allow installing multiple copies on a network for the purposes of rendering? • Are there any other limitations or tips that apply to using the plug-in for network rendering? Collect Files folder considerations When you use the File > Collect Files command, files relevant to a project are copied to a single folder. This folder includes a copy of the project file, a render control file (RCF), and other files, depending on the options you choose in the Collect Files dialog box. If you save the Collect Files folder to a networked computer other than a server, don’t run a render engine on that computer. Avoid saving the Collect Files folder to a local disk, the root level of a disk (such as C: in Windows or the Macintosh HD in Mac OS), or a shared folder, all of which can signify different locations to each render engine. All render engines must interpret the path in the same way. Once the collected files appear in the watch folder, all monitoring render engines start rendering automatically. If you prefer, you can use the Collect Files command to store compositions and their source footage to a specified location and then initiate the watch-folder rendering process later. Doing so renders the projects in alphabetical order, rather than the order in which they were saved to the location. Last updated 11/4/2019

564 Rendering and exporting Track dependencies of a watch-folder render You can track render dependencies when you render over a network by setting Post-Render Action options. When you set these options, After Effects confirms that all of the items that have to be rendered are ready and available. For example, if one item depends on another to render, and the first has not finished rendering or has received an error, the second does not render. You can use this process to render a single QuickTime or AVI movie from a watch-folder render. The movie is created on only one computer. Note: This procedure assumes that you have already created a multiple-computer watch-folder. 1 In the Render Queue panel, drag the output module to the Project panel. After Effects creates a placeholder for that item’s output. 2 Drag the placeholder back to the Render Queue panel. 3 Set the render settings and output module settings for the placeholder, and click Render. Start in watch-folder mode Watch-folder mode applies only to rendering from a folder on your local computer. • To start After Effects in watch-folder mode automatically, save a project with the filename Watch This Folder.aep. After Effects watches the folder containing the project if you open that project. • To start After Effects in watch-folder mode when you start your computer, create a shortcut (Windows) or alias (Mac OS) to the Watch This Folder.aep project and move it to your Startup folder (Windows) or your Startup Items folder (Mac OS). After Effects watches the folder containing the project if you open that project. • (Windows only) To start After Effects in watch-folder mode from the command line, choose Start > Run, and then enter the following, modifying the application path to the exact name of the folder in which you installed After Effects, and replacing C:\\[temp] with the path to your watch folder: \"C:\\Program Files\\Adobe\\Adobe After Effects CC\\Support Files\\afterfx.exe\" -wf C:\\[temp] To start the After Effects render engine rather than the full version of After Effects, use the -re option with the command. Note: You can also use this command line in batch files. Render farming - Render a still-image sequence with multiple computers Render farming is when a network of computers is used together to render a single composition. You can set this up to work with render-only versions of After Effects called render engines. Render farming helps reduce the time a single machine takes to export a composition. You can use multiple computers and multiple copies of After Effects to render a composition across a network. You can use multiple computers to render only still-image sequences; you cannot use multiple computers to render a single movie. Aharon Rabinowitz provides a video tutorial on the Creative COW website that goes through and explains the steps for rendering a still-image sequence with multiple computers. Set up the network Follow the process illustrated in the image to understand the requirements to set up the network. Last updated 11/4/2019

565 Rendering and exporting A Computer with full version of After Effects B Save a project and all source files to a folder on a server C Computers with the render engine installed D Open the project and render a still-frame sequence to a designated output folder on the server You can use any number of computers for rendering; in general, the more computers, the faster the rendering. However, if too many computers are used across a busy network, network traffic may slow down the entire process. You can detect network slowdown by observing the time spent in the Compressing & Writing stage in the Current Render section of the Render Queue panel. Note: Adobe does not provide technical support for general network configuration; consult your network administrator. Render a still-image sequence with multiple computers Important points in the process of rendering a still image sequence with multiple computers: • To render a still-image sequence with multiple computers, you can use any number of computers. • When you render a still-image sequence with multiple computers, rendering in each copy of After Effects starts at approximately the same time. • If your queued render items are set to Skip Existing Files (a Render Settings option), the render process skips the existing frames or frames in progress. • Multiple computers can render the project simultaneously, writing the still-image sequence to a single folder. To render a still-image sequence, follow these steps: 1 Install After Effects on each computer that is used to render the project. Make sure that you have the same fonts installed on each computer. Note: Do not share plug-ins across a network. Make sure that you have a copy of the plug-ins folder on each computer that is running After Effects. When using third-party plug-ins, also be sure that the same plug-ins are available on all computers and that you have sufficient licenses for the plug-ins. 2 Open the project on one computer and select Composition > Add To Render Queue. 3 In Render Queue panel, specify a format in the Output Module area, and specify a folder in the Output To area. This folder must be available for all the computers that are rendering. 4 In the Render Queue panel, select Skip Existing Files (allow multi-machine rendering) in the Render Settings section so that multiple computers do not render the same frames. Do not use multiple output modules for one render item when using skip existing files. 5 Save the project on the computer where you opened it in step 2. 6 On each computer that will be rendering, open and save the project. Saving the project ensures that After Effects records the new relative paths to each computer in the following step. Last updated 11/4/2019

566 Rendering and exporting 7 Unless the network can handle large file transfers rapidly, copy the project file and all its source footage to each rendering computer. 8 Open the Render Queue panel on each computer and click Render. You do not need to start rendering on each computer simultaneously, but to ensure equal workloads, start them at approximately the same time. As each computer finishes rendering a frame, After Effects searches the Output folder for the next unrendered frame and starts rendering again. 9 You can stop and start any computer at any time. However, if you stop a computer without starting it again, the frame that it was rendering may not be finished. If one or more computers stop during rendering, starting any one computer ensures that all frames in the sequence get rendered. Run aerender in non-royalty bearing mode After Effects CS5.5 had to be serialized on render-only machines due to licensing issues. In After Effects CS6 and later, you can now run aerender or use Watch Folder in a non-royalty bearing mode, so serialization not required. To ensure that After Effects is running in non-royalty bearing mode, place a blank file named ae_render_only_node.txt into the following location: 1 Install After Effects on the render-only machine. • Mac locations: /Users/<username>/Documents/ /Users/Shared/Adobe/ • Windows locations: C:\\\\Users\\\\<username>\\\\Documents C:\\\\Users\\\\Public\\\\Documents\\\\Adobe Segment settings Segment settings are in the Output preferences category. Choose Edit > Preferences > Output (Windows) or After Effects > Preferences > Output (Mac OS). After Effects can render sequences and movie files into segments that are limited to a specified number of files or by file size. This is useful when preparing a movie for a medium such as CD-ROM, for which file or folder size may need to be limited to chunks of 650 MB or less. Use the Segment Video-only Movie Files At value to set the maximum size for segments in megabytes. Use the Segment Sequences At value to set the maximum number of still-image files in a folder. If you are exporting a movie that is larger than the maximum file size for your hard disk formatting scheme, then you can set the Segment Video-only Movie Files At value to a value under this maximum. Hard disks formatted for Windows can be formatted using the FAT, FAT32, or NTFS scheme. The maximum file size in the FAT scheme is 2 GB, and the maximum file size in the FAT32 scheme is 4 GB. The maximum size for a file for NTFS is large (approximately 16 terabytes), so you are unlikely to reach this limit with a single movie. Only movies that do not contain audio can be segmented. If an output module includes audio, the Segment Video-only Movie Files At preference is ignored for that item. Last updated 11/4/2019

567 Rendering and exporting The Segment Sequences At preference is ignored for any render item for which Skip Existing Files is selected in the render settings. (See Render settings reference.) Note: After Effects won’t render and export a segmented movie to the root directory (e.g., C:\\). To render and export a segmented movie, choose an output directory other than the root directory. (See Specify filenames and locations for rendered output.) Using the GoPro CineForm codec in After Effects About the GoPro CineForm codec The GoPro CineForm codec is a cross-platform intermediate codec that is commonly used in film and television workflows that use HD or higher resolution media. In the latest version of After Effects CC and Adobe Media Encoder CC, the GoPro CineForm codec can be used to natively decode and encode QuickTime files (.mov). Hence you do not need to install additional codecs to create and use QuickTime files. GoPro CineForm codec settings There are five compression quality settings and two pixel format settings that you can use to adjust your output when using the GoPro CineForm codec. To export your After Effects projects with the GoPro CineForm codec, do the following: 1 Select a project in the Render Queue and click the Output Module setting. 2 Choose QuickTime as the output format in the Format drop-down list and click Format Options. Last updated 11/4/2019

568 Rendering and exporting 3 Choose GoPro CineForm as the video codec in the QuickTime Options dialog box. Adjust the compression settings using the Quality slider under the Basic Video Settings. The slider can be moved from a range of 1 to 5, with 1 for the Low setting and 5 for Film Scan 2 setting. The default value is 4 (Film Scan). 1. Low 2. Medium 3. High 4. Film Scan 5. Film Scan 2 See the Understanding CineForm Quality settings article on the CineForm website for detailed information about this setting. 4 The GoPro CineForm codec can encode pixels in YUV 4:2:2 at 10 bits per channel, or RGBA 4:4:4:4 at 12 bits per channel. Last updated 11/4/2019

569 Rendering and exporting The encoded pixel format is based on the color depth and alpha channel settings that you choose in the Output Module Settings dialog box. There are three Channels settings that can be set, RGB, Alpha, and RGB+Alpha: • Set Channels to RGB or Alpha to encode to 10bpc YUV. In this case, Depth can only be set to Millions Of Colors. • Set Channels to RGB+Alpha to encode to 12bpc RGBA. In this case Depth can be set to Millions of Colors+ or Trillions of Colors+. Note: After Effects renders the composition at the color depth specified in the Project and Render Settings, and the GoPro CineForm encoder will resample the frames to 10-bit YUV or 12 bpc RGBA as appropriate. 5 Click Render in the Render Panel to begin rendering your project with the GoPro CineForm settings. GoPro CineForm settings in Adobe Media Encoder When you want to output to QuickTime format in Adobe Media Encoder using the GoPro CineForm encoder, there are three presets that you can use in the Export Settings dialog box: 1 GoPro CineForm RGB 12-bit with alpha at Maximum Bit Depth 2 GoPro CineForm RGB 12-bit with alpha 3 GoPro CineForm YUV 10-bit Note: Last updated 11/4/2019

570 Rendering and exporting The frames may be rendered at a higher or lower quality by Adobe Media Encoder, depending on the sources in use and whether the Maximum Bit Depth option is enabled. The GoPro CineForm encoder will resample the frames to 10 bpc YUV or 12 bpc RGBA as appropriate. Other considerations • You can edit the basic video settings, such as Frame Rate and Aspect ratio by unchecking the boxes next to each of these settings. For unsupported sizes such as GoPro 2.7K, change the resolution settings and down-scale to 1080,2K, or 4K or upscale to 6K. • Due to the frame size limitations, frame width sizes should be divisible by 16, and frame height sizes should be divisible by 8, regardless of bit depth. For example, the frame size of GoPro 2.7 is 2704x1524 and hence this is currently not supported as its width of 1524 results in a partial frame size of 95.25. Last updated 11/4/2019

571 Chapter 15: Expressions and automation Expression basics When you want to create and link complex animations, but want to avoid creating tens or hundreds of keyframes by hand, try using expressions. An expression is a small piece of code, much like a script— that you can plug into your After Effects projects, that evaluates to a single value for a single layer property at a specific point in time. However, scripts tell an application to do something, an expression says that a property is something. If this sounds complex, watch the following video to kickstart exploring expressions. Video Note: Two sources of example expressions are the Expression Sampler template project (File > Browse Template Projects) and the animation presets in the Behaviors category (Animation > Browse Presets). Use the expression The expression language is based on the standard JavaScript language, but you do not need to know JavaScript to use expressions. You can create expressions by using the pick whip or by copying simple examples and modifying them to suit your needs. To open the expression controls, pick the layer property you want to affect and hold Option on Mac or Alt on PC while you click the keyframe (stopwatch) icon. The expressions box displays, you can use it to write. edit expfll then see the expression options including a place to write or paste your expression. You can also use the pick whip tool to reference another layer for your expression. And you can enable or disable your expression here without having to delete it. Let's look at an example of a common and simple expression known as wiggle. WIGGLE If you want to layer to change positions randomly over time, you can change You could go into the position and set keyframes for different positions over the course of the timeline. You can also paste the below value in your timeline. wiggle(10,20) The first number represents the number of wiggles per second, and the second number represent the intensity or value of the wiggle. Tip: For a quicker wiggle effect, set both the values high. Last updated 11/4/2019

572 Expressions and automation Wiggle Animation presets can include expressions, or even consist entirely of an expression. Animation presets that use expressions instead of keyframes are sometimes called behaviors. After you add an expression to a property, you can continue to add or edit keyframes for the property. An expression can take the value of a property as determined by its keyframes and use that as input to generate new, modified values. For example, the following expression on the Rotation property of a layer adds 90 degrees to the value of the Rotation property, in addition to the keyframed motion: value + 90 Some methods—such as wiggle—operate directly on the keyframed property values. (See Property attributes and methods (expression reference).) The following expression on the Position property of a layer preserves the keyframed motion of the layer and causes it to wiggle a little: wiggle(10, 10) Note: Using the wiggle expression is often much faster and easier than using the Wiggler. When you are animating text, you can use the Expression selector to specify how much you want an animator property to affect each text character. You can add one or more Expression selectors to an animator group, and that animator group can contain one or more properties. While you are editing an expression, previews of all kinds are suspended; a red bar appears at the bottom of panels that are waiting for you to exit text-editing mode. The values for a property that contains an expression appear in red or pink type. A good way to begin working with expressions is to create a simple expression with the pick whip and then adjust the behavior of the expression using simple math operations, such as those listed in the following table: Last updated 11/4/2019

573 Expressions and automation Symbol Function + Add - Subtract / Divide * Multiply *-1 Perform opposite of original, such as counterclockwise instead of clockwise Note: Replace the argument names written by the Expression Language menu with actual values. Jeff Almasol provides a script that automatically processes expressions, making specified changes. For example, the script can be used to automatically remove or enable disabled expressions. Expression Editor You can customize the code editor interface of the expression editor, including highlighting JavaScript syntax with custom colors, line numbers, code folding, and auto-complete. To customize these options, select Preferences > Scripting and Expressions. Scripting and Expressions dialog Last updated 11/4/2019

574 Expressions and automation See the example below to understand how the editor works: Example 1: Display error in your code snippet. 1 Open a comp in After Effects that has expression snippets. 2 In the Timeline panel, select a layer and do Alt+Click. It displays the expression in the expression editor field. Expression Editor field 3 Click the editor field to enter the edit mode. Click in the editor to enable editing in the Expression Editor 4 In this example, select MILEin the first line, and change it to mile in lowercase. This triggers an error in the code, and After Effects displays an error message within the code snippet. Error message displayed in the code snippet After Effects also displays an error banner with details about the Line number where the error occurs. Last updated 11/4/2019

575 Expressions and automation Error banner Example 2: Auto-suggestions based on the commonly used components. 1 In the same expression, change the layer name from mile to MILE. 2 As you type, After Effects displays a drop-down list with a set of suggestions that After Effects pulls from the layer names of the project. Layer name auto-suggestions Composition names, layer names, footage names, and effect names are all pulled into the autoComplete and shown in the correct context with their respective comp(), layer(), footage(), and effect() methods. This allows you to keep your expression active while referencing items in the project. You do not need to scroll the Timeline or open other panels to refer to properties or items using the pickwhip. Add, disable, link, or remove an expression • To add an expression to a property, select the property in the Timeline panel and choose Animation > Add Expression or press Alt+Shift+= (Windows) or Option+Shift+= (Mac OS); or Alt-click (Windows) or Option-click (Mac OS) the stopwatch button next to the property name in the Timeline panel or Effect Controls panel. • To link a set of properties across layers and compositions, use property links. Select any one property or set of properties and choose Edit > Copy With Property Links or Edit > Copy With Relative Property Links, and then paste those properties on any layer in a composition. The pasted properties remain connected to the layer from which the properties were copied, such that any change made to the original property is reflected in all of the instances of the pasted property links. You can even copy an entire layer with property links and paste it to create duplicates that follow the changes made to the original. The command Copy With Relative Property Links, works like the command Copy With Property Links, except that the Copy With Relative Property Links command creates expressions that do not reference the source composition by name. This maintains a relative link between the layer with the expression and the composition containing that layer. This can be useful when, for example, you want to move expression-rigged layers from one composition to another but let the layers reference a control layer only in the same composition. The expressions created using the Copy With Relative Property Links command are identical to those created using the expression pick whip. Last updated 11/4/2019

576 Expressions and automation The result of copying a layer’s Position property with the Copy With Relative Property Links command is as follows: thisComp.layer(\"control_layer\").transform.position The result of copying a layer’s Position property with the Copy With Property Links command is as follows, which specifically references the layer’s source composition in the expression: comp(\"source_comp\").layer(\"control_layer\").transform.position • To temporarily disable an expression, click the Enable Expression switch . When an expression is disabled, a slash appears through the switch . • To remove an expression from a property, select the property in the Timeline panel and choose Animation > Remove Expression, or Alt-click (Windows) or Option-click (Mac OS) the stopwatch button next to the property name in the Timeline panel or Effect Controls panel. Edit an expression with the pick whip If you are not familiar with JavaScript or the After Effects expression language, you can still take advantage of the power of expressions by using the pick whip. You simply drag the pick whip from one property to another to link the properties with an expression, and the expression text is entered in the expression field at the insertion point. If text is selected in the expression field, the new expression text replaces the selected text. If the insertion point is not in the expression field, the new expression text replaces all text in the field. You can drag the pick whip to the name or value of a property. If you drag to the name of a property, the resulting expression displays all the values as one. For example, if you drag the pick whip to the name of the Position property, an expression like the following appears: thisComp.layer(\"Layer 1\").transform.position If you drag the pick whip to one of the component values of the Position property (such as the y value), an expression like the following appears, in which both the x and y coordinates of the property are linked to the y value of the Position property: temp = thisComp.layer(\"Layer 1\").transform.position[1]; [temp, temp] If the layer, mask, or effect that you drag the pick whip to does not have a unique name in its local context, After Effects renames it. For example, if you have two or more masks named “Mask” on the same layer, and you drag the pick whip to one of them, After Effects renames it “Mask 2.\" The format of expressions created by the pick whip is determined by the Expression Pick Whip Writes Compact English preference (Edit > Preferences > General (Windows) or After Effects > Preferences > General (Mac OS)). By default, the pick whip creates compact English expressions, which use the names for properties as they appear in the Timeline panel for the properties within an expression. Because these names are coded into the application and never change, these expressions can work when After Effects is running in another language. Any property names that you can change are enclosed in double quotation marks and remain the same in any language. If you don’t plan on sharing your projects across languages, you can deselect this preference. This preference does not affect effect names or effect properties. Here is an example in compact English: thisComp.layer(\"Layer 1\").transform.position Here is the same expression, not in compact English: thisComp.layer(\"Layer 1\")(\"Transform\")(\"Position\") Note: Last updated 11/4/2019

577 Expressions and automation Because the default is to use compact English, this document uses compact English in most examples and illustrations. 1 Drag the pick whip to another property in the Timeline panel or Effect Controls panel. 2 Optionally, modify the default expression in the expression field. Note: If you use the pick whip to create an expression to refer to a layer, and that layer has the same name as another layer in the same composition, then the targeted layer’s name changes. The new layer name is the old layer name with a numeral at the end. This change is necessary to ensure that the expression unambiguously refers to a single layer in the composition. Edit an expression manually 1 Enter text-editing mode by clicking in the expression field. Note: When you enter text-editing mode, the entire expression is selected. To add to the expression, click within the expression to place the insertion point; otherwise, you will replace the entire expression. 2 Type and edit text in the expression field, optionally using the Expression Language menu. To see more of a multiline expression, drag the bottom or top of the expression field to resize it. 3 To exit text-editing mode and activate the expression, do one of the following: • Press Enter on the numeric keypad. • Click outside the expression field. Show expressions and the expression graph In Graph Editor mode, the single expression field appears as a resizable box at the bottom of the Graph Editor and shows only the expression for the selected property. To show multiple expression fields simultaneously, the Timeline panel must be in layer bar mode. To toggle between layer bar mode and Graph Editor mode, press Shift+F3. • To show only properties with expressions, select one or more layers, and then press EE. • To show the expression field in the Graph Editor, choose Show Expression Editor from the Choose Graph Type And Options menu at the bottom of the Graph Editor. When you add an expression to a property, the expression editor is shown, regardless of this setting. To resize the expression field, drag its bottom edge up or down. • To see how an expression changes the value or velocity graph, click the Show Post-Expression Graph button while showing the value or velocity graph in the Graph Editor. Last updated 11/4/2019

578 Expressions and automation The dimly colored graph displays the value or velocity before the expression is applied, and the brightly colored graph displays the value or velocity after the expression is applied. Turning on the graph overlay for the Position property also changes the motion path display in the Composition panel so that you can see the expression-affected path. You can use the search field in the Timeline panel to search expressions as well as other components of a property. If the search string appears in an expression, the property and its containing property groups and layer are shown in the filtered set of search results. Write expressions for source text The Source Text property of a text layer is interpreted by expressions as a JavaScript String. You can use the pick whip to retrieve the source text from another text layer; however, only the style of the first character of the destination layer is used. In the Essential Graphics Panel, in the Source Text Properties menu, you can select the Use layer as fallback text box. When checked on, you can select a comp/subcomp and a shape or clip layer to determine an alternate text box for editing the text in Premiere Pro Program Monitor. For more information on the JavaScript String object, consult a JavaScript reference resource. You can use \"\\r\" in a string expression to start a new line of text. For example, to copy the original text from one layer onto the same layer and repeat it in all uppercase characters on a new line, use the following expression: text.sourceText + \"\\r\" + text.sourceText.toUpperCase() Adding a text layer to a composition and adding an expression to its Source Text property can be a great way to examine the property values of other layers. For example, the following expression on a Source Text property reports the name and value of the Opacity property for the next layer in the layer stacking order: thisComp.layer(index + 1).name + \"\\rOpacity = \" + thisComp.layer(index + 1).opacity.value Last updated 11/4/2019

579 Expressions and automation The following example reports the name of the footage item used as the source of the topmost image layer in the stacking order at the current time that has its Video switch set. source_footage_name = \"\"; for (i = 1; i <= thisComp.numLayers; i++){ if (i == index) continue; my_layer = thisComp.layer(i); if (! (my_layer.hasVideo && my_layer.active)) continue; if (time >= my_layer.inPoint && time < my_layer.outPoint){ try{ source_footage_name = my_layer.source.name; }catch(err1){ source_footage_name = my_layer.name } break; } } source_footage_name Aharon Rabinowitz provides a video tutorial and example expressions on Red Giant TV that show how to animate a video game score with the Source Text property and a Slider effect (an Expression Controls effect). Access and edit text properties with expressions You can use expressions to control text styling as well as the text itself. Work with any text expression as well as with Motion Graphics Templates. You can link multiple titles together and update their styling at once, which is used for title design, especially main and end titles. For more information, see Use expressions to edit and access text properties. Add comments to an expression If you write a complex expression and intend for you or someone else to use it later, you should add comments that explain what the expression does and how its pieces work. • Type // at the beginning of the comment. Any text between // and the end of the line is ignored. For example: // This is a comment. For examples of this type of comment, see Expression example: Fade opacity of a 3D layer based on distance from camera. • Type /* at the beginning of the comment and */ at the end of the comment. Any text between /* and */ is ignored. For example: /* This is a multiline comment. */ For examples of this type of comment, see Save and reuse expressions. Save and reuse expressions Once you have written an expression, you can save it for future use by copying and pasting it into a text-editing application or by saving it in an animation preset or template project. However, because expressions are written in relation to other layers in a project and may use specific layer names, you must sometimes modify an expression to transfer it between projects. You can define your own functions within expressions using normal JavaScript function syntax. In this example, a function is defined that calculates the average of two values, and the last line uses this function: Last updated 11/4/2019

580 Expressions and automation function average(a, b) { return (a + b) / 2; } average(position, thisComp.layer(1).position); Note: You must define each function fully within each expression in which it is used. There is no global library of functions that you can add to. If you want to save an expression for use in another project, you should add comments to the expression. (See Add comments to an expression.) You should also use variables so that you can change a value in one place rather than having to change it in several places. For example, this expression has a multiline comment at the beginning that explains what the expression does and a short comment after a variable is declared and initialized that tells what the variable is for: /* This expression on a Source Text property reports the name of a layer and the value of its Opacity property. */ var myLayerIndex = 1; // layer to inspect, initialized to 1, for top layer thisComp.layer(myLayerIndex).name + \": \\rOpacity = \" + thisComp.layer(myLayerIndex).opacity.value You can save an animation preset that includes an expression and reuse it in other projects, as long as the expression does not refer to properties that don’t exist in the other projects. When you save a preset in which a property has an expression but no keyframes, only the expression is saved. If the property has one or more keyframes, the saved preset contains the expression along with all keyframe values. You can copy an expression from a layer property, with or without the keyframes for the property. • To copy an expression and keyframes from one property to other properties, select the source layer property in the Timeline panel, copy the layer property, select the target layer properties, and paste. • To copy an expression from one property to other properties without copying keyframes, select the source property, choose Edit > Copy Expression Only, select the target properties, and paste. Copying an expression without keyframes is useful when you want to simultaneously copy multiple expressions and paste them onto one or more new layers, or when you want to copy one expression and paste it onto more than one layer. Note: As with pasting keyframes and other items, you can often paste the item into the target layer and rely on After Effects to determine which property should be the target of the paste operation. For example, this works for copying Position properties from one layer to another, but you must select the target property yourself if you are pasting an expression from a Position property into a Scale property. Use an Expression Controls effect to add a control that you can use to manipulate the values of one or many properties by linking the property to the control using expressions. A single control can affect several properties at once. Last updated 11/4/2019

581 Expressions and automation You can use them to control other parameters using expressions. You can add a slider that moves a layer only within certain limits, or let the user select between several options by dragging a slider. You can add check boxes that turn layers on or off, or change color schemes on text and graphics layers. You can add angle controls that drive the rotation of several layers, and you can add color controls that change the color of text, glows, or shapes. There are seven types of Expression Controls in After Effects, but the 3D Point Control and the Layer Control are not supported by the Essential Graphics panel, so they're not used for MOGRT design. The names for the Expression Control effects indicate what type of property control they provide: Angle Control, Check box Control, Color Control, Layer Control, Point Control, Slider Control, and Dropdown Menu Control. After Effects CS5.5 and later includes a 3D Point Control, as well. If you apply an animation preset from the Animation Presets > Shapes > Backgrounds category, you can see a custom Animated Shape Control effect in the Effect Controls panel. This custom effect is a specialized expression control effect that was created specifically for these animation presets. You can copy and paste this effect to other layers, or you can save it as an animation preset itself so that you can apply it elsewhere. You apply Expression Controls effects to a layer in the same ways that you apply other effects, such as dragging the effect onto the layer from the Effects & Presets panel. You can apply Expression Controls effects to any layer; however, it is useful to apply them to a null layer, which you can simply use as a controlling layer. You then add expressions to properties on other layers to take input from that control. For example, you can add the Slider Control effect to a null layer (Null 1), and then apply this expression to the Position properties of multiple layers: position+[0,10*(index-1)*thisComp.layer(\"Null 1\").effect(\"Slider Control\")(\"Slider\")] In this example, as you drag the slider, each layer with this expression moves. The layers with greater index numbers (layers toward the bottom in the Timeline panel) are shifted more than the layers with lower index numbers, at 10-pixel intervals. You can set keyframes for the slider on the null layer, and all the other layers animate accordingly. It is often useful to rename each instance of an Expression Control effect to indicate its use. For example, renaming an instance of the Color Control effect to sky color makes it easier to tell what the effect is controlling. You can rename each instance of an Expression Control effect just as you rename any other effect: select it in the Timeline panel or Effect Controls panel and press Enter on the main keyboard (Windows) or Return (Mac OS). To modify the range of a control, right-click (Windows) or Control-click (Mac OS) the underlined property value for the control and choose Edit Value from the context menu. Convert an expression to keyframes In some situations, it’s useful to convert an expression to keyframes. For example, if you want to freeze the values in an expression, you can convert the expression to keyframes and then adjust the keyframes accordingly. If an expression takes a long time to evaluate, you can convert it to keyframes so that it renders more quickly. When you convert an expression to keyframes, After Effects evaluates the expression, creating a keyframe at every frame, and then disables the expression. ? In the Timeline panel, select the property on which the expression is written and choose Animation > Keyframe Assistant > Convert Expression To Keyframes. Last updated 11/4/2019

582 Expressions and automation The After Effects expression language is based on JavaScript 1.2, with an extended set of built-in objects. After Effects uses only the core standard JavaScript 1.2 language, not the web browser–specific extensions. After Effects contains its own set of extension objects—such as Layer, Comp, Footage, and Camera—that you can use to get most of the values in an After Effects project. Though the expression language is based on a scripting language, a subtle but important difference exists between a script and an expression: Whereas a script tells an application to do something, an expression says that a property is something. For more information about JavaScript, see a JavaScript reference resource. When creating expressions, keep in mind the following: • The value of an expression is the value of the last statement evaluated. • JavaScript is a case-sensitive language. • Semicolons are required to separate statements or lines. • Spaces between words are ignored, except within a string. In JavaScript, a value stored in an object is called a property. However, After Effects uses the term property to refer to layer components as defined in the Timeline panel. For this reason, After Effects refers to JavaScript properties as either methods or attributes. In general practice, the difference between a method and an attribute is that a method usually does something to create its output (return) value, whereas an attribute simply refers to an existing value to determine its output (return) value. You can tell a method from an attribute most easily by looking for the parentheses following the method name, which surrounds any input arguments to the method. An object is an item that can contain other objects, attributes, and methods. Compositions, layers, and footage items are examples of objects. Specifically, compositions, layers, and footage items are global objects, which means that they can be referred to in any context without reference to some higher-level object. Accessing attributes and methods You use the expression language to access attributes and methods of layer properties. To access a value, use a chain of object references separated by the period (.) operator. To chain object references past the layer level (for example, to refer to effect properties, masks, or text animators), you can also use parentheses. For example, to link the Opacity property in Layer A to the Blurriness property of the Gaussian Blur effect in Layer B, enter the following expression in the expression field for the Opacity property for Layer A: thisComp.layer(\"Layer B\").effect(\"Gaussian Blur\")(\"Blurriness\") Reading this expression from left to right, you progress from the higher-level, containing object down to the specific property: • The global object used refers to the current composition: thisComp. • A specific layer object within that composition is referred to by its name: layer(\"Layer B\"). • A specific effect object within that layer is referred to by its name: effect(\"Gaussian Blur\"). • A specific effect property within that effect is referred to by its name: (\"Blurriness\"). For the nth component of a multidimensional property, like the y component of an effect control point, append [n] at the end, like this: thisComp.layer(\"Layer B\").effect(\"Advanced Lightning\")(\"Origin\")[1] The default object for an expression is the property on which the expression is written, followed by the layer containing the expression; therefore, you do not need to specify the property. For example, a wiggle expression written on the Position property of a layer can be either of the following: Last updated 11/4/2019

583 Expressions and automation wiggle(5, 10) position.wiggle(5, 10) Include the layer and property when retrieving them from outside the layer and property on which the expression is written. For example, an expression written on the Opacity property of Layer B, linking it to the Rotation property of Layer A would look like this expression: thisComp.layer(\"Layer A\").rotation To see more examples of how expressions work, use the pick whip to link one layer property to another, and look at the expressions it creates. Jeff Almasol provides a script on his redefinery website with which you can determine how to refer to any property in expressions. Arrays and multidimensional properties An Array is a type of object that stores an ordered set of numbers. An Array is represented as a list of numbers separated by commas and surrounded by brackets, as in this example: [10, 23] You can assign an Array object to a variable, making it easy to refer to array values in other areas of the expression. For example: myArray = [10, 23] The dimension of an Array object is the number of elements in the array. The dimension of myArray is 2. Different properties in After Effects have different dimensions depending on the number of value arguments they have. In the expression language, the values of properties are either single values (Number objects) or arrays (Array objects). The following table provides examples of some properties and their dimensions: Dimension Property 1 Rotation ° 2 Opacity % Scale [x=width, y=height] 3 Position [x, y] Anchor Point [x, y] 4 Audio Levels [left, right] Scale [width, height, depth] 3D Position [x, y, z] 3D Anchor Point [x, y, z] Orientation [x, y, z] Color [red, green, blue, alpha] You can access the individual elements of an Array object by using brackets and an index number to indicate which element you want. The elements in an Array object are indexed starting from 0. Using the previous example, myArray[0] is 10 and myArray[1] is 23. The following two expressions are equivalent: Last updated 11/4/2019

584 Expressions and automation [myArray[0], 5] [10, 5] The Position property arrays are indexed as follows: • position[0] is the x coordinate of position. • position[1] is the y coordinate of position. • position[2] is the z coordinate of position. Colors are represented as four-dimensional arrays [red, green, blue, alpha]. In projects with a color depth of 8 bpc or 16 bpc, each value in a color array ranges from 0 (black) to 1 (white). For example, red can range from 0 (no color) to 1 (red). So, [0,0,0,0] is black and transparent, and [1,1,1,1] is white and opaque. In projects with a color depth of 32 bpc, values under 0 and over 1 are allowed. If you use an index that is greater than the index of the highest-dimension component in an Array object, After Effects returns an error. For example, myArray[2] causes an error, but position[2] returns the z coordinate of Position. Many of the properties and methods in the After Effects expression language take Array objects as arguments or return them as values. For example, thisLayer.position is an Array object that is either two-dimensional or three-dimensional depending on whether the layer is 2D or 3D. If you want to write an expression that keeps the y value of an animation of Position but fixes the x value at 9, you would use the following: y = position[1]; [9,y] The following is even more succinct: [9, position[1]] This is an important point, so let’s look at one more example. If you want to combine the x position value from Layer A with the y position value from Layer B, you would use the following: x = thisComp.layer(\"Layer A\").position[0]; y = thisComp.layer(\"Layer B\").position[1]; [x,y] You can create an expression that refers to just one value within the array of a 2D or 3D property. By default, the first value is used, unless you specify otherwise. For example, if you drag the pick whip from the Rotation property of Layer A to Scale property of Layer B, the following expression appears: thisComp.layer(\"Layer B\").scale[0] By default, this expression uses the first value of the Scale property, which is width. If you prefer to use the height value instead, drag the pick whip directly to the second value instead of the property name, or change the expression as follows: thisComp.layer(\"Layer B\").scale[1] Conversely, if you drag the pick whip from the Scale property of Layer B to the Rotation property of Layer A, After Effects automatically creates a variable, assigns the one-dimensional Rotation property value to it, and then uses that variable for both dimensions of the Scale property: temp = thisComp.layer(1).transform.rotation; [temp, temp] Last updated 11/4/2019

585 Expressions and automation Vectors In After Effects, many properties and methods take or return vectors. After Effects refers to an array as a vector if it represents either a point or direction in space. For example, After Effects describes position as returning a vector. However, though a function like audioLevels does return a two-dimensional value (the left and right channel levels), it is not called a vector because it does not represent a point or direction. Some functions in After Effects accept vector arguments, but they are generally only useful when the values passed represent a direction. For example, cross(vec1, vec2) computes a third vector that is at right angles to the input vectors. The cross product is useful when vec1 and vec2 are two vectors representing directions in space, but not if they just represent two arbitrary collections of numbers. Indices and labels Indexing for Layer, Effect, and Mask elements in After Effects starts from 1. For example, the first layer in the Timeline panel is layer(1). Generally, it is best to use the name of a layer, effect, or a mask instead of a number to avoid confusion and errors if the layer, effect, or mask is moved, or if the arguments are changed during product updates and upgrades. When you use a name, always enclose it in straight quotes. For example, the first of these expressions is easier to understand than the second expression, and the first expression continues to work even if you change the order of effects: effect(\"Colorama\").param(\"Get Phase From\") effect(1).param(2) Expression time Time within an expression is always in composition time (not layer time) and is measured in seconds. The default time for any expression is the current composition time at which the expression is being evaluated. The following expressions both use the default composition time and return the same values: thisComp.layer(1).position thisComp.layer(1).position.valueAtTime(time) To use a relative time, add an incremental time value to the time argument. For example, to get the Position value 5 seconds before the current time, use the following expression: thisComp.layer(1).position.valueAtTime(time-5) Default time references to properties in nested compositions use the original default composition time, not remapped time. However, if you use the source function to retrieve a property, the remapped time is used. For example, if the source of a layer in the containing composition is a nested composition, and in the containing composition you have remapped time, when you get the position values of a layer in the nested composition with the following expression, the position values use the default time of the composition: comp(\"nested composition\").layer(1).position However, if you access layer 1 using the source function, the position values use the remapped time: thisComp.layer(\"nested composition\").source.layer(1).position Note: If you use a specific time in an expression, After Effects ignores the remapped time. Because expressions operate on time in units of seconds (not frames), you sometimes need to use time conversion methods to convert time values to perform operations on frames. (See Time conversion methods (expression reference).) Last updated 11/4/2019

586 Expressions and automation Expression errors When an expression fails to evaluate, expression errors appear in a warning banner at the bottom of the Composition and Layer panels. After Effects does not disable the expression but continues to evaluate it. The warning banner is displayed as long as the expression fails to evaluate; that is, until the expression is either fixed or manually disabled. Here’s an example of what the expression error warning banner looks like: An example expression error A Left or Right arrow buttons B The Reveal Expression C The Expand/Collapse Warning • The Left or Right arrow buttons display the previous or next expression error when multiple expressions fail to evaluate. • The Reveal Expression (magnifying glass) button exposes the property with the failing expression in the Timeline panel. If the expression is in a different composition, that composition opens. • The Expand/Collapse Warning (up/down arrows) button shows or hides the error text. The expression error text is one line only, and is clipped to the width of the Composition panel. To see the full expression error text: Click next to the expression. The complete error appears in a dialog box. To hide the warning banner: Choose After Effects (Mac OS) or Edit (Windows) > Preferences > General and disable Show Warning Banner When Project Contains Expressions Errors. When this option is disabled, the warning banner remains hidden even when new expression errors occur. Re-enable this option to view expression errors. More Expression resources Now that you have understood some of the concepts behind expressions, come to the community for some real-life examples, and to share your work. You can also check out Dan Ebberts' excellent collection of example expressions and tutorials on his MotionScript website. The AE Enhancers forum also provides many examples and much information about expressions, as well as scripts and animation presets. Use expressions to edit and access text properties You can use expressions to control text styling as well as the text itself. Work with any text expression as well as with Motion Graphics Templates. You can link multiple titles together and update their styling at once, which is used for title design, especially main and end titles. You can make global changes to text properties when you use expressions. This feature also enables you to keep font, size and styling in sync across multiple text layers in After Effects and Motion Graphics templates. Once you set these for a text layer, you can reference that layer properties to easily apply changes throughout the compositon. Last updated 11/4/2019

587 Expressions and automation After Effects uses the Get and Set functions to read and write values for text properties into the Expression Engine so that you can use expressions to drive and set font styles, such as text properties across text layers. To access these functions for text properties, if expressions are enabled, right-click a text layer, and open the Expression menu, and select Text > Properties > Properties. Access text properties When you select a desired function, it adds to the expressions editor for that layer. If there is code already recorded in the expression editor, the new expression is inserted automatically. Save these expressions as presets Select the text layer with expressions added to it. Then, select Animation > Save Animation Preset to reuse the expressions in other projects. Animation Presets are saved in the Effects and Presets panel. PostScript font expression menu • To refer to specific fonts in an expression, you can use the Font dropdown menu in the Expressions menu to insert the PostScript name of the desired font into the expression. • Select Text > Font in the Expressions Editor to insert into your expressions. Last updated 11/4/2019

588 Expressions and automation Other important points • Fonts that are referred to in the expressions only are not recorded as Fonts Used by the project and therefore do not Auto-Sync or populate the Resolve Fonts Dialog if the font is not installed. • The Workaround is to use all of the fonts referred to in the project on a layer or a comp even if that source is hidden. The reference to the font cannot only exist in the Expressions Editor. The following are examples for how to access and use text property values with expressions: Action Expression To return the value of the Font name for the same layer itself style = text.sourceText.style.font; To return the value of the Font name for another layer fontName = thisComp.layer(\"source layer name\").text.sourceText.style.font; To return value of Font Size for the same layer itself fontSize = text.sourceText.style.fontSize; To return the value of Font Size for another layer style = thisComp.layer(\"source layer name\").text.sourceText.style.fontSize; To return a boolean value of whether a layer's text is Faux Bold or not style = thisComp.layer(\"source layer (True or False) name\").text.sourceText.style.isFauxBold; To return a boolean value of whether a layer's text is Faux Italic or not style = thisComp.layer(\"source layer (True or False) name\").text.sourceText.style.isFauxItalic; To return a boolean value of whether a layer's text has Fill applied to it style.applyFill; (true or false) To return the value of the fill color of a text layer. style.fillColor; style.fillColor(2); By default this returns the first value of RGB on a scale from 0-1.0 To get the value for G or B add 1 or 2 in parenthesis at the end of expression To return a boolean value of whether a layer's text has Stroke applied style.applyStroke; to it (true or false) To return the value of the fill color of a text layer. style.strokeColor; style.strokeColor(1); By default this returns the first value of RGB on a scale from 0-1.0 To get the value for G or B add 1 or 2 in parenthesis To return the value of a text layer's Stroke style.strokeWidth; To return tracking value style.tracking; To return leading value style.leading; To return boolean value if auto leading is on or off (true or false) style.autoLeading; Get Function to return the value at a particular Character Index getStyleAt(0); Get Function to return the value at particular Character Index at Time getStyleAt(n,x); (n = character index, x = time in seconds) Example: To return the value at a particular Character Index and time style = text.sourceText.getStyleAt(n,x); (optional) same layer (n = character index, x = time in seconds) Get style at Character Index 0 of another layer style = thisComp.layer(\"source layer name\").text.sourceText.style; style; Example: To return the value at a particular Character Index and time style = thisComp.layer(\"source layer (optional) of a different layer different layer name\").text.sourceText.getStyleAt(0,5); Last updated 11/4/2019

589 Expressions and automation Using .style at the end is the same as using getStyleAt(0); style = text.sourceText.style; Add \"font or \"fontStyle\" after the getStyleAt(0) to return specific text getStyleAt(4).fontSize; getStyleAt(3).font; property values To return the values of both the style and the actual source text at time style = thisComp.layer(\"source layer (short hand) name\").text.sourceText.getStyleAt(0,0); or style.setText(thisComp.layer(\"source layer name\").text.sourceText); Set Functions for both style and text (long form): style.setFont(thisComp.layer(\"source layer name\").text.sourceText.style.font); style; To create empty style (in order to use Set Functions to bake in specific style = text.sourceText.createStyle(); values) create style and set specific values through Set Functions ** (long styleA = thisComp.layer(\"source layer form): name\").text.sourceText.createStyle(); styleB = styleA.setFontSize(300); styleC = styleB.setFont(\"Impact\"); styleC; create style and set specific values through Set Functions ** (short text.sourceText.createStyle().setFontSize(300).setFont(\"Impact\"); form): Returning Character Index value with Get Function + overriding some style = text.sourceText.getStyleAt(3); style = style.setFontSize(150); of the specific values with Set Functions style = style.setFont(thisComp.layer(\"source later text\").text.sourceText.style.font); style; You can also reference layers by index instead of name for localization style = thisComp.layer(1).text.sourceText.getStyleAt(0); (but re-arranging or adding new layers will break the expression. style.setText(thisComp.layer(1).text.sourceText); Additional Set Functions that can be used individually or in newStyle = style.setBaselineShift(new_value); combination with one another to drive styles across layers. newStyle = style.setApplyFill(true/false); newStyle = style.setFillColor([1.0,1.0,1.0]) // array of RGB values newStyle = style.setApplyStroke(true/false) newStyle = style.setStrokeColor([1.0,1.0,1.0]) // array of RGB values newStyle = style.setStrokeWidth(new_value) newStyle = style.setTracking(new_value); newStyle = style.setLeadig(new_value); newStyle = style.setAutoLeading(true); Set the Baseline Shift Value for a text layer newStyle = style.setBaselineShift(new_value); Use this to turn a text layer's Fill on or off newStyle = style.setApplyFill(true/false); Use this in combination with setApplyFill to define the Fill Color. newStyle = style.setFillColor([1.0,1.0,1.0]) // array of RGB values These values are defined on a 0-1.0 RGB You can use this in combination with the hexToRGB to define the color values with Hex values instead of the 0-1.0 RGB scale Use this to turn a text layer's Stroke on or off newStyle = style.setApplyStroke(true/false) Use this in combination with setApplyStroke to define the Stroke newStyle = style.setStrokeColor([1.0,1.0,1.0]) // array of RGB values Color. These values are defined on a 0-1.0 RGB You can use this in combination with the hexToRGB to define the color values with Hex values instead of the 0-1.0 RGB scale Use this to set a text layers stroke width newStyle = style.setStrokeWidth(new_value) Last updated 11/4/2019

590 Expressions and automation Use this to set the Tracking value newStyle = style.setTracking(new_value); Use this to set the Leading Value Use this to turn AutoLeading on or off newStyle = style.setLeadig(new_value); Example of how these can be used together newStyle = style.setAutoLeading(true); text.sourceText.style.setFillColor(hexToRgb(\"00FF00\")).setApplyStroke (1).setStrokeWidth(5).setStrokeColor([1,0,0]).setFontSize(200); Write expressions for source text The Source Text property of a text layer is interpreted by expressions as a JavaScript String. You can use the pick whip to retrieve the source text from another text layer; however, only the style of the first character of the destination layer is used. In the Essential Graphics Panel, in the Source Text Properties menu, you can select the Use layer as fallback text box. When checked on, you can select a comp/subcomp and a shape or clip layer to determine an alternate text box for editing the text in Premiere Pro Program Monitor. You can use \"\\r\" in a string expression to start a new line of text. For example, to copy the original text from one layer onto the same layer and repeat it in all uppercase characters on a new line, use the following expression: text.sourceText + \"\\r\" + text.sourceText.toUpperCase() Adding a text layer to a composition and adding an expression to its Source Text property can be a great way to examine the property values of other layers. For example, the following expression on a Source Text property reports the name and value of the Opacity property for the next layer in the layer stacking order: thisComp.layer(index + 1).name + \"\\rOpacity = \" + thisComp.layer(index + 1).opacity.value The following example reports the name of the footage item used as the source of the topmost image layer in the stacking order at the current time that has its Video switch set. Last updated 11/4/2019

591 Expressions and automation source_footage_name = \"\"; for (i = 1; i <= thisComp.numLayers; i++){ if (i == index) continue; my_layer = thisComp.layer(i); if (! (my_layer.hasVideo && my_layer.active)) continue; if (time >= my_layer.inPoint && time < my_layer.outPoint){ try{ source_footage_name = my_layer.source.name; }catch(err1){ source_footage_name = my_layer.name } break; } } source_footage_name Expression language reference Use the After Effects expression elements along with standard JavaScript elements to write your expressions. You can use the Expression Language menu at any time to insert methods and attributes into an expression, and you can use the pick whip at any time to insert properties. If an argument description contains an equal sign (=) and a value (such as t=time or width=.2), then the argument uses the included default value if you don’t specify a different value. Some argument descriptions include a number in square brackets—this number indicates the dimension of the expected property or Array. Some return-value descriptions include a number in square brackets—this number specifies the dimension of the returned property or Array. If a specific dimension is not included, the dimension of the returned Array depends on the dimension of the input. The W3Schools JavaScript reference website provides information for the standard JavaScript language, including pages for the JavaScript Math and String objects. Expressions: JavaScript Engine After Effects uses JavaScript engine when evaluating expressions. The performance of evaluating expressions during renders can be up to 5x faster than the Legacy ExtendScript engine. On Windows, After Effects uses the V8 open-source JavaScript engine. This provides a more modern version of JavaScript than available in ExtendScript, which only supports the 3rd Edition of the ECMA-262 Standard. To choose whether a project uses the JavaScript engine or Legacy ExtendScript, in the Project Settings dialog, click the Expressions tab, and change the Expressions Engine option. Projects saved in previous versions of After Effects default to Legacy ExtendScript. For more information on specific syntax differences between the JavaScript and Legacy ExtendScript expression engines, see Syntax differences between the JavaScript and Legacy ExtendScript expression engines. Improvements provided by the JavaScript engine • Higher mathematical precision in floating-point operations. • Array and string methods from modern JavaScript can be used. Last updated 11/4/2019

592 Expressions and automation • Other modern JavaScript objects like typed arrays, usage of keywords 'let' and 'const', and many other additions made in recent versions of the ECMA-262 Standard are available. Differences between the JavaScript engine and ExtendScript • The syntax for if/else statements is strict in the JavaScript engine and need to be written for standardized JavaScript. • When accessing the indexes of characters on a Text Layer as an array, use text.sourceText.value[i] instead of text.sourceText[i]. • Older snake_case expression methods such as this_comp and to_world, which had been previously deprecated in ExtendScript) are not supported. • Simplified 'this(arg)' syntax is not supported. Global objects, attributes, and methods (expression reference) comp(name) Return type: Comp. Argument type: name is a String. Retrieves another composition by name. footage(name) Return type: Footage. Argument type: name is a String. Retrieves a footage item by name. thisComp Return type: Comp. Represents the composition containing the expression. thisLayer Return type: Layer, Light, or Camera. Represents the layer containing the expression. Because thisLayer is the default object, its use is optional. For example, you can start an expression with thisLayer.width or width and get the same result. thisProperty Return type: Property. Represents the property containing the expression. For example, if you write an expression on the Rotation property, you can start an expression with thisProperty to refer to the Rotation property. time Return type: Number. Represents the composition time, in seconds, at which the expression is being evaluated. colorDepth Return type: Number. Returns the project color depth value. For example, colorDepth returns 16 when the project color depth is 16 bits per channel. posterizeTime(framesPerSecond) Return type: Number. Argument type: framesPerSecond is a Number. The framesPerSecond value becomes the frame rate from which the rest of the expression operates. This expression allows you to set the frame rate for a property to be lower than the frame rate of the composition. For example, the following expression updates the property value with a random value once per second: posterizeTime(1); random() value Return type: Number, Array, or String. Last updated 11/4/2019

593 Expressions and automation Represents the value at the current time for the property containing the expression. Time conversion methods (expression reference) timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false) Return type: Number. Argument type: t and fps are Numbers; isDuration is a Boolean. Converts the value of t, which defaults to the current composition time, to an integer number of frames. The number of frames per second is specified in the fps argument, which defaults to the frame rate of the current composition (1.0 / thisComp.frameDuration). The isDuration argument, which defaults to false, should be true if the t value represents a difference between two times instead of an absolute time. Absolute times are rounded down toward negative infinity; durations are rounded away from zero (up for positive values). framesToTime(frames, fps = 1.0 / thisComp.frameDuration) Return type: Number. Argument type: frames and fps are Numbers. The inverse of timeToFrames. Returns the time corresponding to the frames argument, which is required. It doesn’t have to be an integer. See timeToFrames for explanation of the fps argument. timeToTimecode(t = time + thisComp.displayStartTime, timecodeBase = 30, isDuration = false) Return type: String. Argument type: t and timecodeBase are Numbers; isDuration is a Boolean. Converts the value of t to a String representing timecode. See timeToFrames for an explanation of the t and isDuration arguments. The timecodeBase value, which defaults to 30, specifies the number of frames in one second. timeToNTSCTimecode(t = time + thisComp.displayStartTime, ntscDropFrame = false, isDuration = false) Return type: String. Argument type: t is a Number, ntscDropFrame and isDuration are Booleans. Converts t to a String representing NTSC timecode. See timeToFrames for an explanation of the t and isDuration arguments. If ntscDropFrame is false (the default), the result String is NTSC non-drop-frame timecode. If ntscDropFrame is true, the result String is NTSC drop-frame timecode. timeToFeetAndFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, framesPerFoot = 16, isDuration = false) Return type: String. Argument type: t, fps, and framesPerFoot are Numbers; isDuration is a Boolean. Converts the value of t to a String representing feet of film and frames. See timeToFrames for an explanation of the t, fps, and isDuration arguments. The framesPerFoot argument specifies the number of frames in one foot of film. It defaults to 16, which is the most common rate for 35mm footage. timeToCurrentFormat(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false) Return type: String. Argument type: t and fps are Numbers; isDuration is a Boolean. Converts the value of t to a String representing time in the current Project Settings display format. See timeToFrames for a definition of all the arguments. An optional ntscDropFrame argument was added to the timeToCurrentFormat() function in After Effects CS5.5 and later. Default: ntscDropFrame = thisComp.ntscDropFrame. Last updated 11/4/2019

594 Expressions and automation If you want more control over the look of timecode in your footage, use the timeToCurrentFormat method or other timeTo methods to generate the timecode instead of using the Timecode or Numbers effect. Create a text layer, add an expression to the Source Text property, and enter timeToCurrentFormat() in the expression field. With this method, you can format and animate the timecode text. In addition, the timecode uses the same display style defined by the current project settings. Vector Math methods (expression reference) Vector Math functions are global methods that perform operations on arrays, treating them as mathematical vectors. Unlike built-in JavaScript methods, such as Math.sin, these methods are not used with the Math prefix. Unless otherwise specified, Vector Math methods are lenient about dimensions and return a value that is the dimension of the largest input Array object, filling in missing elements with zeros. For example, the expression add([10, 20], [1, 2, 3]) returns [11, 22, 3]. JJ Gifford’s website provides explanations and examples that show how to use simple geometry and trigonometry with expressions. add(vec1, vec2) Return type: Array. Argument type: vec1 and vec2 are Arrays. Adds two vectors. sub(vec1, vec2) Return type: Array. Argument type: vec1 and vec2 are Arrays. Subtracts two vectors. mul(vec, amount) Return type: Array. Argument type: vec is an Array, amount is a Number. Multiplies every element of the vector by the amount. div(vec, amount) Return type: Array. Argument type: vec is an Array, amount is a Number. Divides every element of the vector by the amount. clamp(value, limit1, limit2) Return type: Number or Array. Argument type: value, limit1, and limit2 are Numbers or Arrays. The value of each component of value is constrained to fall between the values of the corresponding values of limit1 and limit2. dot(vec1, vec2) Return type: Number. Argument type: vec1 and vec2 are Arrays. Returns the dot (inner) product of the vector arguments. cross(vec1, vec2) Return type: Array [2 or 3]. Argument type: vec1 and vec2 are Arrays [2 or 3]. Returns the vector cross product of vec1 and vec2. Refer to a math reference or JavaScript guide for more information. normalize(vec) Return type: Array. Argument type: vec is an Array. Last updated 11/4/2019

595 Expressions and automation Normalizes the vector so that its length is 1.0. Using the normalize method is a short way of performing the operation div(vec, length(vec)). length(vec) Return type: Number. Argument type: vec is an Array. Returns the length of vector vec. length(point1, point2) Return type: Number. Argument type: point1 and point2 are Arrays. Returns the distance between two points. The point2 argument is optional. For example, length(point1, point2) is the same as length(sub(point1, point2)). For example, add this expression to the Focus Distance property of a camera to lock the focal plane to the camera's point of interest so that the point of interest is in focus: length(position, pointOfInterest) lookAt(fromPoint, atPoint) Return type: Array [3]. Argument type: fromPoint and atPoint are Arrays [3]. The argument fromPoint is the location in world space of the layer you want to orient. The argument atPoint is the point in world space you want to point the layer at. The return value can be used as an expression for the Orientation property, making the z-axis of the layer point at atPoint. This method is especially useful for cameras and lights. If you use this expression on a camera, turn off auto-orientation. For example, this expression on the Orientation property of a spot light makes the light point at the anchor point of layer number 1 in the same composition: lookAt(position, thisComp.layer(1).position) Random Numbers methods (expression reference) Note: The wiggle method—which is used to randomly vary a property value—is in the Property attributes and methods category. For more information, see Property attributes and methods (expression reference). seedRandom(offset, timeless=false) Return type: none. Argument type: offset is a Number, timeless is a Boolean. The random and gaussRandom methods use a seed value that controls the sequence of numbers. By default, the seed is computed as a function of a unique layer identifier, the property within the layer, the current time, and an offset value of 0. Call seedRandom to set the offset to something other than 0 to create a different random sequence. Use true for the timeless argument to not use the current time as input to the random seed. Using true for the timeless argument allows you to generate a random number that doesn’t vary depending on the time of evaluation. The offset value, but not the timeless value, is also used to control the initial value of the wiggle function. For example, this expression on the Opacity property sets the Opacity value to a random value that does not vary with time: seedRandom(123456, true); random()*100 The multiplication by 100 in this example converts the value in the range 0–1 returned by the random method into a number in the range 0–100; this range is more typically useful for the Opacity property, which has values from 0% to 100%. Last updated 11/4/2019


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook