Go to: Related nodes. Attributes.
If inLevel[0] is true, then output[0] will be true.
If inLevel[n] is true, then output[n] will be true.
There is additional control for overriding the values
that pass through the node.
You must initialize all multi attributes to the same, correct size. In the example below, notice that the displayLevel attribute is explicitly initialized to have the same number of elements as the output attribute.
For example, you want to simulate an LED pixel board where an array of lights/objects turn on and off. You can connect each object's visibility to the chooser node and control the chooser node programmatically. See the example.
Use the displayLevel attribute to override the connection between the inLevel and output attributes. This is useful if there are connections on inLevel and you want to override the incoming values. There are three values for displayLevel[n]:
Historical note: this node was originally created to accommodate the level-of-detail (lod) feature; hence the confusing names and references to "lod".
Examples:
polyCube; move -r 2 0 0; polyCone; move -r 4 0 0; polySphere; move -r 6 0 0; polyCylinder; move -r 8 0 0;createNode chooser; connectAttr chooser1.output[0] pCube1.visibility; connectAttr chooser1.output[1] pCone1.visibility; connectAttr chooser1.output[2] pSphere1.visibility; connectAttr chooser1.output[3] pCylinder1.visibility; int $num = `getAttr -size chooser1.output`;
Initialize this multi attribute to match the output attribute Initialize to 0 means the input attr will be passed to the output
for( $i = 0 ; $i < $num; $i ++ ) { setAttr chooser1.displayLevel[$i] 0; }
Make all objects visible by setting the inLevel attribute.
for( $i = 0 ; $i < $num; $i ++ ) { setAttr chooser1.inLevel[$i] 1; }
Make all objects invisible
for( $i = 0 ; $i < $num; $i ++ ) { setAttr chooser1.inLevel[$i] 0; }
Make every other object invisible
for( $i = 0 ; $i < $num; $i ++ ) { if( $i % 2 == 0 ) setAttr chooser1.inLevel[$i] 0; else setAttr chooser1.inLevel[$i] 1; }
Node name | Parents | Classification | MFn type | Compatible function sets |
---|---|---|---|---|
chooser | node | utility/scalar:drawdb/shader/operation/chooser | kChooser | kBase kNamedObject kDependencyNode kChooser |
plusMinusAverage, reverse, vectorProduct, choice, blend, blendTwoAttr, blendWeighted, blendDevice
Long name (short name) | Type | Default | Flags | ||
---|---|---|---|---|---|
displayLevel
(dl )
| enum | int0 | ![]() ![]() ![]() ![]() ![]() ![]() | ||
inLevel
(il )
| bool | false | ![]() ![]() ![]() ![]() ![]() | ||
output
(o )
| bool | false | ![]() ![]() ![]() | ||