/Engine/Source/Runtime/Engine/Classes/Components/SkeletalMeshComponent.h
Get the bones that are used by sockets OutRequiredBones : the bones used by sockets that are set as always animate NeededBonesForFillComponentSpaceTransforms : the rest of bones used by sockets (that are not set to always animate)
static void GetSocketRequiredBones ( const [USkeletalMesh](API\Runtime\Engine\Engine\USkeletalMesh) * SkeletalMesh, [TArray](API\Runtime\Core\Containers\TArray)< FBoneIndexType > & OutRequiredBones, [TArray](API\Runtime\Core\Containers\TArray)< FBoneIndexType > & NeededBonesForFillComponentSpaceTransforms )