Specifying and Modifying Components in ICE

 
 
 

When you model interactively using non-ICE operators, you specify the components to affect by selecting them in the viewports. When modeling procedurally with ICE, you must also specify the components somehow. This is done using the components' indices. You can specify components by explicitly listing their indices, or you can calculate the desired index values procedurally. Many of the topology nodes, like Delete Vertex, allow you to specify component indices as a single integer, an array of integers, or a (possibly filtered) set of integers.

Specifying Explicit Indices

You can specify a single component using the slider in an ICE topology node, or you can specify multiple components by connecting an array. You can create an array with the various array nodes, such as Build Array or String to Array.

Although explicit indices can be useful when learning ICE modeling, or when developing and debugging compounds, they are very limited. Calculating indices procedurally based on various conditions is much more powerful.

Calculating Indices Procedurally

One way to calculate indices procedurally is to filter out those that do not meet one or more conditions. The Test Polygon Inside Null compound is available in the Conditionals group of the Tasks Topology group in the preset manager, or you can build your own test using any calculation with a Boolean result.

Using the Test Component Index Compounds

The Conditionals group also contains compounds for specifying indices of each component type in a variety of ways: Test Edge Index, Test Polygon Index, Test PolyNode Index, and Test Vertex Index.

These nodes are especially useful when building compounds that allow for specifying components in any one of several ways.

Changing Component Types

Sometimes you need to switch component types. For example, you perform a test on polygons but you want to modify the associated edges. In that particular case, you can use the PolygonToEdges attribute. This attribute is an array of integers per polygon, containing the indices of its edges. There are similar attributes for converting between all polymesh components: vertex, edge, polygon, and node (polynode).

The following example shows how to build a filtered set of edge indices from a filtered set of polygons:

This example shows how to build an filtered set of polygon indices from an array of vertex indices:

Modifying Components

The nodes in the Topology category on the Tool tab of the preset manager modify the specified components. They perform the same operations as the equivalent non-ICE topology operators. You get a topology (or leave the input unconnected for Self.Topology), connect to a topology node, and set the Topology.

You can also use the compounds in the Modifiers group of the Tasks Topology group. They have built-in options for specifying components, and they have execute-type outputs so they can be connected directly to the ICETree root one after another.

Working with Loops

There are some compounds that can help when working with loops. Note that loops on open meshes are unidirectional, that is, from a specific edge to one or other border.

  1. Get a null. You will use this null to specify an edge by proximity.
  2. Connect Get Closest Edge Index from Null to the root, and connect the null's name. This stores the index of the closest edge as a custom parameter value that you can get later in the tree.
  3. Connect Get Edge Loop and set its options. This stores other custom attributes for the edges, polygons, and/or vertices in the loop.
  4. Finally get the components using Get Edge is on Edge Loop, Get Polygon is on Edge Loop, and/or Get Vertex is on Edge Loop, and use them with a modifier.