You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb tyson.brochu #rnx #preflight 62462ecbb33098a72dd3eb09 [CL 19611005 by nathan mitchell in ue5-main branch]
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "PropertySets/WeightMapSetProperties.h"
|
|
#include "WeightMapUtil.h"
|
|
|
|
|
|
void UWeightMapSetProperties::InitializeWeightMaps(const TArray<FName>& WeightMapNames)
|
|
{
|
|
// populate weight maps list
|
|
WeightMapsList.Add(TEXT("None"));
|
|
for (FName Name : WeightMapNames)
|
|
{
|
|
WeightMapsList.Add(Name.ToString());
|
|
}
|
|
if (WeightMapNames.Contains(WeightMap) == false) // discard restored value if it doesn't apply
|
|
{
|
|
WeightMap = FName(WeightMapsList[0]);
|
|
}
|
|
}
|
|
|
|
|
|
void UWeightMapSetProperties::InitializeFromMesh(const FMeshDescription* Mesh)
|
|
{
|
|
TArray<FName> TargetWeightMaps;
|
|
UE::WeightMaps::FindVertexWeightMaps(Mesh, TargetWeightMaps);
|
|
InitializeWeightMaps(TargetWeightMaps);
|
|
}
|
|
|
|
bool UWeightMapSetProperties::HasSelectedWeightMap() const
|
|
{
|
|
return WeightMap != FName(WeightMapsList[0]);
|
|
}
|
|
|
|
|
|
TArray<FString> UWeightMapSetProperties::GetWeightMapsFunc()
|
|
{
|
|
return WeightMapsList;
|
|
}
|
|
|
|
void UWeightMapSetProperties::SetSelectedFromWeightMapIndex(int32 Index)
|
|
{
|
|
if (Index < 0)
|
|
{
|
|
WeightMap = FName(WeightMapsList[0]);
|
|
}
|
|
else
|
|
{
|
|
WeightMap = FName(WeightMapsList[Index+1]);
|
|
}
|
|
} |