You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UETOOL-3823 #rb ryan.schmidt #preflight 6101fb4b2b002800014f7007 [CL 17003092 by michael balzer in ue5-main branch]
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Properties/MeshStatisticsProperties.h"
|
|
|
|
#include "DynamicMesh/DynamicMesh3.h"
|
|
#include "DynamicMesh/DynamicMeshAttributeSet.h"
|
|
#include "DynamicMesh/MeshNormals.h"
|
|
|
|
#include "Components/DynamicMeshComponent.h"
|
|
|
|
using namespace UE::Geometry;
|
|
|
|
#define LOCTEXT_NAMESPACE "UMeshStatisticsProperites"
|
|
|
|
|
|
void UMeshStatisticsProperties::Update(const FDynamicMesh3& MeshIn)
|
|
{
|
|
this->Mesh = FString::Printf(TEXT("T: %d V: %d E: %d"), MeshIn.TriangleCount(), MeshIn.VertexCount(), MeshIn.EdgeCount());
|
|
|
|
if (MeshIn.HasAttributes())
|
|
{
|
|
const FDynamicMeshAttributeSet* Attribs = MeshIn.Attributes();
|
|
|
|
FString UVString;
|
|
for ( int k = 0; k < Attribs->NumUVLayers(); k++)
|
|
{
|
|
const FDynamicMeshUVOverlay* UVLayer = Attribs->GetUVLayer(k);
|
|
UVString += FString::Printf(TEXT("UV%d: %d"), k, UVLayer->ElementCount());
|
|
}
|
|
this->UV = UVString;
|
|
|
|
this->Attributes = FString::Printf(TEXT("Normals: %d"), Attribs->GetNormalLayer(0)->ElementCount());
|
|
}
|
|
else
|
|
{
|
|
this->UV = FString(TEXT("none"));
|
|
this->Attributes = FString(TEXT("none"));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|