keep skeletal mesh head on component ue4 code example
Example: ue4 modular character
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "UObject/NoExportTypes.h"
#include "MeshMergeFunctionLibrary.generated.h"
USTRUCT(BlueprintType)
struct PROJECTNAME_API FSkelMeshMergeSectionMapping_BP
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Mesh Merge Params")
TArray<type> SectionIDs;
};
USTRUCT(BlueprintType)
struct PROJECTNAME_API FSkelMeshMergeUVTransform
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Mesh Merge Params")
TArray UVTransforms;
};
USTRUCT(BlueprintType)
struct PROJECTNAME_API FSkelMeshMergeUVTransformMapping
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Mesh Merge Params")
TArray UVTransformsPerMesh;
};
USTRUCT(BlueprintType)
struct PROJECTNAME_API FSkeletalMeshMergeParams
{
GENERATED_BODY()
FSkeletalMeshMergeParams()
{
MeshSectionMappings = TArray();
UVTransformsPerMesh = TArray();
StripTopLODS = 0;
bNeedsCpuAccess = false;
bSkeletonBefore = false;
Skeleton = nullptr;
}
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray MeshSectionMappings;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray UVTransformsPerMesh;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray MeshesToMerge;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 StripTopLODS;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
uint32 bNeedsCpuAccess : 1;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
uint32 bSkeletonBefore : 1;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
class USkeleton* Skeleton;
};
UCLASS()
class PROJECTNAME_API UMeshMergeFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "Mesh Merge", meta = (UnsafeDuringActorConstruction = "true"))
static class USkeletalMesh* MergeMeshes(const FSkeletalMeshMergeParams& Params);
};
~~~