Houdini 20.5 Nodes Geometry nodes

Attribute Copy geometry node

Copies attributes between groups of vertices, points, or primitives.

On this page

Attributes are copied from a source group to a destination group. The source and destination group must be of the same type, but there is no restriction on the attribute class.

Unless Match Attribute is enabled when copying, a general rule is applied when the size of the destination is greater than the size of the source. In this case, the elements of the source are repeated in a cyclic fashion. An analogous example follows:

Given a source pattern “ABC” and a destination pattern of length 8, the resulting destination pattern is “ABCABCAB”.

The same logic applies to vertices, points, and primitives. The order in which the source and destination groups are specified will affect the result of the copy.

There are two modes when Match Attribute is enabled. In the Match Attribute “By Values” mode, source and destination points and primitives will be matched up by equal values in the attribute specified by the Attribute to Match parameter. If there is no matching source value for a particular destination, then nothing will be copied to that destination. In the case of multiple matching source values, the source with the highest point or primitive number will be used.

In the Match Attribute “To Element” mode, the value in the attribute specified by the Attribute to Match parameter will be used for each destination element to denote the source element number to copy from. Copying will be skipped for destination elements where the specified source element number is not in the valid range or is not in the source group. The same logic applies to vertices, points and primitives.

If the copied attribute does not exist on the destination geometry, it is created automatically.

Example

Use the AttribCopy Operation to copy UV texture coordinates from one face to another. The group type should be primitives, and the attribute class should be points or vertices (depending on where the UV attribute has been applied).

Parameters

Source Group

A subset of the source geometry from which to read attribute values.

Destination Group

A subset of the destination geometry whose attribute values will be overwritten by the values contained in the source geometry.

Group Type

The type of elements referenced in the Source and Destination Group fields. The Source and Destination Group Types must be identical.

Match Attribute

When enabled, match source and destination elements differently than just performing a sequential copy.

By Values

Match source and destination points or primitives by equal attribute values. This option is only valid when the source and destination Group Type are both set to Points or Primitives.

To Element

Match destination vertices, points and primitives to the source element number specified by the attribute value for the Attribute to Match attribute.

Attribute to Match

With Match Attribute “By Values” enabled, this is the name of the attribute used to match source and destination points or primitives. This attribute must exist on both the source and destination geometry, and should be an integer or string. With Match Attribute “To Element”, this is the name of the destination attribute which specifies the source element number to copy from. This attribute must exist on the destination geometry, and should be an integer.

Attribute to Copy

Attribute to copy. “Color” and “Texture UV” are provided for convenience. Other attributes can be specified by name by selecting “Other Attribute”.

Attribute Name

When “Other Attribute” is selected, this is the name of the attribute to copy. Multiple attributes may be specified. If no attribute name is provided, all of the source attributes will be copied.

Allow P Attribute

P can be specified in the name to copy points, otherwise P is ignored even if it matches the pattern.

New Name

When enabled, this name will be used for the destination attribute. The second input is optional when this is enabled; the source attribute will be from the first input if there is only one. This supports multiple renames and even wildcard patterns, using * and ?, so long as the number of patterns is the same as the number of patterns in Attribute Name. For example, if Attribute Name is * and this is copied_*, attributes like P and N will be copied to copied_P and copied_N. It also supports reordering wildcards, so if Attribute Name is *_* and this is *(1)_*(0), an attribute named a_x will be copied to x_a.

Attribute Class

Where the attribute is located on the geometry. Vertex, point, primitive, and detail attributes can be copied. “Use Group Type” looks for the attribute in the same place as specified by the Group Type parameter. “Auto Detect” first looks in the place specified by the Group Type, then looks for the attribute in vertices, points, primitives, and detail (in that order).

Copy Local Variable

All local variables referring to the copied attributes are also copied. This cannot be used if New Name is used and different from Attribute Name.

Copy Data

Copies the actual attribute data contained in elements. Disabling this can be useful when you just need to copy over the attribute properties and meta data.

Examples

AttribCopyTessel Example for Attribute Copy geometry node

This is an example of how to transfer attributes from one geometry to another using the AttribCopy SOP.

A “smiley face” is painted onto a grid as a color attribute using the Paint SOP. The attribute is then transferred to another grid. Because of a discrepancy between the sizes of the grid, a tesselation occurs.

When there are differences between the sizes of the geometry, the AttribCopy SOP will repeat the pattern of the attribute in a cyclic fashion.

See also

Geometry nodes