trail to inherit one leading particle's color

Discussions about SOFTIMAGEs© Interactive Creative Environment©
User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 09:38
Location: Dijon, France

trail to inherit one leading particle's color

Post by Adam Kesher » 21 Mar 2013, 17:02

hey everyone,
I've been working on a simple scene lately.
I've made a cube and a particle is bouncing inside of it.
Everytime the particle hits a face of the cube, it changes color randomly.
Then I created another point cloud that creates a particle at every position
the lead particle has occupied in space, creating a kind of trail.
Problem is, I can't get the trail to inherit the lead particle's color. Each
"segment" of the trail should have a different color everytime the lead has
hitten a face.
I not big into ICE as you guessed but based on the kind of error message I
get when I try to set color in the trail's point cloud, I guess this is a context
problem, I watched a bunch of vids about context but still can't get it right.
Maybe my whole setup is off, maybe there's a more logic way of doing it.
Please feel free to leave your thoughts
Thanks in advance

Cheers

Image

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: trail to inherit one leading particle's color

Post by xsisupport » 21 Mar 2013, 17:12

Stick a Build Array from Set in there (after you get the color from the other point cloud) and then a Select in Array, and get element with index=0
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 09:38
Location: Dijon, France

Re: trail to inherit one leading particle's color

Post by Adam Kesher » 21 Mar 2013, 17:23

Steve thanks a lot, just tried it and it works pretty well !
Would you mind explaining why do we have to do the whole
array thing instead of just plugin the get color node please?
So I can get a better understanding of how things work.
Thanks again for the ultra fast answer

cheers

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: trail to inherit one leading particle's color

Post by xsisupport » 21 Mar 2013, 17:57

In this case, you have two point clouds with different numbers of points.
So a per-point Color on one point cloud doesn't match up with the per-point Color values on the second point cloud.
And even if the point clouds had the same number of points, ICE wouldn't just let you plug the Color values together directly, because different point clouds = different contexts.

So, in the ICE tree on pointcloud_trail, pointcloud_lead.Color is a per-point on a different point cloud.
We can get around that with Build Array from Set. Build Array from Set gives us a per-object context, and it is per-object for the current object (pointcloud_trail, the object that owns the ICE tree).

HTH
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 09:38
Location: Dijon, France

Re: trail to inherit one leading particle's color

Post by Adam Kesher » 21 Mar 2013, 20:34

Thanks for the explanation, very useful B-)