Copying StrandColors from cached strands to a point cloud

Suppose you had to load a cached strand simulation, and convert that to a point cloud of plain old points. Part of the job would be to copy the stand colors over to the new points, so let’s take a look at that.

First, and I didn’t know this, when you cache strands the StrandColor attribute isn’t cached, just a single Color per strand. So let’s rebuild the StrandColors:
Now we have a per-point StrandColor array on the point cloud that reads the cached simulation. After spending awhile trying to avoid doing this, I found that this (the StrandColor array) was the easiest way.

Add Point is a pretty friendly ICE node, because it lets you take per-point data (StrandPosition) from some other point cloud and just plug it in, with no context problems.


It’s not so simple with the StrandColors. StrandColor is a per-point array on a different point cloud, and you can’t just plug it into Set Particle Color. Set Particle Color wants a color, not an array of colors. And it doesn’t want colors from some other point cloud either 😉

To get around that, I use Build Array from Set, which gives me a per-object array in the context of the current point cloud. Then I index into that array with Point ID, and I’ve transferred over the strand colors to the points.


10 thoughts on “Copying StrandColors from cached strands to a point cloud

  1. If you use a Generate Sample Set node from the source cloud set to all points and use those samples for the positions of the Add Point you can then pull whatever you like from the emit location. Strands included. 🙂

    • Ok, sound good.

      I still end up with a similiar context issue, because Generate Sample Set > Get StrandColor gives me per-generated element context and I need to get that into per-point context.

  2. You don’t need to set Emit Location manually, when you use samples as the input to the Add Point node, Softimage automagically creates the Emit Location attribute. Just plug the Generate Sample Set node straight into the Add Point Node and then delete everything piped into the On Creation port.

    • Hi Dan

      I know I seem stupid, but that just gives me 20 points.

      EDIT: hmm, maybe then with the EmitLocations I can get the StrandPosition arrays for those twenty points.
      Anyway. dinner time…

  3. I must be misunderstanding the goal! I’ve read the post twice over and I’m still not entirely sure I get it. Apologies Stephen, I’m sure it’s me missing the point here… :/

Leave a Reply to xsisupport Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s