Instance master models and point clouds


Point clouds are just another type of 3D object, so you should be able to safely put them in an instance master, and have them show up in the instances.

This ICE tree adds a point for each person in the instance master. Here I added some spheres, but I could just of easily instanced some geometry and put a halo over everyone’s head.

If the instance master model is not at (0 0 0), then when I parent the point cloud to the model, the point cloud gets a local pos offset. So, I can either manually reset the local pt cloud pos to 0 0 0, or handle it in the ICE tree (by undoing the local pos offset by multiplying by the inverse transfo matrix).

Selection filter for objects with ICE trees


Here’s a custom filter for selecting objects with ICE trees: psCustomFilters.xsiaddon. The filter appears as Obj_w_ICETree in the filter list of the Select panel in the MCP:

You can use this filter in the MCP Select panel (choose the filter and then press Ctrl+A to select all objects with an ICE tree).

Or you could make a toolbar button with these snippets:

// JScript
SelectAllUsingFilter("Obj_w_ICETree", siCheckComponentVisibility, null, null);
#Python
from siutils import C		# win32com.client.constants
Application.SelectAllUsingFilter("Obj_w_ICETree", C.siCheckComponentVisibility, "", "")

Copying a polygon attribute to vertices


This question came up last weekend (on si-community and xsibase): how do I copy a polygon attribute to a point attribute?

As Chris_TC and gray pointed out, a point can be associated with multiple polygons. So you use VertexToPolygons to either build a per-point array of polygon attribute values, or you do something like average the polygon attribute values and store that as a point attribute value.

Using arrays to avoid Repeat part II


Part I is here

Another building block for using arrays instead of Repeat loops: an array that looks like [0,0,0,0, 1,1,1,1, 2,2,2,2, …].

Again, the trick is to use this array as the indices for Select in Array.

Here’s how to build this kind of array:

Here’s a simple example. I get the positions of the objects in a group, and then use those positions to add points in a point cloud. Basically, I have a group of objects, and an array of vectors (the interpolated array). When I add a point, I take an object position and add a vector to it to get the point position.

In pseudo-code:

For each object in group
      for each vector in array
             Add Point
             Point Position = vector + object position 

If that ICE tree is hard to follow, then it may help to use some attributes to store intermediate values(arrays). That way you can separate out some branches of the tree:

Creating a point cloud using the positions of model instances


This is a scenario that came up on xsibase: suppose you have a model that includes multiple objects, and that you create many instances of that model. How do you create a point cloud that has a point for every object in every instance?

Put the model objects in a group, and put the instances in another group, so that you have a setup like this:

Then you can use Get Data with the groups to get two arrays: an array of the object positions, and an array of the instance positions. The objects are all positioned relative to an instance, so you can work out where to add the points.

Here’s how to do it with a Repeat node. Note that you need just one Repeat node: you don’t have to loop over the object kine.local.pos arrays, you can just use Multiply Vector by Matrix to multiply an array of vectors by an array of matrices. If you understand that, then you’re “thinking in ICE”.

Here’s how to do it without a Repeat node. Again, if you understand this, you understand how to think in ICE.