You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Removing MaterialAttributeDefinitionMap and MaterialRenderProxy from MaterialShared.h - Removing MaterialShared from Material.h #preflight 639cbb35776b61ba3b82f03e [CL 23541603 by christopher waters in ue5-main branch]
37 lines
1.4 KiB
C++
37 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ModelingComponentsModule.h"
|
|
#include "Components/BaseDynamicMeshComponent.h"
|
|
#include "Materials/Material.h"
|
|
#include "Misc/CoreDelegates.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "FModelingComponentsModule"
|
|
|
|
void FModelingComponentsModule::StartupModule()
|
|
{
|
|
FCoreDelegates::OnPostEngineInit.AddRaw(this, &FModelingComponentsModule::OnPostEngineInit);
|
|
|
|
// Ensure that the GeometryFramework module is loaded so that UBaseDynamicMeshComponent materials are configured
|
|
FModuleManager::Get().LoadModule(TEXT("GeometryFramework"));
|
|
}
|
|
|
|
void FModelingComponentsModule::OnPostEngineInit()
|
|
{
|
|
// Replace the standard UBaseDynamicMeshComponent vertex color material with something higher quality.
|
|
// This is done in ModelingComponents module (ie part of MeshModelingToolset plugin) to avoid having to
|
|
// make this Material a special "engine material", which has various undesirable implication
|
|
UMaterial* VertexColorMaterial = LoadObject<UMaterial>(nullptr, TEXT("/MeshModelingToolset/Materials/M_DynamicMeshComponentVtxColor"));
|
|
if (ensure(VertexColorMaterial))
|
|
{
|
|
UBaseDynamicMeshComponent::SetDefaultVertexColorMaterial(VertexColorMaterial);
|
|
}
|
|
}
|
|
|
|
void FModelingComponentsModule::ShutdownModule()
|
|
{
|
|
FCoreDelegates::OnPostEngineInit.RemoveAll(this);
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|
|
|
|
IMPLEMENT_MODULE(FModelingComponentsModule, ModelingComponents) |