Files
UnrealEngineUWP/Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Private/PropertySets/WeightMapSetProperties.cpp
michael balzer a49c74b915 MeshModelingToolset: Move ModelingOperators and ModelingOperatorsEditorOnly modules out of experimental plugin
#jira UETOOL-3823
#rb lonnie.li
#preflight 617b1aea5794a500014f544a

#ROBOMERGE-AUTHOR: michael.balzer
#ROBOMERGE-SOURCE: CL 17972239 in //UE5/Release-5.0/... via CL 17972248
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v885-17909292)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17972256 by michael balzer in ue5-release-engine-test branch]
2021-10-28 19:47:45 -04:00

38 lines
933 B
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;
}