isbound VEX function

Parameters in VEX can be overridden by geometry attributes (if the attributes exist on the surface being rendered).

Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

  1. int isbound(string variable_name)

Parameters in VEX can be overridden by geometry attributes (if the attributes exist on the surface being rendered). If the geometry overrides the default attribute, this function will return 1. Otherwise it will return 0.

Note

Though this function is defined for all contexts, it is only useful in the Displacement, Surface, POP, and SOP contexts. No other contexts can currently bind geometry attributes to VEX variables.

Example, in a POP function:

pop
mycolor(vector uv=0; string map="")
{
    if (isbound("uv") && map != "")
    {
    // User has texture coordinates here, so create
    // velocity based on a texture map.
    v = colormap(map, uv);
    }
    else
    {
    // No texture coordinates, so use a random value
    v = random(id);
    }
}