Files
UnrealEngineUWP/Engine/Plugins/Experimental/MeshModelingToolset/Source/GeometryProcessingAdapters/Private/GeometryProcessingAdaptersModule.cpp
Ryan Schmidt 946b918d4a Add GeometryProcessingInterfaces module in /Developer. This module exists to define abstract interfaces to high-level geometry operations, which the core Engine/Editor can see, but which can be implemented by plugins. Currently only ApproximateActors interface is defined, which will allow the ProxyLOD and HLOD systems to use implementations that depend on the MeshModelingToolset and GeometryProcessing plugins.
Add GeometryProcessingAdapters module to MeshModelingToolset, this is an Editor-only module that implements GeometryProcessingInterfaces APIs

Add ApproximateActors implementation in GeometryProcessingAdapters that uses GeometryProcessing (FastWindingNumber / MeshMorphology / Simplify / UVGen / Tangents) and a new material-baking process based on render captures to generate a new StaticMesh Asset / Material / Textures that approximate the input Actor set.

#rb none
#rnx
#jira none
#preflight 608b25ced4026b0001cbe9c4

[CL 16162961 by Ryan Schmidt in ue5-main branch]
2021-04-29 18:12:32 -04:00

38 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "GeometryProcessingAdaptersModule.h"
#include "Features/IModularFeatures.h"
#define LOCTEXT_NAMESPACE "FGeometryProcessingAdaptersModule"
using namespace UE::Geometry;
void FGeometryProcessingAdaptersModule::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
ApproximateActors = MakeShared<FApproximateActorsImpl>();
if (ApproximateActors.IsValid())
{
IModularFeatures::Get().RegisterModularFeature(IGeometryProcessing_ApproximateActors::GetModularFeatureName(), ApproximateActors.Get());
}
}
void FGeometryProcessingAdaptersModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
if ( ApproximateActors.IsValid() )
{
IModularFeatures::Get().UnregisterModularFeature(IGeometryProcessing_ApproximateActors::GetModularFeatureName(), ApproximateActors.Get());
ApproximateActors = nullptr;
}
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FGeometryProcessingAdaptersModule, GeometryProcessingAdapters)