MultiLayer

 

Function
This node accepts an infinite amount of input images, each layer containing its own unique settings to control compositing mode, opacity, and channels. As the user may rearrange the layers via drag and drop in the Parameters tab, it also allows the user to work using a more layer-based, rather than node-based, logic. It also helps clean up the Node View a bit.

Using MultiLayer

The MultiLayer node accepts a variable amount of inputs. Just drag the inputs to the + sign on the top of the MultiLayer node that appears when the cursor passes over it.

Unlike the other Layer nodes, the first input represents the background layer, the second node is the next deepest, etc., until you reach the input furthest to the right, representing the foreground. When the nodes are inserted, they are stacked in the Parameters tab as well, with the background at the bottom, foreground at the top.

This compositing order may be rearranged by rewiring the node in the Node View, or by dragging the Reposition button in the Parameters tab .

Drag the Reposition button up and down between other layers until a horizontal line appears. This rearranges the compositing order, and rewiring the nodes in the Node View. The compositing order is rearranged, and the nodes rewired in the Node View.
Therefore, in the following illustration, Layer_1 is the background, and Layer_2 is the most prominent foreground layer.

Each layer has associated parameters and controls. In the following illustration, several controls are visible on each line:

These controls are, in order:

Parameters
Function
Shows the input image for that layer in the Viewer.
Toggles the visibility for that layer.
Solos the layer, making all other layers invisible.
Ignore Above turns off all layers above the current layer, keep only the current layer and those behind it visible.
The name of the input image node. By blanking it out, the node is disconnected, but the layer information remains.
The compositing operation for that layer.
Deletes the current layer.

In the subtree of a layer, you can controls its parameters. Note the parameter names are all prefixed by layerName_ (L2_ in the following image). The only tricky parameter is channels—it determines what channels get bubbled up from below. For example, to add several files together to fill the matte in a Keylight node, insert all the mattes first, then the Keylight node on top of the list, using “a” as your channel for that layer.

 

Parameters

Parameters
Type
Defaults
Function
version
string
"1" The version number for version compatibility purposes. Should not be changed by the user.
clipLayer string "L1" The user selects which input layer determines the output resolution.
postMMult int 0 This switch handles PhotoShop's pre-multiplication math, applying a final premultiply at the end of the chain. It is activated when reading in .psd files, but should typically be left off for normal Shake composites.
img image 0 The input image for that layer.
compParamCount int - This parameter appears only in the script. It tells Shake how many extra parameters to add for each layer, based on unique options for each mode.
layerName string "L1" The name of the layer. All associated parameters for that layer are prefixed by the “layerName_”.
opacity float 1 Opacity of the input layer.
preMult int 0 Indicates if the layer is to be premultiplied or not.
compType string "Over" The compositing mode. All modes from the Layer node are accepted, including the PhotoShop modes.
visible int 1 Can deactivate that layer.
solo int 0 Deactivates all other layers.
ignoreAbove int 0 Ignores all layers above (in front of) this layer.
compChannels string "rgba" Which channels are passed up from below (behind) this layer.
[....] - - Repeats the last ten parameters to make an extra layer.

 

PhotoShop Compositing Modes

Parameter
Function
ColorBurn

Takes the color of the second image and darkens the first image by increasing contrast. White in the second image has no effect on the first image. Takes the color of the second image and darkens the first image by increasing contrast. White in the second image has no effect on the first image.

ColorDodge The opposite of ColorBurn, this lightens the image. Black in the second image does not affect the first image.
Darken Identical to Min, taking the lower pixel value.
Exclusion The second image acts as a mask for inverting the first image. White areas of the second image completely invert the first image, black areas of the second image leave the first image unmodified.
HardLight Screens or multiplies the first image, depending on the strength of the second image. Values below 50% in the second image multiply the first image, making it darker. Values above 50% in the second image act as a Screen affect. Values of pure black or white in image 2 replace image 1.
Lighten Identical to Max. Takes the maximum value when comparing two pixels. Good for adding mattes together.
LinearBurn Similar to ColorBurn, except it decreases brightness, not contrast to affect darken the first image. Whites in the second image do not modify the first image.
LinearDodge The opposite of LinearBurn, this brightens the first image. Black areas in image 2 leave the first image unaffected.
LinearLight A combination of LinearBurn and LinearDodge. Values above 50% in image 2 increase brightness of the first image. Values below 50% darken the first image. Values of pure black or white in image 2 replace image 1.
Overlay For shading an image. 50% in the second image keeps the first image the same. Brighter pixel brighten the first image, darker images darken it.
PinLight Performs Min or Max, depending on the strength of the second image. If the second image is brighter than 50%, a Max (Lighten) is performed. If the second image is darker than 50%, a Min (Darken) is performed. Values of pure black or white in image 2 replace image 1.
PSNormal This is similar to Over, but uses the math of PhotoShop to take premultiplication into account.
PSScreen This is similar to Screen, but uses the math of PhotoShop to take premultiplication into account. This should only be used on conjunction with PhotoShop files.
SoftLight Raises or lowers brightness, depending on the strength of the second image. Values above 50% in the second image decrease the brightness of the first image, values below 50% increase the brightness.
VividLight Raises or lowers contrast, depending on the strength of the second image. Values above 50% in the second image decrease the contrast of the first image, values below 50% increase the contrast.

 

Synopsis

image MultiLayer( 
const char * version,
const char * clipLayer, int postMMult,
image img,
int compParamCount,
const char * layerName,
float opacity,
int preMult,
const char * compType,
int visible,
int solo,
int ignoreAbove,
const char * compChannels,
[...] (repeat last 10 parameters)
);

Script

image MultiLayer( 
“version”,
“clipLayer”, postMMult,
img,
compParamCount,
“layerName”,
opacity,
preMult,
“compType”,
visible,
solo,
ignoreAbove,
“compChannels”,
[...] (repeat last 10 parameters)
);

Command Line

Not appropriate for Command line.