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 name Parents Classification MFn type Compatible function sets
setRange node utility/general kSetRange kBase
kNamedObject
kDependencyNode
kSetRange

Related nodes

blendColors, clamp, lightInfo, gammaCorrect, surfaceLuminance, contrast, luminance, rgbToHsv, hsvToRgb, samplerInfo, resolution, renderQuality, renderGlobals, renderGlobalsList, baseShadingSwitch, singleShadingSwitch, doubleShadingSwitch, tripleShadingSwitch

Attributes (24)

max, maxX, maxY, maxZ, min, minX, minY, minZ, oldMax, oldMaxX, oldMaxY, oldMaxZ, oldMin, oldMinX, oldMinY, oldMinZ, outValue, outValueX, outValueY, outValueZ, value, valueX, valueY, valueZ

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