Houdini 20.5 Nodes Geometry nodes

Attribute Swap geometry node

Copies, moves, or swaps the contents of attributes.

On this page
Since 14.5

Parameters

Number of Swaps

The number of swaps/copies/moves to do. The node performs the operations in order.

Enable

You can turn is off to disable this individual swap/copy/move. This may be useful for seeing the effect of a swap or disabling a swap while setting up the rest of the network.

Method

What to do with the attributes.

Swap

Swap the values of the two attribute in-place. If one of the attributes doesn’t exist, this acts like Copy.

Move

Renames the source attribute to the destination name. If an attribute with the destination name already exists, it is deleted and replaced. This is the same as the Attribute Rename SOP with Overwrite Existing Attributes turned on.

You cannot move the point attribute P since it must always exist. If you try to move P the node will copy instead.

Copy

Copies the source attribute to the destination name. If an attribute with the destination name already exists, it is deleted and replaced.

Class

The level of geometry the attribute(s) exist at: vertex, point, primitive (face), or detail (entire geometry).

Source

An attribute name or pattern to swap/move/copy from. If this is a pattern, the Destination should also be a pattern with corresponding wildcards (see Attrib String Edit for more information).

Destination

An attribute name or pattern to swap/move/copy to. If this is a pattern, the Source should also be a pattern with corresponding wildcards (see Attrib String Edit for more information).

Type Info

What to do with the extra metadata on the attributes describing what type of information they contain.

For example, when stashing an attribute like P, you probably don’t want the stashed attribute to transform with successive deformers. In that case you would use “Preserve Destination” so ensure the new attribute has no transform hints. You would also use “Preserve Destination” if you copied attribute back onto P, so P would keep its transform hint.

Copy Source

The type info is copied/moved/swapped along with the values.

Preserve Destination

The type info is not copied/moved/swapped. If the destination attribute already existed, its type info is used, otherwise the destination has no type info.

Locals

Note

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.

AGE

The seconds a particle in the template has been alive.

ARC

Arc length distance from root in the L-systems.

AREA

The surface area of the primitive (created by the Measure SOP).

BBX, BBY, BBZ

The point’s relative position in the bounding box.

CA

Point or vertex alpha value.

CEX, CEY, CEZ

The centroid of the geometry.

COMX, COMY, COMZ

Center of mass.

CR, CG, CB

Diffuse point or vertex color.

CREASE

Point or vertex crease weight value.

DIST

Distance from particle to last collision.

DIV

Number of divisions to build the circle swept with Polywire (created by L-systems).

DRAG

Point drag.

GEN

Generation in the L-systems.

ID

The ID of the particle in the input.

LAGE

The age of the point in the L-system computation.

LIFE

Percent of total life used (from 0 to 1).

LOD

Level of detail.

MAPU, MAPV, MAPW

Point or vertex texture coordinates.

MASS

Point mass.

MAT

The string name of the current material (the value of the shop_material attribute).

MAXLAYER

The number of layers that are considered active for display.

NPT

The total number of points in the template geometry.

NX, NY, NZ

Normal vector.

PERIMETER

The perimeter of the primitive (created by the Measure SOP).

PR, NPR

Primitive number & total number of primitives.

PSCALE

Particle Scale.

PT

The point number of the currently processed point.

RESTX, RESTY, RESTZ

The rest position.

SEGS

Number of segments to divide a curve up into in Polywire (created by L-systems).

SIZEX, SIZEY, SIZEZ

The size of the bounding box.

SPRINGK

Elasticity of a point.

TENSION

Spring tension of an edge.

TX, TY, TZ

Point position.

TW

See WEIGHT.

UPX, UPY, UPZ

The vector pointed in the up direction.

VTX, NVTX

Vertex number & total number of vertices.

VX, VY, VZ

Velocity direction.

WEIGHT

Point spline weight.

WIDTH

The width of the curve. Used by mantra for rendering curves & polywire for generating trees.

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.

See also

Geometry nodes