Browse the wiki

06. Attributes and Groups

Here, we'll focus on Attributes and Groups in Houdini.

Attributes and Groups

One of the major strengths of Houdini is the ability to create custom Attributes and then feed them down the hierarchy.

Attributes

You can create attributes at 4 different levels (Vertex, Point, Primitive and Detail). For Detail, one attribute will be created for the entire network. For Vertex, an attribute will be created for each Vertex, the same goes for Point and Primitive.

Try this out yourself by doing the following:

  • Create a sphere and dive in to Geometry
  • Create an Attribute Create SOP and plug the output of the sphere1 into the input of the Attribute Create node.
  • Set the Name of the Attribute Create SOP to myvar and the Value to 2.
  • Open up the Geometry Spreadsheet to double-check that the new attribute has been created.

We can also use Viewport Visualizers to see the results. To do this, do the following:

  • In the Scene View Display Bar RMB click over the Visualization tool and + > Marker

  • When the Edit Visualizer window pops up, under Attribute, type myvar.

You should then see something like so…

The output of the Attributes can then be fed into Groups, allowing you to easily manipulate a predefined selection of either Vertices, Points, Primitives or the entire node (Detail).

You will find that you cannot feed Point attributes into Primitive level parameters. However, you can feed Detail attributes into Primitives and Primitive attributes into Vertices and Points.

Global Expression Variables

We can use expressions and variables to access and manipulate the attributes.

There is a list of Global Variables that can be used (based on context) to connect parameters to frame changes and more. For example, type the expression:

$FF

…into the Radius Y parameter of a sphere. The FF is for a Global Expression that will drive the parameter using the frame float value.

Global Expressions can, as the names suggests, be used anywhere and everywhere. However, Global Variables cannot manipulate attributes on geometry. To edit attributes (point position, number, weight, bounding box, etc.), you can use Standard Variables.

Unlike Global Variables, Standard Variables cannot be used everywhere and only certain variables can be used for certain parameters. For example, on an xform (transform) node, you can you CEX, CEY and CEZ to affect the centroid of the input, however, you cannot use TX.

Training

For more information on all things software related, you can check out our courses here:

The Connection Programme

If you are a fan of mixing science with art, or maths with creative thinking, then join our Connection Programme, where we’ll be exploring VFX, animation and games from the core fundamentals:

Links

Support CAVE Academy

Here at CAVE Academy the beauty of giving and sharing is very close to our hearts. With that spirit, we gladly provide Masterclasses, Dailies, the Wiki, and many high-quality assets free of charge. To enable the team to create and release more free content, you can support us here: Support CAVE Academy

Leave a Comment





Support CAVE Academy

Helping others through learning and sharing