Procedural Compositing with Batch > Batch: Node Reference > Gateway Import Node >
Using the Gateway Import Node

Why Use a Gateway Import Node?

While you can import all sorts of media files using a Gateway Import node, its primary use is to facilitate integration of Flame in render pass workflows. In this context, there are three types of files targeted by the Gateway Import node.

- Multi-channel OpenEXR
- .precomp files created by Maya
- Gateway .clip files

Using the Gateway Import Node With Render Passes

The Gateway Import node is more than just another way to import in a Batch schematic. It actually allows you to integrate Flame inside a render pass pipeline very efficiently.

While you can use the Gateway Import node to import almost any file format, three are of interest for multi-channel render pass workflows.

- Gateway .clip
- multi-channel OpenEXR
- Maya .precomp

And while they differ in their basic structures, they all provide access to a powerful CG concept: render passes. The render pass allows you to composite within Flame the many components, or passes, making up the scene. And by working directly with the render passes, you end up performing tasks, such as colour correcting, that are much more time consuming in the 3D application. The fact is that Flame only needs to compute the value of pixels in a scene, while the 3D application needs to recompute the lighting of whole geometries: Flameis just better for these tasks.

How to Use Flame With Render Passes?

Working with render passes is not difficult, especially if you use the Gateway Import node and one of the following file types: Gateway .clip, multi-channel OpenEXR, or Maya .precomp. To simplify the discussion, we will be using the .precomp file in the following example to avoid having to create our own Gateway .clip file.

Consider the following example of an image generated in Maya.

This image was exported from Maya using the following render passes.

- Beauty - scene
- Camera Depth
- Motion Vectors
- Ambient
- Beauty with Shadow and Reflections
- Diffuse
- Direct Irradiance Without Shadows
- Raw Shadow
- Specular
- Reflection
- Beauty - sphere-only

Importing this file using the Gateway Import node, we have access to all these passes.

Once imported, we can create a simple batch schematic and composition.

In this Batch setup, we do the following.

- Warp the sphere's colour.
- Warp the sphere reflexion's colour by the same amount.
- Remove the original shadow and replace it with a new one.
- Add a spot on the sphere.
- Change the overall lighting look.
- Add a lens flare.

And if the CG artist updates his work, we can just replace the current clip with the updated version, performing a simple clip replacement; all the compositing information is maintained.

In fact, the Gateway Import node supports matching channels based not only on their UID and name, but also on their channel type. This allows you to replace sources with multiple render passes in a Gateway Clip that are similar, but not identical, and maintain schematic connections to the Gateway Import node within a composite.

About .precomp Files

A .precomp file is a file generated by Maya to facilitate data exchange with its Composite component. Flame can read that file and extract render pass information. An actual .precomp export from Maya consists of two distinct elements:

- One .precomp file which describes the components of the scene. It is a Python plain-text file with compositing information and path to the render passes.
- Media files referred to by the .precomp file. In the most simple of cases, there is one OpenEXR file for every rendered frame. Each OpenEXR contains all the render passes for that frame.

An interesting aspect of .precomp files is their use of render layers as versions: this allows the Maya artist to create different versions of the same scene using render layers. You can then use in Flame the Gateway Import node to import the .precomp file, and then use the Version box to switch between looks.

Gateway Import Node and Autodesk Maya

The Gateway Import node automatically recognizes pass types from mental ray in Maya, which allows for a more robust channel matching during clip updates or replacement.

Below is the list of those mental ray render passes, with a short description.

Render Pass | Description
--- | ---
2D Motion Vector | Relative motion (in raster coordinates) of objects in your scene; in other words, how far each pixel is moving between two frames. Vector is expressed in normalized pixels.
3D Motion Vector | 3D motion vector in world space. In mental ray for Maya, the 3D motion vector is expressed in internal space.
Ambient | Ambient contribution of the surface. In Maya, this is the material color multiplied by the ambient light color.
Ambient Irradiance | Amount of ambient light received by the surface.
Ambient Occlusion | Ambient occlusion contribution from both self ambient occlusion as well as primary ambient occlusion, which is derived from surrounding objects.
Ambient Material Color | Reflectivity of the material with respect to ambient light.
Beauty | Final colour computed by mental ray for Maya.
Beauty Without Reflections or Refractions | Beauty pass without reflections or refractions. Used to tune the tint and intensity of the reflection/refraction separately from the rest of the passes.
Camera Depth | Extracts the distance between the camera and the intersection point.
Coverage | mental ray Coverage frame buffer. This frame buffer offers only silhouette coverage. Self-coverage is currently not supported.
Diffuse | Diffuse shading of material.
Diffuse Without Shadows | Diffuse pass without shadowing information.
Diffuse Material Colour | Provides constant diffuse colour or textured diffuse colour, excluding light contribution.
Direct Irradiance | Direct light arriving at each sample location.
Direct Irradiance Without Shadows | Direct irradiance without shadowing information.
Glow Source | outGlow output of surface shaders; affected by pass contribution maps.
Incandescence | Additive colour.
Incidence | Measures the difference between the direction of the light ray and the surface normal. If the surface normal is facing the light, this value is 1. If the normal is facing away from the light, the value is 0.
Indirect | Indirect lighting from final gather, global illumination, and caustics.
Light Volume | Extracts all light-centric volume effects, for example, a light cone volume effect.
Material Incidence | Measures the difference between the direction of the camera ray and the surface normal. If the surface normal is pointing to the camera, this value is 0. If the normal is facing away from the camera, the value is 1. Any angle greater than 90 degrees is also translated to 1. If bump mapping is applied to the shading network, it will appear in this pass.
Material Normal | Interpolated surface normal. If bump mapping is applied to the shading network, it will appear in this pass.
Matte | The object's matte, excluding transparency/opacity. This pass serves as the render layer compositing mask. Should be solid white in areas where objects are intersected. Independent of transparency/translucency.
Normalized 2D Motion Vector | Relative motion (in raster coordinates) of objects in your scene; in other words, how far each pixel is moving between two frames. Pixel displacement is normalized to (0—1). Static objects are expressed with 0.5,0.5 values.
Object Incidence | Similar to the Material Incidence pass but without support for bump mapping.
Object Normal | Similar to the Material Normal pass but without support for bump mapping.
Object Volume | Extracts all object-centric volume effects, for example, smoke that is contained in a glass object. Also includes volume particles, volume fur, and fluids.
Opacity | The object's opacity, which is derived from transparency/refraction. In compositing, the object's opacity can be controlled independently from the render layer matte.
Raw Shadow | Similar to the Shadow pass but calculated only with respect to the irradiance in the scene.
Reflection | Reflection results. Includes self-reflection, primary reflections, secondary reflections and environment reflections.
Reflected Material Colour | The reflected colour parameter of the material. Pure constant reflection colour or textured reflection. Used as a reflection matte to determine where reflection would be revealed (coloured and non-coloured).
Refraction | Refraction results. Includes self-refraction, primary refraction, and environment refraction.
Refraction Material Colour | The transparency colour parameter of the material. Pure constant refraction colour or textured reflection. Used as a refraction/transparency matte to determine where refraction is revealed (coloured and non-coloured).
Scatter | Scattering effects that result from the material’s scattering attributes.
Scene Volume | Extracts all scene-centric volume effects such as fog, layered fog, haze, and so forth.
Shadow | Pure shadow contribution for both self-shadowing as well as direct shadows. The shadow pass can be luminance or coloured shadows. Takes into account material contributions.
Specular | Specular shading. The specular component is modulated differently depending on the type of material associated with the object. For example, Phong, PhongE, Blinn, and Anisotropic materials produce specular contributions differently. On a Phong material, the specular pass can be modulated using cosine power and specular colour.
Specular Without Shadows | Similar to Specular but without shadow occlusions.
Translucence | Back shading contribution revealed on the front surface.
Translucence Without Shadows | Similar to Translucence but without shadows.