I have been trying to figure this out for months. I’ve chased so many dead ends, found unanswered posts, and the occasional “just paste this” answer that doesn’t seem to work.
In case anyone finds this I am going to start posting any progress I make until I get it solved or someone takes pity on me and posts the correct answer.
Lets start with baby steps:
The code below just creates a node with inputs for a skeletal mesh and an integer and a vector output.
It does not return actual vertex positions yet
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Components/SkeletalMeshComponent.h"
#include "MyBlueprintFunctionLibrary.generated.h"
/**
*
*/
UCLASS()
class NEWCPPTESTING_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "SkeletalMeshStuff")
static FVector GetVertexPosition(USkeletalMeshComponent* MyComponent, int32 MyVertexIndex);
};
.h file
// Fill out your copyright notice in the Description page of Project Settings.
#include "Components/SkeletalMeshComponent.h"
#include "MyBlueprintFunctionLibrary.h"
FVector UMyBlueprintFunctionLibrary::GetVertexPosition(USkeletalMeshComponent* Comp, int32 VertInd)
{
FVector MyVector = FVector (25.f, 27.f, 29.f);
return MyVector;
}
.cpp file