Using ICE Particle Attributes

 
 
 

Attributes are data that are associated with scene elements. Attributes can be stored on components, such as points, or on objects, such as point clouds, as shown here.

There are three types of attributes, as described in Notes on ICE Attributes: inherent, predefined, and custom. Some nodes and compounds automatically get and set certain attributes of any of these types, but you can also get and set particle attributes on their own.

Where Can You Find ICE Particle Attributes?

Particle attributes are everywhere — you just don't always know that they're there! Some are exposed as parameters in compounds, some you have to specify in nodes.

  • Attributes are used inside many compounds. In the compound property editors, they are disguised as parameters that you can set. For example, when you set the Initial Values parameters in the Emit compounds, you are setting the Init_AttributeName attributes (see ICE Particle Emission Attributes), as well as others.

  • Attributes are used in the Get Particle AttributeName and Set Particle AttributeName compounds. These compounds make it easy for you to quickly use specific particle attributes. They are simply the Get Data and Set Data nodes with a specific attribute already selected for you.

  • All attributes are available via the Get Data and Set Data nodes. You can get any ICE attribute in this way, and you can set most ICE attributes in this way.

For a list of all available ICE attributes, see ICE Attributes.

Getting and Setting ICE Particle Attributes

Getting attribute data from particles and setting attribute data for particles is something that you'll probably need to do a lot when creating ICE particle effects. In fact, you've already set attribute data if you have set parameters in most particle compounds.

You can get and set attributes for the particles in a point cloud. Some of these particle attributes are exposed in special Get Particle and Set Particle compounds to give you a head start, but you can also get a simple Get Data or Set Data node and expose any attribute in it that you need.

Tip

For more information on getting and setting data in general, see Getting and Setting Data in ICE Trees.

For information on setting attributes for spawned particles, see Setting and Adding Attributes for Spawned Particles.

There are several ways in which you can get or set ICE particle attributes:

  • The simplest way is to use a specific Get Particle AttributeName compound from the Getters group on the Task Particles tab of the preset manager, as shown here:

    Or get a Set Particle AttributeName compound from the Setters group, as shown here:

    These compounds use the Self. string as a reference plus the appropriate attribute name. For example, if you want to use the Age attribute, choose the Get Particle Age compound; or if you want to set the Size attribute, choose the Set Particle Size compound. Everything's already set up for you.

  • Drag a Get Data or Set Data node into the tree from the Data Access group on the Tool tab of the preset manager. Then enter the name of the referenced object or the Self. string in the Reference text box — see Specifying Scene References for information on this.

  • Drag an object's name (not its icon) from an explorer into the tree. This automatically creates a Get Data node that is pre-filled with the object's name.

    You then need to specify an attribute in any of these ways:

  • If you used a Get Particle AttributeName compound from the Getters group, or a Set Particle AttributeName compound from the Setters group, the attribute is already specified for you, but you can change it using either of the following ways.

  • Click the Explorer button in the Get Data or Set Data property editor and then select the attribute you want from the object's list.

  • If you know the attribute's name, simply enter it in the Reference text box, after the reference object's name or Self string and the period.

    For example, to use the AgeLimit attribute on the particles in the point cloud called PointCloud2, you would enter AgeLimit after the object name and period.

    Or to set the Color attribute for the particles in any connected point cloud you would enter Color after the Self. string.

Using ICE Particle Attributes In the Render Tree

The ICE attribute shaders allow you to access a particle's ICE attributes that are driven by ICE trees. You can also apply the Attribute shaders to geometry that is used as shape instances on ICE particles.

These shaders allow you to control your shading based on calculations done by an ICE tree, thus creating a link between data in the ICE tree and data in the render tree. For example, you can make smoke dissipate or a color change with a gradient depending on the velocity of the particle.

To use the attribute shaders, you must make sure that the particles first have the appropriate attribute created for it in the ICE tree.

For more information, see Bringing ICE Data into the Render Tree with Attribute Shaders.