You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Note that this is a temporary band-aid until the modeling tools start using the new UContextObjectStore mechanism as means to pass components from editor to the tools context. #jira UE-93689 #rb ryan.schmidt #rnx #preflight 60935bad835be30001b988f5 [CL 16218074 by halfdan ingvarsson in ue5-main branch]
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "PersonaEditorModeManager.h"
|
|
#include "IPersonaEditMode.h"
|
|
#include "IPersonaPreviewScene.h"
|
|
#include "Selection.h"
|
|
#include "Animation/DebugSkelMeshComponent.h"
|
|
|
|
|
|
bool FPersonaEditorModeManager::GetCameraTarget(FSphere& OutTarget) const
|
|
{
|
|
for (UEdMode* Mode : ActiveScriptableModes)
|
|
{
|
|
FEdMode* LegacyMode = Mode->AsLegacyMode();
|
|
if (IPersonaEditMode* EditMode = static_cast<IPersonaEditMode*>(LegacyMode))
|
|
{
|
|
FSphere Target;
|
|
if (EditMode->GetCameraTarget(Target))
|
|
{
|
|
OutTarget = Target;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
void FPersonaEditorModeManager::GetOnScreenDebugInfo(TArray<FText>& OutDebugText) const
|
|
{
|
|
for (UEdMode* Mode : ActiveScriptableModes)
|
|
{
|
|
FEdMode* LegacyMode = Mode->AsLegacyMode();
|
|
if (IPersonaEditMode* EditMode = static_cast<IPersonaEditMode*>(LegacyMode))
|
|
{
|
|
EditMode->GetOnScreenDebugInfo(OutDebugText);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void FPersonaEditorModeManager::SetPreviewScene(FPreviewScene* NewPreviewScene)
|
|
{
|
|
const IPersonaPreviewScene *PersonaPreviewScene = static_cast<const IPersonaPreviewScene *>(NewPreviewScene);
|
|
|
|
if (PersonaPreviewScene && PersonaPreviewScene->GetPreviewMeshComponent())
|
|
{
|
|
ComponentSet->BeginBatchSelectOperation();
|
|
ComponentSet->DeselectAll();
|
|
ComponentSet->Select(PersonaPreviewScene->GetPreviewMeshComponent(), true);
|
|
ComponentSet->EndBatchSelectOperation();
|
|
}
|
|
|
|
FAssetEditorModeManager::SetPreviewScene(NewPreviewScene);
|
|
}
|