---
title: "PxrSwitch"
canonical: "https://rmanwiki-26.pixar.com/space/REN26/19661703/PxrSwitch"
format: markdown
---
This pattern is designed to evaluate different pattern networks based on an index that can be read from various nodes.

---


### Switch

#### Index

This float value indicates what part of the network to evaluate and is often read from an attribute. Values are read as:

-0.5 to 0.49 are input 0

  0.5 to 1.49 are input 1

  1.5 to 2.49 are input 2, so on and so forth.


### Inputs

#### Inputs RGB

An array of inputs to be evaluated based on the returned index value.


Below is a simple example where each sphere transform is assigned a user attribute as the index, 0.0, 1.0, 2.0. The available colors and their index are Red[0], Green[1], and Blue[2] (three inputs added to the Inputs RGB array)

The same [PxrSurface](https://renderman.atlassian.net/wiki/spaces/REN26/pages/19661415) is attached to the three spheres and a [PxrAttribute](https://renderman.atlassian.net/wiki/spaces/REN26/pages/19661579) node is connected to the Diffuse Color input of the material.

The attribute can be whatever name you desire with a Float data type.

![image](media://5cbfa7b7-c3e0-4608-85d5-c04823413fb4)