Files
UnrealEngineUWP/Engine/Source/Editor/GeometryCacheEd/Private/GeometryCacheEdModule.cpp
Jurre deBaare 14669ed8dc Geom Cache Thumbnail safety
[CL 2685872 by Jurre deBaare in Main branch]
2015-09-10 04:16:53 -04:00

38 lines
1.4 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "GeometryCacheEdModulePublicPCH.h"
#include "GeometryCacheEdModule.h"
#include "IAssetTools.h"
#include "ComponentAssetBroker.h"
#include "AssetTypeActions_GeometryCache.h"
#include "GeometryCacheAssetBroker.h"
#include "GeometryCacheComponent.h"
#include "GeometryCacheThumbnailRenderer.h"
IMPLEMENT_MODULE(FGeometryCacheEdModule, GeometryCacheEd)
void FGeometryCacheEdModule::StartupModule()
{
FAssetToolsModule& AssetToolsModule = FAssetToolsModule::GetModule();
IAssetTools& AssetTools = AssetToolsModule.Get();
AssetAction = new FAssetTypeActions_GeometryCache();
AssetTools.RegisterAssetTypeActions(MakeShareable(AssetAction));
AssetBroker = new FGeometryCacheAssetBroker();
FComponentAssetBrokerage::RegisterBroker(MakeShareable(AssetBroker), UGeometryCacheComponent::StaticClass(), true, true);
UThumbnailManager::Get().RegisterCustomRenderer(UGeometryCache::StaticClass(), UGeometryCacheThumbnailRenderer::StaticClass());
}
void FGeometryCacheEdModule::ShutdownModule()
{
if (UObjectInitialized())
{
FAssetToolsModule& AssetToolsModule = FAssetToolsModule::GetModule();
IAssetTools& AssetTools = AssetToolsModule.Get();
AssetTools.UnregisterAssetTypeActions(AssetAction->AsShared());
FComponentAssetBrokerage::UnregisterBroker(MakeShareable(AssetBroker));
UThumbnailManager::Get().UnregisterCustomRenderer(UGeometryCache::StaticClass());
}
}