Dear Friends At Epic,
I’ve made substantial progress with my goals of making an UnrealEdEngine plugin to add some additional tools to the editor.
Below is my code and the result:
// Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
//Unreal Editor Fun With Rama
#include "VictoryGame.h"
UVictoryEdEngine::UVictoryEdEngine(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
void UVictoryEdEngine::NoteSelectionChange()
{
if(!GetSelectedActors()) return;
AActor* SelectedActor = Cast(GetSelectedActors()->GetTop(AActor::StaticClass()));
if(!SelectedActor) return;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UE_LOG(Victory, Warning, TEXT("New Selected Actor %s"), *SelectedActor->GetName() );
UE_LOG(Victory, Warning, TEXT("New Selected Actor Location %s"), *SelectedActor->GetActorLocation().ToString() );
/*
//whats going on in editor land?
for ( TObjectIterator It; It; ++It )
{
UE_LOG(Victory, Warning, TEXT("EditorLand: %s"), *It->GetName() );
}
*/
//Determine Active Viewport to GetWorld from
for(int32 Itr = 0; Itr < LevelViewportClients.Num(); Itr++ )
{
if(!LevelViewportClients[Itr]->IsLevelEditorClient()) continue;
if(!LevelViewportClients[Itr]->IsVisible()) continue;
UE_LOG(Victory, Warning, TEXT("This one is visible %d"), Itr );
DrawDebugString(
LevelViewportClients[Itr]->GetWorld(),
FVector(0,0,64),
SelectedActor->GetName(),
SelectedActor,
FColor(255,0,255),
2
);
}
//or try GWorld
DrawDebugPoint(
GWorld,
SelectedActor->GetActorLocation(),
7,
FColor(255,0,255),
false,
2
);
}
#Displaying
I dont know how to subclass LevelEditorViewport because there’s no config option to do so, would I just use a class redirect?
I can successfully identify the active viewport as you see in my code and log,
but when I get the world of the Viewport and try to send debug strings and draw points to this World nothing shows up int he editor display.
I am trying to display stuff within the viewport in the Pre-PIE world
What is the best way to do this?
Input
Within EditorViewport and LevelEditorViewport I see plenty of functions related to input
But again, since I cannot figure out how to subclass LevelEditorViewport so that all the editor viewports use it, I cannot write custom code related to user input
What is the best way to get keyboard and mouse input from within the Editor Pre-PIE world?
Thanks!
Rama


