Go to: Related nodes. Attributes.

Set Range is a utility node that allows you to take values in one range, and map them into another range.

For example: Say you have an rotation attribute whose value goes from 0 to 360. You want to use this attribute to drive a color value, which goes from 0 to 1.

To do this:

Set the Old Min and Old Max attributes to the range the the incoming attribute has, in this case 0 to 360.

Set the Min and Max attributes to the desired range, in this case 0 to 1.

Connect your rotation attribute to the Value attribute.

Once that is done, the Out Value attribute of this node will provide you with numbers between 0 and 1, that you can use for your color.

The input of Set Range is a triple value, so you can use it for vectors, or colors. If you want to set the range for single values, just use one of the X, Y, or Z channels.

Here is the mathematical calculation done by this node:

OutValue = Min + (((Value-OldMin)/(OldMax-OldMin)) * (Max-Min))

In the table below, important attributes have their names listed in bold in the description column.

This node is MP safe

Node nameParentsClassificationMFn typeCompatible function sets
kNamedObject
kDependencyNode
kSetRange

## Attributes (24)

Long name (short name)TypeDefaultFlags
`value` (`v`) float30.0, 0.0, 0.0
 Value. This value will be mapped from the old range (Old Min to Old Max) into the new range (Min to Max).
`valueX` (`vx`) float0.0
 Input Value X component
`valueY` (`vy`) float0.0
 Input Value Y component
`valueZ` (`vz`) float0.0
 Input Value Z component
`min` (`n`) float30.0, 0.0, 0.0
 Min is the minimum value in the new range.
`minX` (`nx`) float0.0
 Min value X component
`minY` (`ny`) float0.0
 Min value Y component
`minZ` (`nz`) float0.0
 Min value Z component
`max` (`m`) float30.0, 0.0, 0.0
 Max is the maximum value in the new range.
`maxX` (`mx`) float0.0
 Max value X component
`maxY` (`my`) float0.0
 Max value Y component
`maxZ` (`mz`) float0.0
 Max value Z component
`oldMin` (`on`) float30.0, 0.0, 0.0
 Old Min is the minimum value in old range.
`oldMinX` (`onx`) float0.0
 Old Min X component
`oldMinY` (`ony`) float0.0
 Old Min Y component
`oldMinZ` (`onz`) float0.0
 Old Min Z component
`oldMax` (`om`) float30.0, 0.0, 0.0
 Old Max is the maximum value in old range.
`oldMaxX` (`omx`) float0.0
 Old Max X component
`oldMaxY` (`omy`) float0.0
 Old Max Y component
`oldMaxZ` (`omz`) float0.0
 Old Max Z component
`outValue` (`o`) float30.0, 0.0, 0.0
 Out Value. This is the new calculated value.
`outValueX` (`ox`) float0.0
 Output Value X component
`outValueY` (`oy`) float0.0
 Output Value Y component
`outValueZ` (`oz`) float0.0
 Output Value Z component