Files
UnrealEngineUWP/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditorModeUILayer.cpp
tyson brochu ba3c5ed88e Adding AutoLOD tools to the static mesh editor.
Static Mesh Editor changes:
- Share ownership of StaticMeshViewportClient's ModeTools via the EditorModeManager member
- Set up the EditorModeManager's preview scene and selected components when it's copied
- Add a set of FStaticMeshEditorToolbarExtender delegates to the module (similar to FSkeletalMeshEditorToolbarExtender)
- Allow adding an overlay widget to the viewport
- Add a ModeUILayer member to handle mode toolkit hosting

StaticMeshEditorModeling (new module):
- Create a mode and toolkit with AutoLOD and LODManager tools
- Add a button to the StaticMeshEditor's toolbar to toggle UMeshLODPluginEditMode

#rb brooke.hubert semion.piskarev
#jira UETOOL-3663
#preflight 61435ce14778fa00016a0b28
#preflight 614370e8b5a4fa00016459a0

[CL 17541979 by tyson brochu in ue5-main branch]
2021-09-16 13:56:39 -04:00

39 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "StaticMeshEditorModeUILayer.h"
#include "WorkspaceMenuStructure.h"
#include "WorkspaceMenuStructureModule.h"
#include "Toolkits/IToolkit.h"
FStaticMeshEditorModeUILayer::FStaticMeshEditorModeUILayer(const IToolkitHost* InToolkitHost) :
FAssetEditorModeUILayer(InToolkitHost)
{}
void FStaticMeshEditorModeUILayer::OnToolkitHostingStarted(const TSharedRef<IToolkit>& Toolkit)
{
if (!Toolkit->IsAssetEditor())
{
FAssetEditorModeUILayer::OnToolkitHostingStarted(Toolkit);
HostedToolkit = Toolkit;
Toolkit->SetModeUILayer(SharedThis(this));
Toolkit->RegisterTabSpawners(ToolkitHost->GetTabManager().ToSharedRef());
RegisterModeTabSpawners();
OnToolkitHostReadyForUI.ExecuteIfBound();
}
}
void FStaticMeshEditorModeUILayer::OnToolkitHostingFinished(const TSharedRef<IToolkit>& Toolkit)
{
if (HostedToolkit.IsValid() && HostedToolkit.Pin() == Toolkit)
{
FAssetEditorModeUILayer::OnToolkitHostingFinished(Toolkit);
}
}
TSharedPtr<FWorkspaceItem> FStaticMeshEditorModeUILayer::GetModeMenuCategory() const
{
const IWorkspaceMenuStructure& MenuStructure = WorkspaceMenu::GetMenuStructure();
return MenuStructure.GetLevelEditorModesCategory();
}