Instancing a random shape with a random start frame


Here I’m instancing a group of Arnold standin sequences, and giving each instance a different start frame. (Each standin sequence is an animated bulge on a cylinder.)
random shape w random offset
PS It works fine until you go past the last frame of the sequence, because looping or clamping the ShapeInstanceTime doesn’t seem to prevent SItoA from loading the non-existent ass file.

Aligning particles and making instances look at something


Dealing with particle orientation and rotation can be frustrating, especially when you’re first learning.

Here, I’ve got a bunch of faces instanced onto a disc, and I want all of them to to look the closest point on the grid that’s in the center of the disc. Because the initial local Z axis of some particles faces “away” from the grid, you get can some weird popping and flipping. Here’s an illustration of the problem from an earlier test, when I was aligning the faces to look at a specific point. Notice how only the instances on one side of the null have problems.

So, I use the dot product to determine whether the local Z axis faces “away” from the target grid, and if so, I make an adjustment of 180 degrees, and then the faces align nicely.

A negative dot product tells me that the angle between the local Z axis and the vector to the closest point on the grid is more than 90 and less than 270.

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.