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.
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.
Make sure you use the *Emit Location* of the generated points not the samples.
I had to do this quick, but this still seems to take me down the same path as my original approach…
Screenshot:
http://screencast.com/t/qasAHoiw
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.
There was no EmitLocation unless I set it up:
http://screencast.com/t/yhbHCznsbJ
**Just plug the Generate Sample Set node straight into the Add Point Node **
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…
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…
The Generate Sample Set idea sounds so good though. I’ll take another look tomorrow, thanks!