Post navigation

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”

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. 🙂

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.

XSI and Softimage are registered trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.
This website is independent of Autodesk, Inc., and is not authorized by, endorsed by, sponsored by, affiliated with, or otherwise approved by Autodesk, Inc.