Attrib Create
surface node
Adds or edits user defined attributes.
See also: Attribute, Attrib Copy, Attrib Mirror, Attrib Promote 4 more , Attrib Transfer, Point, Primitive, Vertex
The attribute can be a float, integer, vector, or string type. If the local variable name is not specified, the attribute name (all uppercased) will be used. After adding a user attribute, the local variable can be used anywhere in operations where local variables are allowed.
Note that strings are added as “Index” attributes, not as actual “String” attributes. This is only important if you are using these with the HDK.
Parameters
|
Name |
Name of the attribute |
||||||||||||
|
Local Variable |
Name of the local variable that corresponds to the new attribute. If you leave this field blank, the local variable is the name of the attribute in all UPPERCASE. To access individual components of an multi-component attribute, the user can append to this name:
For example:
|
||||||||||||
|
Class |
Where to add the attribute to the geometry. Can be a point, detail, primitive, or vertex attribute. |
||||||||||||
|
Type |
Float, Integer, Vector, or String. |
||||||||||||
|
Size |
Number of elements in the attribute |
||||||||||||
|
Default |
Default attribute value |
||||||||||||
|
Write Values |
Disabling the writing of values prevents the AttribCreate SOP from changing the attributes. This is useful if you merely want to ensure the attribute exists but want to preserve any existing values. |
||||||||||||
|
Value |
Value to set attribute to |
||||||||||||
|
String |
Value to set the string to |
Vector attributes are modified by transforms. Float attributes are not.
Local variables
Variable names ending with 2 refer to the geometry from the second input, if applicable. For example, PT2 is the current point number from the second input.
|
TX, TY, TZ |
Point position. |
|
TW |
See WEIGHT. |
|
CEX, CEY, CEZ |
The centroid of the geometry. |
|
XMIN, XMAX |
The X extents of the bounding box of the geometry. |
|
YMIN, YMAX |
The Y extents of the bounding box of the geometry. |
|
ZMIN, ZMAX |
The Z extents of the bounding box of the geometry |
|
SIZEX, SIZEY, SIZEZ |
The size of the bounding box. |
|
BBX, BBY, BBZ |
The point’s relative position in the bounding box. |
|
WEIGHT |
Point spline weight. |
|
PT |
The point number of the currently processed point. |
|
PR, NPR |
Primitive number & total number of primitives. |
|
VTX, NVTX |
Vertex number & total number of vertices. |
|
NPT |
The total number of points in the template geometry. |
|
LIFE |
Percent of total life used (from 0 to 1). |
|
NX, NY, NZ |
Normal vector. |
|
MAPU, MAPV, MAPW |
Point or vertex texture coordinates. |
|
VX, VY, VZ |
Velocity direction. |
|
MAT |
Material name specification. |
|
CR, CG, CB |
Diffuse point or vertex color. |
|
CA |
Point or vertex alpha value. |
|
COMX, COMY, COMZ |
Center of mass. |
|
LOD |
Level of detail. |
|
RESTX, RESTY, RESTZ |
The rest position. |
|
DIST |
Distance from particle to last collision. |
|
MASS |
Point mass. |
|
DRAG |
Point drag. |
|
TENSION |
Spring tension of an edge. |
|
SPRINGK |
Elasticity of a point. |
|
PSCALE |
Particle Scale. |
|
AGE |
The seconds a particle in the template has been alive. |
|
CREASE |
Point or vertex crease weight value. |
|
AREA |
The surface area of the primitive (created by the Measure SOP). |
|
PERIMETER |
The perimeter of the primitive (created by the Measure SOP). |
|
ID |
The ID of the particle in the input. |
|
UPX, UPY, UPZ |
The vector pointed in the up direction. |
|
WIDTH |
The width of the curve. Used by mantra for rendering curves & polywire for generating trees. |
|
SEGS |
Number of segments to divide a curve up into in Polywire (created by L-systems). |
|
DIV |
Number of divisions to build the circle swept with Polywire (created by L-systems). |
|
LAGE |
The age of the point in the L-system computation. |
|
ARC |
Arc length distance from root in the L-systems. |
|
GEN |
Generation in the L-systems. |
|
CURLAYER |
Stores the currently processed layer for texture/materials (set by the Layer SOP). |
|
MAXLAYER |
The number of layers that are considered active for display. |
Example files
CurveTexturing
$HFS/houdini/help/examples/nodes/sop/attribcreate/CurveTexturing.cmd
The AttribCreate SOP can be used to provide various object-specific attributes by allowing both a label and a value to be given to the newly created attribute.
In this example, the AttribCreate SOP is used to control the width of a curve at rendertime. There are two versions, chosen by a Switch SOP.
-
One AttribCreate SOP gives a constant width attribute in the X axis.
-
The other uses an expression to control the thickness of the curve to create a tapering effect.
The attribute is used by Mantra at render time. To see the results, right-click on the render icon in the viewport, and choose “render_example”.