2018-12-14 13:41:00 -05:00
|
|
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
2018-09-11 14:44:10 -04:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
#include "VirtualTexturingEditorModule.h"
|
2018-09-11 14:44:10 -04:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
#include "IPlacementModeModule.h"
|
|
|
|
|
#include "PropertyEditorModule.h"
|
|
|
|
|
#include "RuntimeVirtualTextureAssetTypeActions.h"
|
|
|
|
|
#include "RuntimeVirtualTextureDetailsCustomization.h"
|
2019-08-21 08:42:46 -04:00
|
|
|
#include "RuntimeVirtualTextureThumbnailRenderer.h"
|
|
|
|
|
#include "ThumbnailRendering/ThumbnailManager.h"
|
|
|
|
|
#include "VT/RuntimeVirtualTexture.h"
|
2019-06-11 18:27:07 -04:00
|
|
|
#include "VT/RuntimeVirtualTextureVolume.h"
|
2018-09-11 14:44:10 -04:00
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
#define LOCTEXT_NAMESPACE "VirtualTexturingEditorModule"
|
2018-09-11 14:44:10 -04:00
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FVirtualTexturingEditorModule, VirtualTexturingEditor);
|
|
|
|
|
|
2019-06-11 18:27:07 -04:00
|
|
|
void FVirtualTexturingEditorModule::StartupModule()
|
|
|
|
|
{
|
|
|
|
|
IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
|
|
|
|
|
AssetTools.RegisterAssetTypeActions(MakeShareable(new FAssetTypeActions_RuntimeVirtualTexture));
|
|
|
|
|
|
|
|
|
|
FPropertyEditorModule& PropertyModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
|
|
|
|
PropertyModule.RegisterCustomClassLayout("RuntimeVirtualTexture", FOnGetDetailCustomizationInstance::CreateStatic(&FRuntimeVirtualTextureDetailsCustomization::MakeInstance));
|
|
|
|
|
PropertyModule.RegisterCustomClassLayout("RuntimeVirtualTextureComponent", FOnGetDetailCustomizationInstance::CreateStatic(&FRuntimeVirtualTextureComponentDetailsCustomization::MakeInstance));
|
|
|
|
|
|
|
|
|
|
IPlacementModeModule& PlacementModeModule = IPlacementModeModule::Get();
|
|
|
|
|
PlacementModeModule.OnPlacementModeCategoryRefreshed().AddRaw(this, &FVirtualTexturingEditorModule::OnPlacementModeRefresh);
|
2019-08-21 08:42:46 -04:00
|
|
|
|
|
|
|
|
UThumbnailManager::Get().RegisterCustomRenderer(URuntimeVirtualTexture::StaticClass(), URuntimeVirtualTextureThumbnailRenderer::StaticClass());
|
2019-06-11 18:27:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FVirtualTexturingEditorModule::ShutdownModule()
|
|
|
|
|
{
|
|
|
|
|
if (IPlacementModeModule::IsAvailable())
|
|
|
|
|
{
|
|
|
|
|
IPlacementModeModule::Get().OnPlacementModeCategoryRefreshed().RemoveAll(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FVirtualTexturingEditorModule::SupportsDynamicReloading()
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FVirtualTexturingEditorModule::OnPlacementModeRefresh(FName CategoryName)
|
|
|
|
|
{
|
|
|
|
|
static FName VolumeName = FName(TEXT("Volumes"));
|
|
|
|
|
if (CategoryName == VolumeName)
|
|
|
|
|
{
|
|
|
|
|
IPlacementModeModule& PlacementModeModule = IPlacementModeModule::Get();
|
|
|
|
|
PlacementModeModule.RegisterPlaceableItem(CategoryName, MakeShareable(new FPlaceableItem(nullptr, FAssetData(ARuntimeVirtualTextureVolume::StaticClass()))));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|