Let’s start by creating a new function, which will contain the whole process (you are free to apply the exact same principles as Events or any other set up). Let’s call it MyPointCloudFunction.

Creating new function in  Blueprint .

Creating new function in Blueprint.


We’ll start by retrieving the points from the cloud we want to update.

You can retrieve a Cloud from an existing Point Cloud Actor or Point Cloud Component by calling Get Point Cloud.

// Retrieve points from the cloud
TArray<FPointCloudPoint> MyPoints = MyPointCloud->GetPointCloudData();
Retrieve points to update.

Retrieve points to update.


Once we have our points stored as a local array, we can iterate over them and update the desired properties.

NOTE:
Because the Point Cloud Point structure is not fully exposed for Blueprint use yet, the modification process is a lot more complex then it would be otherwise - this is planned to be corrected for v0.6 release :)

// Change color of each point to random
for (int32 i = 0; i < MyPoints.Num(); i++)
{
    MyPoints[i].Color = FLinearColor::MakeRandomColor().ToFColor();
}

Change colors to random.


Now we need to re-assign the modified data back to our original Point Cloud asset.

// Assign the modified data set back to original cloud
MyPointCloud->SetPointCloudData(MyPoints);
Re-assign the point data.

Re-assign the point data.


And that’s it. For the purpose of this example I’ve used the cloud generated in the Building new Point Cloud tutorial. And the end result will look like this:

Final result.

Final result.


Here are the full code snippet and full-sized Blueprint screenshot of the complete process.

// Retrieve points from the cloud
TArray<FPointCloudPoint> MyPoints = MyPointCloud->GetPointCloudData();

// Change color of each point to random
for (int32 i = 0; i < MyPoints.Num(); i++)
{
    MyPoints[i].Color = FLinearColor::MakeRandomColor().ToFColor();
}

// Assign the modified data set to original cloud
MyPointCloud->SetPointCloudData(MyPoints);

Complete Blueprint of the function.