vertex expression function

Returns the value of a vertex attribute.

Replaced by: hou.Vertex

All Usage Examples

See also: point, pointavg

Usage

vertex(surface_node, primitive_number, vertex_number, attribute, index)

attribute is the name of the attribute (eg. “Cd” for diffuse color). Two special attributes exist “P” and “Pw” which represent the position of the point in space (“Pw” allows you to access the W component of the position).

Note

This function will interpolate between point values if the vertex number is fractional, such as 3.35.

index is the component number (0, 0 to 3, or 0-4, depending on the datatype of the attribute) to read if the attribute is a vector or vector4. For floats, the index argument is ignored (just use 0). For example, for a color value, 0 means red, 1 means green, and 2 means blue. To read the all three (red, green, and blue) components, you would need to call the function three times with 0, 1, and 2 as the values for index.

Examples

vertex("/obj/geo1/facet1", 2, 3, "P", 0)

Return the X component of vertex 3 of primitive2 in the facet1 surface node of geo1.

point("/obj/geo1/facet1", 2, 3, "Cd", 2)

Returns the Z component of the color attribute of vertex 3 of primitive 2 in the facet1 surface node of object geo1.