In 5.6.1, casting a PCGData object to a PCGPointData object retrieved via a PCGData Collection inside a Post Generation function fails. In UE 5.5, we use Post Generation functions to access generated point data inside a Blueprint after the PCG graph executes. This process involved extracting tagged data directly from the passed PCGData Collection. To access the actual point data, the PCGData object needed to be casted to a PCGPointData object. This worked great for cases where a Blueprint actor needed to utilize data generated by a PCG graph.
I was able to cast the PCGData object into a PCGPointArrayData object, but I’m unable to extract the actual point data generated in the graph.
Is there an alternative way of extracting PCG Point Data in a post generation function in 5.6?
Steps to Reproduce
To reproduce this issue, create a new Blueprint with a PCG Component. The PCG component should have a Post Generation function set to a valid Blueprint function, which should take a PCG Data Collection as an input. The PCG graph should route arbitrary point data to the Output pin in the graph. Inside the post generation a function, a similar set of nodes to the provided screenshot can be used to extract the tagged data from the collection and reproduce the failed cast to PCGPointData.
Hi Bryson, 5.6.1 introduces PCGPointArrayData which is enabled by default. This means that CVar PCG.EnablePointArrayData = 1 by default.
With this the point data output is going to be of type PCGPointArrayData and not PCGPointData. You can disable the CVar but I would encourage upgrading your Blueprints to use the PCGPointArrayData instead. You can also if you really need it convert that PCGPointArrayData to PCGPointData using ToPointData() on the PointArrayData.
PointArrayData brings speed and memory improvements so it is going to be the format used going forward.
Hey, I have the same problem. So if we use the new PCGPointArrayData how do I get the actual point data out of this array? I generate a grid of points in the pcg graph and then use them in a blueprint. In 5.5 I just cast to PCGPointData and do GetPoints and voila. But alas I have not found a way to do this in 5.6.