Getting the bone position from USCS_Node for USkeletalMeshComponent

Hi, is there a way to get bone positions from USkeletalMeshComponent nodes that are obtained using USCS_Node from UBlueprints? I have a hack that uses bone matrices from USkeletalMeshComponent::CacheRefToLocalMatrices(...) but I wonder why does the USkeletalMeshComponent::GetBoneLocation(BoneName, EBoneSpaces::Type::ComponentSpace) crash.

Ok, found a solution that works for my use case.

  1. Create a new USkeletalMeshComponent, assign the USkeletalMesh from the USCS_Node’s USkeletalMeshComponent.
  2. Register it.
UWorld * World = GEditor ? GEditor->GetEditorWorldContext().World() : nullptr;
Component->RegisterComponentWithWorld(World);