Files
UnrealEngineUWP/Engine/Plugins/Experimental/GeometryCache/Source/GeometryCacheEd/Private/GeometryCacheEdModule.cpp
Lina Halper 77c8fc6d6c Copying //UE4/Dev-AnimPhys to Dev-Main (//UE4/Dev-Main)
#lockdown nick.penwarden
#fyi: James.Golding
#rb: none

[CL 4001436 by Lina Halper in Main branch]
2018-04-12 16:57:51 -04:00

40 lines
1.5 KiB
C++

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
#include "GeometryCacheEdModule.h"
#include "ThumbnailRendering/ThumbnailManager.h"
#include "ComponentAssetBroker.h"
#include "AssetToolsModule.h"
#include "AssetTypeActions_GeometryCache.h"
#include "GeometryCacheAssetBroker.h"
#include "GeometryCache.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());
}
}