You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Make sure we verify we have valid data before compressing it.
#jira none #rb lina.halper #rnx #ROBOMERGE-OWNER: ryan.gerleve #ROBOMERGE-AUTHOR: alexis.matte #ROBOMERGE-SOURCE: CL 11281407 in //UE4/Main/... #ROBOMERGE-BOT: NETWORKING (Main -> Dev-Networking) (v654-11333218) [CL 11501358 by alexis matte in Dev-Networking branch]
This commit is contained in:
@@ -657,18 +657,25 @@ FArchive& operator<<(FArchive& Ar, FSkeletalMeshImportData& RawMesh)
|
||||
|
||||
if (Ar.IsLoading() && Version < RAW_SKELETAL_MESH_BULKDATA_VER_CompressMorphTargetData)
|
||||
{
|
||||
//Compress the morph target data
|
||||
for (int32 MorphTargetIndex = 0; MorphTargetIndex < RawMesh.MorphTargets.Num(); ++MorphTargetIndex)
|
||||
if (RawMesh.MorphTargetModifiedPoints.Num() != 0)
|
||||
{
|
||||
const TSet<uint32>& ModifiedPoints = RawMesh.MorphTargetModifiedPoints[MorphTargetIndex];
|
||||
FSkeletalMeshImportData& ToCompressShapeImportData = RawMesh.MorphTargets[MorphTargetIndex];
|
||||
TArray<FVector> CompressPoints;
|
||||
CompressPoints.Reserve(ToCompressShapeImportData.Points.Num());
|
||||
for (uint32 PointIndex : ModifiedPoints)
|
||||
//Compress the morph target data
|
||||
for (int32 MorphTargetIndex = 0; MorphTargetIndex < RawMesh.MorphTargets.Num(); ++MorphTargetIndex)
|
||||
{
|
||||
CompressPoints.Add(ToCompressShapeImportData.Points[PointIndex]);
|
||||
if (!RawMesh.MorphTargetModifiedPoints.IsValidIndex(MorphTargetIndex))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const TSet<uint32>& ModifiedPoints = RawMesh.MorphTargetModifiedPoints[MorphTargetIndex];
|
||||
FSkeletalMeshImportData& ToCompressShapeImportData = RawMesh.MorphTargets[MorphTargetIndex];
|
||||
TArray<FVector> CompressPoints;
|
||||
CompressPoints.Reserve(ToCompressShapeImportData.Points.Num());
|
||||
for (uint32 PointIndex : ModifiedPoints)
|
||||
{
|
||||
CompressPoints.Add(ToCompressShapeImportData.Points[PointIndex]);
|
||||
}
|
||||
ToCompressShapeImportData.Points = CompressPoints;
|
||||
}
|
||||
ToCompressShapeImportData.Points = CompressPoints;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user