Download

is possible to add socket to skeletal mesh using python ?

in unreal.StaticMesh has method to add socket to static mesh

https://user-images.githubusercontent.com/38805204/86377523-a49a5600-bcb2-11ea-8277-810f3a39a1a7.png

and I don’t found any method to add socket to skeletal mesh.

https://user-images.githubusercontent.com/38805204/86377697-dc090280-bcb2-11ea-8230-f02b17ae54d9.png

is somebody know how to add socket to skeletal mesh using python ??

The cpp USkeletalMesh doesn’t have any method for adding sockets either, it seem to be done in FEditableSkeleton

https://docs.unrealengine.com/en-US/…esh/index.html


USkeletalMeshSocket* FEditableSkeleton::AddSocket(const FName& InBoneName)
{
  USkeletalMeshSocket* NewSocket = HandleAddSocket(InBoneName);
  OnTreeRefresh.Broadcast();
  return NewSocket;
}

USkeletalMeshSocket* FEditableSkeleton::HandleAddSocket(const FName& InBoneName)
{
  const FScopedTransaction Transaction(LOCTEXT("AddSocket", "Add Socket to Skeleton"));
  Skeleton->Modify();

  USkeletalMeshSocket* NewSocket = NewObject<USkeletalMeshSocket>(Skeleton);
  check(NewSocket);

  NewSocket->BoneName = InBoneName;
  FString SocketName = NewSocket->BoneName.ToString() + LOCTEXT("SocketPostfix", "Socket").ToString();
  NewSocket->SocketName = GenerateUniqueSocketName(*SocketName, nullptr);

  Skeleton->Sockets.Add(NewSocket);
  return NewSocket;
}

I assume that add socket method wasn’t implement yet in python for skeletal mesh, i hope next update will be implemented

Hi, Anas Rin
Yeah socket implement for skeletal mesh was removed when the addon switch to Unreal Python API. I need wait the integration in Unreal Python API