Generate sample set, pointcloud, read positions over time

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
Joung Art
Posts: 10
Joined: 11 May 2010, 16:30

Generate sample set, pointcloud, read positions over time

Post by Joung Art » 03 Oct 2013, 17:39

Hi I generated points from a simulated pointcloud with Generate Sample Set on frame 1 only in a new pointcloud and want to update point positions from the external pointcloud over time.

I am stumped.

Chris_TC
Posts: 411
Joined: 22 Mar 2010, 17:43

Re: Generate sample set, pointcloud, read positions over time

Post by Chris_TC » 04 Oct 2013, 09:47

I'm not entirely sure whether I understand what you're doing. Is this what you want?
Get Pointcloud1.PointPosition -> Switch Context -> Set self.PointPosition

Joung Art
Posts: 10
Joined: 11 May 2010, 16:30

Re: Generate sample set, pointcloud, read positions over time

Post by Joung Art » 04 Oct 2013, 16:04

Thanks Chris.

Pointcloud1.PointPosition -> Switch Context -> Set self.PointPosition does not work unfortunately because there are already additional particles in the same cloud. I guess ICE can't identify the particles of the Pointcloud1 any more.

Maybe I could get the particle IDs out of the sample set. But then I would have to identify the particles which should receive the new point positions.

It maybe that the add point node assigns new IDs as there are already particles in the cloud.

Chris_TC
Posts: 411
Joined: 22 Mar 2010, 17:43

Re: Generate sample set, pointcloud, read positions over time

Post by Chris_TC » 05 Oct 2013, 14:02

Can you explain the setup in more detail?
You have one simulated pointcloud(1) with e.g. 1,000 particles. And you have another pointcloud(2) with e.g. 100 particles. Now you want to add 1,000 particles to pointcloud(2) and have them match the positions from pointcloud(1), is that right?

If this is right, then you know that all new particles have IDs greater than 99 (because IDs 0 to 99 already existed before you added the new particles). So you'd do something like this:
Get pointcloud1.PointPosition -> Build Array From Set -> Select in Array -> If self.PointID Greather Than 99 -> Set self.PointPosition
For the index of the Select in Array you would use (self.PointID minus 100)

If you don't know how many particles existed before you added new ones, you can query that via Get self.NbPoints, and possibly store the value in a custom attribute before you add new points.

Joung Art
Posts: 10
Joined: 11 May 2010, 16:30

Re: Generate sample set, pointcloud, read positions over time

Post by Joung Art » 06 Oct 2013, 00:33

Yes Chris, That is what I am trying to do.
Not all of your suggestions worked. See in the screen shot how far I got. It works for the first point of the imported pointcloud. Select in Array Index is 0. If I change it to 2 for example, I get another.

I have to identify the imported points with a custom property 'Imported'. Otherwise all points of the PC get the point position. So now, if I could select all appropriate points in the point position array it would be working.

I would have to get the point IDs from the Sample Set or from the Add Point Node. Unfortunately just plugging in the point ID into the Select in Array Node does not work for either.
Attachments
ImportPoints.JPG

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Generate sample set, pointcloud, read positions over time

Post by grahamef » 07 Oct 2013, 19:01

I think you are overcomplicating things. Why can't you use Clone Point to copy particles from cloud A to cloud B?

Joung Art
Posts: 10
Joined: 11 May 2010, 16:30

Re: Generate sample set, pointcloud, read positions over time

Post by Joung Art » 07 Oct 2013, 23:00

It appears to me that Clone Point clones the points but not their movement.

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Generate sample set, pointcloud, read positions over time

Post by grahamef » 07 Oct 2013, 23:36

Clone Point is supposed to copy over all attributes, including the velocity on the frame on which it is cloned. So if the second cloud is simulated, you'll need to ensure that the same forces are applied each frame. You'll also need to store a Boolean on the first cloud's points to ensure they don't get re-cloned every frame.

On the other hand if you don't need a simulation on the second cloud, then you can clone in an ICE tree in its modeling region. Every frame, the second cloud will get rebuilt from the ground up, so it will look like the points are following.

As a last resort you can store the original particles' ID as a custom integer attribute when you create their equivalents in the second cloud, then on every frame store the first cloud's pointpositions in an array using Build Array from Set, and use the custom integer to look up the position to use. You'll need some logic to exclude particles that were already in the second cloud.

Joung Art
Posts: 10
Joined: 11 May 2010, 16:30

Re: Generate sample set, pointcloud, read positions over time

Post by Joung Art » 08 Oct 2013, 03:49

Thank you grahamf. The third scenario would be mine.

I got it to work up to a point. I can get the PCA one into PCB and replay it as long as there are no additional particles. I get stuck with the logic to exclude particles that are already there.
Attachments
On Emission.JPG

Post Reply

Who is online

Users browsing this forum: brandwatch [Bot] and 29 guests