Files
UnrealEngineUWP/Engine/Source/Runtime/ClothingSystemRuntimeCommon/Private/ClothLODData.cpp
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

75 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "ClothLODData.h"
#include "ClothPhysicalMeshData.h"
UClothLODDataCommon::UClothLODDataCommon(const FObjectInitializer& Init)
: Super(Init)
, PhysicalMeshData_DEPRECATED(nullptr)
{
}
UClothLODDataCommon::~UClothLODDataCommon()
{}
#if WITH_EDITORONLY_DATA
void UClothLODDataCommon::GetParameterMasksForTarget(
const uint8 InTarget,
TArray<FPointWeightMap*>& OutMasks)
{
for(FPointWeightMap& Mask : ParameterMasks)
{
if(Mask.CurrentTarget == InTarget)
{
OutMasks.Add(&Mask);
}
}
}
#endif // WITH_EDITORONLY_DATA
void UClothLODDataCommon::Serialize(FArchive& Ar)
{
Super::Serialize(Ar);
// Ryan - do we need to do this tagged property business still?
// Serialize normal tagged data
//UScriptStruct* Struct = UClothLODDataNv::StaticStruct();
//UClass* Class = UClothLODDataNv::StaticClass();
/*if (!Ar.IsCountingMemory())
{
//Struct->SerializeTaggedProperties(Ar, (uint8*)this, Struct, nullptr);
Class->SerializeTaggedProperties(Ar, (uint8*)this, Class, nullptr);
}*/
// Serialize the mesh to mesh data (not a USTRUCT)
Ar << TransitionUpSkinData
<< TransitionDownSkinData;
}
void UClothLODDataCommon::PostLoad()
{
Super::PostLoad();
if (PhysicalMeshData_DEPRECATED)
{
ClothPhysicalMeshData.MigrateFrom(PhysicalMeshData_DEPRECATED);
PhysicalMeshData_DEPRECATED = nullptr;
}
}
#if WITH_EDITOR
void UClothLODDataCommon::PushWeightsToMesh()
{
ClothPhysicalMeshData.ClearWeightMaps();
for (const FPointWeightMap& Weights : ParameterMasks)
{
if (Weights.bEnabled)
{
FPointWeightMap& TargetWeightMap = ClothPhysicalMeshData.FindOrAddWeightMap(Weights.CurrentTarget);
TargetWeightMap.Values = Weights.Values;
}
}
}
#endif