Get Socket World Transform on Instanced Static Mesh.

Hey it would be really great if we where able to directly get the World Transform.
For a socket that is located on a instanced static mesh.

Something like.

UInstancedStaticMeshComponent::GetInstanceSocketTransform(int32 index, FName SocketName, FTransform & OutTransform, bool bWorld = true);

Am sure it is a simple thing for you math wizards but am having a hard time.
is a use case am struggling with Forum Post.

Thank you for the consideration.


While this is not exactly your issue, it’s very similar and maybe you can change it into what you need. I had a similar issue with with bones instead of sockets, and finding no documentation or even forum posts about the subject, I came up with this to calculate the bone to world transforms.

That’s for bones instead of sockets, but the math should be the same AFAIK. Hope that helps you in some way. I only did the rotation bit since I didn’t care about translation, but it would be easy to do both.

Great, thank you i will give it a try. :slight_smile:

Actually this is fairly easy to do, I’ve done it recently.

Iterate over all the instances of your static mesh, and get their transforms. In addition to that, you also get the local socket location on the static mesh (This isn’t exposed to BP, I made a small helper function in a C++ function library). Then it’s just a matter of transforming the socket local transform by the instanced mesh transform.

I am doing this in code so i have sockets local/ relative location and transfroms for the instances.
But would you please give me a example of the math? :slight_smile: