Hi all,
I am working in PCG context. My PCG graph lives in a blueprint and I’m trying to access data from static mesh components living in that BP.
I’m after each component’s transform properties: scale, rotation, position in order to drive and spawn other actors.
In the Get Actor Data node, I use Actor: self and filter my components by tag to only parse a selected type of component. I have 4 matching meshes.
Now in the Data Retrieval Settings, if I choose Parse Actor Components, the debug view seems accurate, my 4 meshes are highlighted, by I get a huge list of points (in the 30000 range) per data sets, where I’m after a single point.
Using Get Components Reference in Get Actor Data, I have been able to get the info I’m after but the process is convoluted to say the least. I need to Get Property From Object Path, which allows me to retrieve the relative location, rotation, and scale one after the other, which values I then copy onto $Position, $Rotation and $Scale and finally transform using the Actor data so the position is correct.
Is there a better, neater way of getting a single point per component, that holds the component’s transform data?
Hi Mickaëlle,
In a similar vein to your other question -
From the components references, assuming they are static mesh components, you’re able to get the static mesh with the Get Property From Object Path on the StaticMesh property.
After that, in a similar way, you can get the RelativeLocation, RelativeRotation and RelativeScale3D, coupled with the actor transform to rebuild the final transform.
I’ll take a note that we might want to have a bit easier extraction of that data in the future, but it’s possible!
Hope this helps,
Julien
Indeed, we’ve already found that it is possible, but I wanted to make sure I had not missed an easier way, I’m only starting to use PCG.
I’d imagine this might be some info many users will need, so it feels that it should be as easy to get it as using a single node and setting a few options, rather than having to reconstruct the whole transform manually.
Thanks anyway!
Oh, and a side note about the ‘huge’ amount of points, I think a clarification would benefit you here.
Basically, when you get actor data on a mesh with a static mesh or an ISM, we’ll process these as ‘primitive’ data - e.g. representing the collision.
A primitive data in PCG is a volumetric data type, so yes when (default) sampling it you might have a lot of points.
It does allow you though to test if other points are inside/touching or outside (depending on type of physics shape), which can be extremely helpful too.
Otherwise, as I said, a node getting the transform for a component would be convenient for sure, but that will go a bit into the future (~5.8 most likely).
Cheers,
Julien
Good to know, thanks for the ETA.