On this page |
Attributes
Attributes are named values stored on vertices, points, primitives, and objects. Point color, position, UV coordinates , spline weight (W
), and normal, for example, are stored as point attributes.
-
Houdini sets some point attributes that you can use in expressions. For example, you could set the per-point color based on the vertical position (
PY
) of the point. -
Certain attributes you can set manually and if they're present they will be used by Houdini. For example, the dynamics solvers and rendering engines will often use certain attributes on the geometry if they exist.
-
You can also set your own custom attributes to be used by your node expressions, scripts, exporters, and so on.
The surface nodes in the Attributes group of the tab menu set different types of attributes. You can also set or create arbitrary attributes using the Attribute SOP.
To see the attributes on the geometry in a node, press on the node’s tile in the network editor and choose Spreadsheet to open the geometry spreadsheet for the node.
Particles also have attributes, and attributes are very important when geometry and particle systems interact. For example, particles emitted from geometry inherit (by default) the attributes of the point from which they are emitted, and you can create interesting effects by transferring attributes between surfaces and particles using the Attribute Transfer POP.
Geometry components
You can create/set attributes using the generic Attribute Create surface node, or the Vertex, Point, Primitive nodes. You can attach attributes to vertices, points, primitives (e.g. polygon faces), or the entire piece of geometry (called the "detail" level).
Note
When you merge two or more branches in a geometry network, if a detail attribute with the same name exists in multiple branches, Houdini uses the value in the first branch. If the attribute is a string array, Houdini merges the arrays.
Attribute precedence
When two components in the same geometry have an attribute with the same name, the attribute on the "lower level" of geometry is used, so:
-
Vertex attributes override
-
Point attributes override
-
Primitive attributes override
-
Detail (whole geometry) attributes
-
-
-
Applying nodes to components based on attribute values
Most surface nodes have a Group field that lets you enter a named group or a pattern to select which components the node should apply to. This field recognizes special syntax that lets you select components by the value of an attribute. For example, in a Point node's Group field, @foo>5
selects all points whose foo
attribute is greater than 5
.
See the section on manually specifying groups for more information.
Intrinsic attributes
Intrinsic attributes are computed values derived from the geometry that you can access as if they were attributes. For example:
Examples of intrinsic attributes
Detail |
|
Number of points in the geometry |
Detail/primitive |
|
Bounding box of the geometry |
Primitive |
|
Surface area of the geometry. |
Primitive |
|
Amount of memory used by the primitive. |
To... | Do this |
---|---|
See what intrinsic attributes are available |
|
Use intrinsic attributes |
|
Tip
Despite the name, some "intrinsic" attributes can actually be written to, causing Houdini or Mantra to change some internal setting. For example, you can set the intrinsic:unexpandedfilename
intrinsic attribute on a packed primitive.
Higher and lower precision storage
You can choose the numeric precision of attributes you create with the Attribute Create node, and/or convert attributes to higher precision types (at the cost of more memory) or lower precision types (to save memory) using the Attrib Cast surface node.
See the help for Attrib Cast for information on the available storage types and limitations.
Common attributes
The following attributes are commonly set by Houdini and/or used by Houdini if set by the user.
Geometry
|
vec3 |
Point position. The viewport uses this to lay out the points of the model in 3D space. |
|
vec3 |
Surface or curve normal direction. Houdini will compute the normal if this attribute does not exist. |
|
vec3 |
Velocity (used for rendering blur). |
|
vec3 |
UV coordinates for this point/vertex. |
|
float |
Level of detail. |
|
vec3 |
Rest position of this point. |
Shading
|
string |
The path to a material to use to shade the surface when rendering. Overrides the object’s material is present on primitives. |
|
string |
The path to an OpenGL shader to use to shade the surface in the viewport. |
|
string |
Detail/primitive. The name of a RenderMan shader. |
Shader overrides
Most shaders will use the override attributes to change how elements with the attributes are shaded.
|
vec3 |
Diffuse color override. The viewport uses this to color OpenGL geometry. |
|
float |
Alpha transparency override. The viewport uses this to set the alpha of OpenGL geometry. |
|
vec3 |
Specular color override. |
|
vec3 |
Reflect color override. |
|
vec3 |
Transmit color override. |
|
vec3 |
Emission color override. |
|
float |
Roughness override. |
|
float |
Fresnel coefficient override. |
|
float |
Shadow intensity override. |
|
float |
Shadow bias override. |
Point and line display
The viewport uses the pscale
attribute to scale sprites and points. The Disc scale display options lets you further scale discs.
|
string |
Path to a material node for shading sprites. |
|
vec3 |
Additional sprite scaling. |
|
float |
Sprite rotation (around camera angle) in degrees. |
|
float |
Line width (in world space units), for drawing open curves. If this attribute does not exist, the curve is drawn as a thin line instead of as a ribbon with thickness. |
Viewport
|
int |
If this detail attribute is 1, the geometry always appears as wireframe in the viewport. If this detail attribute is -1, the geometry always appears as shaded in the viewport. |
|
int |
If this detail attribute is not 0, the geometry always appears without lighting. |
|
int |
If this detail attribute is not 0, all points will be rendered as sprites, even if they are connected to geometry. Normally only unconnected points are rendered. |
|
float |
Controls the cusp angle used for generating normals when the geometry doesn’t have any. 180 will produce entirely smooth point normals. |
See also |