Can someone help with Skeletal Mesh Merge?

Hi, does anyone have any experience with FSkeletalMeshMerge. I have a character creation system in works, that could benefit from this functionality. I would like to merge all the separate skeletal meshes into one. This is how far I got, I don’t know what to do with “EmptyArray” part. I don’t know nothing about **FSkelMeshMergeSectionMapping **or how to fill the array with correct data.




        TArray<USkeletalMeshComponent*> Components;
	this->GetComponents(Components);

	TArray<USkeletalMesh*> MeshList;


	for (int i = 0; i < Components.Num(); i++)
	{
		if (Components.Num() > 0)
		{
			USkeletalMeshComponent* NewSkeletalMeshComp = Components*;
			USkeletalMesh* NewSkeletalMesh = NewSkeletalMeshComp->SkeletalMesh;

			if (NewSkeletalMesh)
			{
				MeshList.Add(NewSkeletalMesh);
			}
		}
	}

	TArray<FSkelMeshMergeSectionMapping> EmptyArray;
	USkeletalMesh* NewMesh = nullptr;

	if (MeshList.Num() > 0)
	{
		FSkeletalMeshMerge(NewMesh, MeshList, EmptyArray, 0, EMeshBufferAccess::Default, nullptr);
	}


Take a look here:

1 Like

Many thanks. This is really helpful.