Files
UnrealEngineUWP/Engine/Source/Developer/GeometryProcessingInterfaces/Private/GeometryProcessingInterfacesModule.cpp
sebastien lussier 320ff53c05 Added MeshAutoUV to GeometryProcessingInterface
* Required for future changes to improve the mesh merging capability to cope with missing/invalid UVs when trying to perform material baking.
#rb ryan.schmidt

[CL 26014245 by sebastien lussier in ue5-main branch]
2023-06-15 10:37:22 -04:00

67 lines
1.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "GeometryProcessingInterfacesModule.h"
#include "CoreGlobals.h"
#include "Features/IModularFeatures.h"
#include "Modules/ModuleManager.h"
#include "GeometryProcessingInterfaces/ApproximateActors.h"
#include "GeometryProcessingInterfaces/CombineMeshInstances.h"
#include "GeometryProcessingInterfaces/MeshAutoUV.h"
IMPLEMENT_MODULE(FGeometryProcessingInterfacesModule, GeometryProcessingInterfaces);
void FGeometryProcessingInterfacesModule::StartupModule()
{
}
void FGeometryProcessingInterfacesModule::ShutdownModule()
{
ApproximateActors = nullptr;
CombineMeshInstances = nullptr;
MeshAutoUV = nullptr;
}
namespace
{
template <typename TModularFeatureInterface>
TModularFeatureInterface* GetModularFeatureImplementation()
{
TArray<TModularFeatureInterface*> AvailableImplementations =
IModularFeatures::Get().GetModularFeatureImplementations<TModularFeatureInterface>(TModularFeatureInterface::GetModularFeatureName());
return (AvailableImplementations.Num() > 0) ? AvailableImplementations[0] : nullptr;
}
}
IGeometryProcessing_ApproximateActors* FGeometryProcessingInterfacesModule::GetApproximateActorsImplementation()
{
if (ApproximateActors == nullptr)
{
ApproximateActors = GetModularFeatureImplementation<IGeometryProcessing_ApproximateActors>();
}
return ApproximateActors;
}
IGeometryProcessing_CombineMeshInstances* FGeometryProcessingInterfacesModule::GetCombineMeshInstancesImplementation()
{
if (CombineMeshInstances == nullptr)
{
CombineMeshInstances = GetModularFeatureImplementation<IGeometryProcessing_CombineMeshInstances>();
}
return CombineMeshInstances;
}
IGeometryProcessing_MeshAutoUV* FGeometryProcessingInterfacesModule::GetMeshAutoUVImplementation()
{
if (MeshAutoUV == nullptr)
{
MeshAutoUV = GetModularFeatureImplementation<IGeometryProcessing_MeshAutoUV>();
}
return MeshAutoUV;
}