Generate sample set, pointcloud, read positions over time
Generate sample set, pointcloud, read positions over time
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.
I am stumped.
Re: Generate sample set, pointcloud, read positions over time
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
Get Pointcloud1.PointPosition -> Switch Context -> Set self.PointPosition
Re: Generate sample set, pointcloud, read positions over time
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.
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.
Re: Generate sample set, pointcloud, read positions over time
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.
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.
Re: Generate sample set, pointcloud, read positions over time
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.
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.
Re: Generate sample set, pointcloud, read positions over time
I think you are overcomplicating things. Why can't you use Clone Point to copy particles from cloud A to cloud B?
Re: Generate sample set, pointcloud, read positions over time
It appears to me that Clone Point clones the points but not their movement.
Re: Generate sample set, pointcloud, read positions over time
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.
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.
Re: Generate sample set, pointcloud, read positions over time
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.
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.
Who is online
Users browsing this forum: brandwatch [Bot] and 31 guests