mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Files
4976868f6c11ba767b7022e65b1e691655f3fb8a
56 lines
2.4 KiB
C++
56 lines
2.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|||
|
|||
#include "MeshPaintModeModule.h"
|
|||
#include "Modules/ModuleManager.h"
|
|||
#include "Textures/SlateIcon.h"
|
|||
#include "EditorStyleSet.h"
|
|||
#include "EditorModeRegistry.h"
|
|||
#include "EditorModes.h"
|
|||
#include "MeshPaintEdMode.h"
|
|||
|
|||
#include "PropertyEditorModule.h"
|
|||
#include "PaintModeSettingsCustomization.h"
|
|||
|
|||
#include "PaintModeSettings.h"
|
|||
|
|||
#include "Modules/ModuleManager.h"
|
|||
|
Copy up from Dev-Editor @10681378
#rb none
[CL 10837446 by Chris Gagnon in Dev-Tools-Staging branch]
|
#include "Settings/LevelEditorMiscSettings.h"
|
||
|
|||
IMPLEMENT_MODULE(FMeshPaintModeModule, MeshPaintMode );
|
|||
|
|||
void FMeshPaintModeModule::StartupModule()
|
|||
{
|
|||
|
Copy up from Dev-Editor @10681378
#rb none
[CL 10837446 by Chris Gagnon in Dev-Tools-Staging branch]
|
if (GetDefault<ULevelEditorMiscSettings>()->bEnableLegacyMeshPaintMode)
|
||
{
|
|||
FEditorModeRegistry::Get().RegisterMode<FEdModeMeshPaint>(
|
|||
FBuiltinEditorModes::EM_MeshPaint,
|
|||
NSLOCTEXT("MeshPaint_Mode", "MeshPaint_ModeName", "Mesh Paint"),
|
|||
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.MeshPaintMode", "LevelEditor.MeshPaintMode.Small"),
|
|||
true, 200);
|
|||
|
|||
|
Copy up from Dev-Editor @10681378
#rb none
[CL 10837446 by Chris Gagnon in Dev-Tools-Staging branch]
|
/** Register detail/property customization */
|
||
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
|||
PropertyModule.RegisterCustomClassLayout("PaintModeSettings", FOnGetDetailCustomizationInstance::CreateStatic(&FPaintModeSettingsCustomization::MakeInstance));
|
|||
PropertyModule.RegisterCustomPropertyTypeLayout("VertexPaintSettings", FOnGetPropertyTypeCustomizationInstance::CreateStatic(&FVertexPaintSettingsCustomization::MakeInstance));
|
|||
PropertyModule.RegisterCustomPropertyTypeLayout("TexturePaintSettings", FOnGetPropertyTypeCustomizationInstance::CreateStatic(&FTexturePaintSettingsCustomization::MakeInstance));
|
|||
PropertyModule.RegisterCustomPropertyTypeLayout("TexturePaintSettings", FOnGetPropertyTypeCustomizationInstance::CreateStatic(&FTexturePaintSettingsCustomization::MakeInstance));
|
|||
|
|||
|
Copy up from Dev-Editor @10681378
#rb none
[CL 10837446 by Chris Gagnon in Dev-Tools-Staging branch]
|
FModuleManager::Get().LoadModule("MeshPaint");
|
||
}
|
|||
}
|
|||
|
|||
void FMeshPaintModeModule::ShutdownModule()
|
|||
{
|
|||
FEditorModeRegistry::Get().UnregisterMode(FBuiltinEditorModes::EM_MeshPaint);
|
|||
|
|||
/** De-register detail/property customization */
|
|||
FPropertyEditorModule* PropertyModule = FModuleManager::GetModulePtr<FPropertyEditorModule>("PropertyEditor");
|
|||
if (PropertyModule)
|
|||
{
|
|||
PropertyModule->UnregisterCustomClassLayout("PaintModeSettings");
|
|||
PropertyModule->UnregisterCustomPropertyTypeLayout("VertexPaintSettings");
|
|||
PropertyModule->UnregisterCustomPropertyTypeLayout("TexturePaintSettings");
|
|||
PropertyModule->UnregisterCustomPropertyTypeLayout("TexturePaintSettings");
|
|||
}
|
|||
}
|