C++ GetAllSocketNames returns bones along with sockets

I’m currently working with a standard mannequin supplied along with UE4. I added a socket to one of its bones. When I try to get an array of all sockets in this skeletal mesh, it also returns a whole bunch of other bone names along with my manually created socket name:

TArray<FName> SocketNames = SkeletalMesh->GetAllSocketNames();

However it supposed to only return sockets, according to its name, and that’s what I actually need.
Any help is appreciated.

Hi again !

Indeed, this get all socket + bones ! ( Naming once again … )

to only get sockets you can use this code :

	USkeletalMeshComponent* mySkeletalMeshComponent; 

	const TArray<USkeletalMeshSocket*> AllSockets = mySkeletalMeshComponent->SkeletalMesh->GetActiveSocketList();

	for (int32 SocketIdx = 0; SocketIdx < AllSockets.Num(); ++SocketIdx)
	{
		FName name = AllSockets[SocketIdx]->SocketName;
	}

Have a good day !

Good day, sir :slight_smile:
I actually came across another answer before posting my own, where the dude also suggested to use “SkeletalMesh->GetActiveSocketList();”, but from his answer it wasn’t obvious that SkeletalMesh != SkeletalMeshComponent, and is actually inside of SkeletalMeshComponent. Plus his reply was very outdated, so I couldn’t fine that GetActiveSocketList() function in SkeletalMeshComponent API, thus I thought it is deprecated and has been removed. (Making excuses :))
Anyway, you saved me lots of time sir, I salute you!
Have a great day!
ps. Epic really should fix their docs and naming :s

Hello.
I tired to use this function in my custom player controller in BeginPlay. and i get a list of 0 sockets / bones. Does it have to be used in a different function? or what’s going on here…
PS: i’m trying to get all the bones on game load so i can manipulate them later.

Nevermind. Figured it out. I needed to use GetBoneNames(BoneNames) on my USkeletalMeshComponent now i have all bone names.