Go to: Related nodes. Attributes.

This node provides a way to control a large set of boolean attributes. In it's simplest form, this node passes each boolean input to its corresponding boolean output.

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]:

  1. inLevel[n] will be passed to output[n]
  2. TRUE will be passed to output[n]; inLevel[n] will be ignored
  3. FALSE will be passed to output[n]; inLevel[n] will be ignored

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 nameParentsClassificationMFn typeCompatible function sets
choosernodeutility/scalar:drawdb/shader/operation/chooserkChooserkBase
kNamedObject
kDependencyNode
kChooser

Related nodes

plusMinusAverage, reverse, vectorProduct, choice, blend, blendTwoAttr, blendWeighted, blendDevice

Attributes (3)

displayLevel, inLevel, output

Long name (short name)TypeDefaultFlags
inLevel (il) boolfalsearrayoutputinputconnectablestorable
Input multi attribute that will be passed to the the output multi attribute
displayLevel (dl) enum0arrayoutputinputconnectablestorablekeyable
Use this to override the input attributes. 0 - inLevel[n] will be passed to output[n] 1 - TRUE will be passed to output[n]; inLevel[n] will be ignored 2 - FALSE will be passed to output[n]; inLevel[n] will be ignored
output (o) boolfalsearrayoutputconnectable
Multi-attribute passed from the input multi attribute.