On this page |
Overview ¶
A cable is a wire that’s made up of multiple, individual wires (inputs). Cables let you connect multiple wires to an input port using only one wire. This is useful when you want to apply the same node to multiple outputs, since you don’t have to wire each output into an input. Cables also allow for variadic inputs and outputs on HDAs.
The wires in a cable are identified by their names (with the collation index used to disambiguate if there are multiple wires sharing the same name). By default, cables maintain their original wire order as they travel through the network. You can use the Cable Sort COP to instead sort the wires alphabetically based on their names.
Cables allow for and simplify several workflows:
-
With a cable output, HDAs can export a variable number of results through their fixed ports (see Export all AOVs of a file through an HDA).
-
With a cable port, HDAs can accept a variable number of inputs (see Accept a variable number of layers on an HDA).
-
A cable wired into an ordinary port of a node forces the node to loop over its wires (see Effect of cable inputs).
-
Wires of a cable can be distributed among the inputs of a node, which lets you potentially connect a cable instead of many wires. This works through input overrides or for special variadic inputs.
-
Cables can store structured data. For example, the Preview Material COP outputs a cable that contains all its constituent maps. This makes it easier to carry the material around and combine it with other materials (see Author a material cable and Blend two materials).
Input Override and All Outputs cables ¶
Some Copernicus nodes have green blocks on their upper-left or upper-right sides. These are known as the following:
-
Upper-left block: Input Override Port
-
Upper-left block’s wire: Input Override Cable
-
Upper-right block: All Outputs Port
-
Upper-right block’s wire: All Outputs Cable
The Input Override Port takes the Input Override Cable and overrides the node’s usual inputs. Add this port to any COP node by choosing Add Input Override Port from the parameter editor’s Gear menu. Overrides are applied by matching wire names in the Input Override Cable against the node’s input labels.
Note
Network wires take precedence over the Input Override Cable. For example, if the Input Override Cable has a wire named bright
and the bright
input port on the node has a wire connected to it, then that concrete wire is used instead of what comes in through the Input Override Cable.
The All Outputs Port generates the All Outputs Cable, which packs the node’s outputs into a cable. Wires of the All Outputs Cable are named based on output labels of the originating node. This port is especially useful for procedurally grabbing variadic outputs (for example, from the File COP). The All Outputs Port is present on any COP that has the possibility of generating more than one output.
How to use cable nodes ¶
To... | Do this |
---|---|
Create a cable |
|
Turn a cable back into multiple wires |
|
Combine two cables |
|
Switch between two cables |
|
Separate a cable based on filters |
|
Edit a cable |
You can use other nodes to edit a cable in the following ways:
|
Effect of cable inputs ¶
Connect cables to ordinary ports to force the node to process each wire of the cable. This is similar to unpacking the cable, connecting each individual wire to a new copy of the target node, and then packing all of those results back into a cable. Likewise, cables of the same size can connect to different inputs of the node. In this case, each cook of the node uses a different set of wires from these cables. If a simple wire is connected to one of the other ports in this scenario, its data is used for cooking every output wire.
For example, you have a Cable1
that consists of C
(RGBA), depth
(Mono), and diffuse
(RGB) wires and a Cable2
that consists of color
(RGBA), depth
(Mono), and Cd
(RGB) wires. If you connect Cable1
and Cable2
to the Blend COP’s bg
and fg
inputs, respectively, the blend
output is a cable with the same structure as Cable1
. If you also connect a Mono layer to the node’s mask
input, that mask affects the result of blending for all three output wires.
Note
Since you can’t currently nest cables, the above example doesn’t work for operators with prescribed cable outputs.
Many nodes with variadic inputs (for example, Contact Sheet COP and Stamp Points COP) also accept a cable in the variadic port. When a cable is connected to such an input, its wires distribute to subsequent subports. For example, if a cable with four Mono wires connects to a Contact Sheet COP, it acts as if the four wires were individually connected to the node.
How to utilize cables ¶
To... | Do this |
---|---|
Export all AOVs of a file through an HDA |
You can now put down an instance of this HDA, select a file, and click Add AOVs from File. Its output cable contains every AOV in the selected file. |
Accept a variable number of layers on an HDA |
You can now put down an instance of this HDA and connect a cable with several layers to it. The wires of this incoming cable are assembled into a mosaic for the output. |
|
|
Blend two materials |
![]() |
See also |