In order to better understand the advantages that Cineware affords us, I wanted to record the older methods of C4D/AE workflows, and highlight the good, bad & ugly.
Also, I'm old and forget things, so I wrote them down here.
When 3D software renders an image, it builds the final image by separately calculating the scene's diffuse, specular, shadow, reflection, etc., then combining them into the final image, and discarding the separately calculated layers. By rendering multiple passes, the software saves each of these steps as separate files, which allows for more adjustments in post (e.g. changing the density or color bias of the shadows).
Since the software already has to calculate those separate passes as part of a standard render, the additional render time is basically just the i/o overhead of writing the additional files.
Multi-pass renders are generally saved to image sequences, and every pass rendered creates an entirely new image sequence. Therefore, file naming and organization is critical, as the total number of files can be significant.
- In the Render Settings dialog box, check "Multi-Pass" in the left panel.
- Also in the left panel, click on Save. Then in the right panel uncheck "Save" under Regular Image.
- Under Multi-Pass Image, check "Save".
- By Format, choose an appropriate file format (see below).
Choosing a File Format
I recommend image sequences over QuickTime movies due to the ability to recover from crashed/failed renders or corrupted files. Image sequences also tend to have the best 32-bit/channel support, and if you are bothering with a multi-pass render, you may as well dish out some 32bpc love.
Photoshop (PSD) / ☑︎ Multi-Layer File (on)
This seems optimal, as the various passes will be contained within a single file, making file organization much easier. However, C4D stores some passes (depth and buffer IDs) as Photoshop channels rather than layers. After Effects can only read 4 channels (RGB+A) in a PSD, and it assumes that the 4th channel is an alpha. Unfortunately, if the PSD contains any additional channels (channels 5, 6, etc.), not only does AE not recognize those channels, it now ignores the 4th channel as an alpha.
I am investigating a Photoshop script that will convert channels to layers, but in the meantime this shortcoming seems to make this option useless for an AE workflow.
Photoshop (PSD) / ☐ Multi-Layer File (off)
Without the Multi-Layer File option checked, C4D will create separate PSD files for each pass. This results in more overall files than the Multi-Layer File option, but the alpha channel in each file is correctly interpreted by AE. So basically: More files, but it just works.™
This is a recommended workflow.
OpenEXR is a format built for higher-end compositing workflows. Much like a PSD, its format supports multiple channels which can store alpha information, as well as any other render pass. The EXR format also supports many types of compression (lossless and lossy), allowing this workflow to result in fewer overall files and smaller file sizes. Neat! Right…?
Unfortunately, After Effects has poor support for EXRs, as it cannot natively read more than a single channel from an EXR. In recent versions of AE, Adobe began bundling fnord's free OpenEXR plug-ins — EXtractoR and IDentifier — which allow AE to access additional EXR channels, but the workflow is very labor intensive for EXRs with many channels. For a more efficient workflow, fnord sells ProEXR ($75 as of 11/6/2014), but if you are running a vanilla install of AE (as most school labs do), this option may not be viable.
Finally, MAXON is aware of AE's incompetence with regard to multi-channel EXRs, and so C4D will refuse to create a proper Compositing Project File for After Effects (AEC) if you have selected to multi-pass render to multi-layer (read: multi-channel) EXR files. You can still force C4D to save out an AEC by temporarily unchecking the option for Multi-Layer File and then clicking Save Project File… Although the resulting AEC file can include helpful info such as 3D data, it will not include all of the multi-pass layers properly comped. Fortunately, if you absolutely must have an EXR workflow and are willing to pay extra for it, ProEXR has a script that can automate the layering of those multi-pass EXR channels within AE.
Choosing Multi-Pass Layers
Under the Render Settings dialog box, in the lefthand panel towards the bottom, click on the Multi-Pass… button. A list of available multi-pass layers will appear. Clicking any of these will add that layer as a child to the Multi-Pass render setting in the panel above.
These are custom alpha channels for cutting out specific objects. (See below)
This is basically a beauty pass with an alpha channel. I recommend including this in order to check that the layered passes are comping correctly in AE.
Diffuse, Specular, Reflection, Refraction
The effect of each of these render passes is readily visible in the Material Editor's Preview thumbnail.
Rendering shadows separately allows you to change the density, color and (to some extent) blur of the shadows in a scene.
GI is a completely different way of rendering, and depending on how you have lit your scene, may make the specular pass unnecessary. If you are still using lights in C4D, and the materials have specular turned on in their materials, go ahead and render specular. If you are only lighting using an HDRI, the specular channel should (?) be completely blank.
Rendering motion blur within a 3D app is very costly in terms of time. Some high end compositing apps and 3rd party plug-ins can create motion blur in post with the help of a motion vector pass.
See ReelSmart Motion Blur by RE:Vision Effects.
Rendering a depth pass is helpful when adding atmosphere (fog) or depth of field (DOF) effects in post. A depth pass is a grayscale representation of Z-space in which objects closer to camera are shown as brighter than object further away. However, C4D needs some additional setup to know what should be considered the minimum distance from camera (white) and what should be considered the maximum distance (black).
Create a camera for the C4D scene if one does not already exist. On the camera's Details tab, enable DOF Map Front Blur and DOF Map Rear Blur. This will add UI elements to the camera in the viewports, showing the start and stop of DOF. Use the Front/Rear End settings to specify the min/max distance from camera.
One final Inception-like concept to multi-pass rendering is that C4D can create separate passes for each light. This workflow would allow you to individually change the light intensity and color temperature of every light in a scene. In post. BWAAAAAH
When I asked a colleague why someone might need that level of control in post, he simply replied, "Asshole art directors." Fair enough.
Open C4D's Render Settings dialog box, and in the lefthand panel click on the Multi-Pass item in the Render tree (not the Multi-Pass… button). In the righthand panel, change Separate Lights from "None" to "All". The Mode dropdown menu now become active. Clicking it will reveal just 3 options which control how/if the passes are separated. Since the Diffuse, Specular, and Shadow passes are the main ones that a light can contribute to (in a non-Global Illumination scene with no caustics, visible/volumetric light, etc.), it makes sense that C4D limits this setting to just those 3 passes.
Object ID mattes
Cinema 4D can create custom alpha channels as separate passes, allowing you to isolate select objects from a scene. This results in more flexibility for comping into a render, rather than simply over or under it.
In C4D's Object Manager, select the object for which you want to create a matte. Go to Tags > Cinema 4D Tags, and select Compositing. In the Attributes Manager below, select the Object Buffer tab. Check the box next to Enable for Buffer 1. Note that a single object can be assigned up to 12 buffers, so similar objects can be isolated and/or grouped in various ways to aid in organization within AE.
Rendering the ID Buffer
In C4D's Render Settings, you must have Multi-Pass enabled. In the upper left panel, click the button labeled Multi-Pass… at the bottom of the panel and choose Object Buffer. An item labeled "Object Buffer" will be added to the Multi-Pass render tree. Click this item and note the options at the right to change its Group ID. Leave it set to "1" for testing purposes.
Double-click the Object Buffer in the Multi-Pass tree to rename the matte to something more descriptive, if necessary.
Render as many Object Buffers as you need by clicking on the Multi-Pass button and selecting Object Buffer again. Label as sanity requires.
Compositing Project File
C4D has the ability to create a custom After Effects project file (.AEC) that prepares an AE comp for you, saving you time by automating some mundane tasks and also giving you options that make compositing or further manipulation in AE much easier.
In the Render Settings dialog box, click on Save in the lefthand panel. In the righthand panel, under Compositing Project File, click Save. Now every time you render, C4D will automatically save an appropriate file format for whatever compositing application you have selected under Target Application. For instance, If After Effects is selected, C4D will create an AEC file that can be opened with After Effects, assuming you have installed the appropriate AE plug-in from MAXON.
The AEC file can contain a composition with all of the multi-pass layers pre-arranged and set to the appropriate blending modes (Multiply for shadows, Add for most others).
The AEC file can also contain helpful information about the 3D scene, translated from C4D, including C4D's cameras (settings and position), lights (position) and null objects, as well as baked keyframes for any of these objects' properties that were keyframed in C4D. The render (multi-pass or regular image) will still only be 2D, but with accurate 3D data from the C4D scene, you can use After Effect's 3D space to properly comp over the scene. Combine this feature with Object ID mattes (see above), and you can effectively comp into the scene by making 3D-aware objects and effects appear to move behind objects within the render.
Custom Null Objects
Cinema 4D can create null objects that basically act as proxies of C4D objects, allowing you to keep track of their position and rotation data. C4D will automatically create camera and light objects in the AEC, but creating these null objects require a bit more work.
In C4D's Object Manager panel, select the object you want to represent with a null. Go to Tags > Cinema 4D Tags and select External Compositing. The External Compositing tag will appear next to the object in the Object Manager panel, and its Tag Properties should be visible in the Attributes Manager below for further tweaking.
C4D can also create AE solids instead of just null objects. This option is preferable if you need to comp in a billboard (2D video plane) of a known size over the render in AE. Select the Solid checkbox to make C4D create a solid at that object's position instead of a null object. If the size of the AE solid needs to match the size of the C4D object (e.g., a Plane Object), type in the values for Size X and Size Y. Note that the units are centimeters (cm) in C4D, but will be pixels in AE.
Note: A 1080p billboard in AE would not necessarily need to be represented by a 1920cm × 1080cm Plane Object in C4D. As long as the aspect ratio is correct (16:9), the billboard in AE can be scaled to match.
Importing to AE
After you have rendered the scene in C4D, import the resulting AEC into After Effects. The Project panel will populate with folders and content from the C4D render, including a folder named after the C4D file's name. Inside this folder is a comp of the same name. Double-click it to open the comp, look at the Composition panel below, and celebrate a small but significant victory.
Note: If the comp does not look correct, be sure to check that your AE project is set to 32bpc.
The AE Null Objects and Solids that C4D creates for the AEC file have an incorrect orientation and need to be rotated 270º on the Y-axis in AE. Correct this using Orientation rather than Y Rotation, since you may have useful information from C4D keyframed within the Y Rotation property.
The pre-built comp in the AEC will inherit its frame size and frame rate from C4D's render settings. Just remember that C4D only support integer frame rates, such as 24 instead of 23.976 or 30 instead of 29.97. You may need to change the comp's settings in AE, as well as re-interpret the image sequence(s) at the proper frame rate.
In class, we started kicking around ideas about why you might choose this type of workflow instead of, for example, importing the billboard video into C4D in the first place rather than doing it in post. One reason might be in order to sell a network/branded package to a client that only requires After Effects to update and render. C4D renders can be very time-intensive, and so designing a package to only be reliant upon AE's comparatively faster render times is preferable.
What else? Here some others we came up with quickly:
- Waiting to pull a key on green screen footage until that footage is being comped over/in the C4D render will give you the best idea of how the key will look in the final comp because, hey, you're able to see the final comp.
- Passing 3D position data into AE via a Null Object would let AE-only effects that are 3D aware (such as the ever popular Particular) travel within a C4D render.
- Assigning External Compositing tags to many, many objects (or more intelligently, enabling the Children checkbox under a parent object's External Compositing tag) would potentially allow you to use C4D's Mograph feature set to drive many corresponding layers within After Effects. Similarly, if you don't have Newton for AE, you could use C4D's dynamics simulations and pass those solutions on to AE via these Null Objects. Organization could obviously be an issue, but interesting results may occur.