You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Alt + Shift + R now brings up the reference viewer for the currently selected asset in the level editor and asset editor
#TTP 331416 - UE4: Would like to be able to set a hotkey to open the Reference viewer similar to "find in content browser" #branch UE4 #proj Editor.UnrealEd #proj Editor.LevelEditor #add Added new global UICommand ViewReferences, bound to Alt + Shift + R. #add Implemented the new UICommand in the AssetEditorToolkit and the LevelEditorr. This means that most of the editor is covered by this hotkey. Hitting it in an asset editor brings it up for the current asset, hitting it in the level editor brings it up for the selected asset. #Further work: Further work is required to modify the content browsers uses of view references, for now it is deemed to be too much work for this task. #reviewedby Chris.Wood [CL 2088247 by Barnabas McManners in Main branch]
This commit is contained in:
committed by
UnrealBot
parent
fdb914fe8a
commit
abc3cde3c4
@@ -11,7 +11,8 @@ public class LevelEditor : ModuleRules
|
||||
"AssetTools",
|
||||
"Kismet",
|
||||
"MainFrame",
|
||||
"PlacementMode"
|
||||
"PlacementMode",
|
||||
"ReferenceViewer",
|
||||
}
|
||||
);
|
||||
|
||||
@@ -71,7 +72,8 @@ public class LevelEditor : ModuleRules
|
||||
"DeviceProfileEditor",
|
||||
"DeviceProfileServices",
|
||||
"PlacementMode",
|
||||
"UserFeedback"
|
||||
"UserFeedback",
|
||||
"ReferenceViewer",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -615,7 +615,13 @@ void FLevelEditorModule::BindGlobalLevelEditorCommands()
|
||||
FGlobalEditorCommonCommands::Get().FindInContentBrowser,
|
||||
FExecuteAction::CreateStatic( &FLevelEditorActionCallbacks::FindInContentBrowser_Clicked )
|
||||
);
|
||||
|
||||
|
||||
ActionList.MapAction(
|
||||
FGlobalEditorCommonCommands::Get().ViewReferences,
|
||||
FExecuteAction::CreateStatic( &FLevelEditorActionCallbacks::ViewReferences_Execute ),
|
||||
FCanExecuteAction::CreateStatic( &FLevelEditorActionCallbacks::CanViewReferences )
|
||||
);
|
||||
|
||||
ActionList.MapAction(
|
||||
Commands.SnapCameraToActor,
|
||||
FExecuteAction::CreateStatic( &FLevelEditorActionCallbacks::ExecuteExecCommand, FString( TEXT("CAMERA SNAP") ) )
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "EngineAnalytics.h"
|
||||
#include "AnalyticsEventAttribute.h"
|
||||
#include "IAnalyticsProvider.h"
|
||||
#include "ReferenceViewer.h"
|
||||
|
||||
#include "EditorActorFolders.h"
|
||||
#include "ActorPickerMode.h"
|
||||
@@ -1064,6 +1065,38 @@ void FLevelEditorActionCallbacks::FindInContentBrowser_Clicked()
|
||||
GEditor->SyncToContentBrowser();
|
||||
}
|
||||
|
||||
void FLevelEditorActionCallbacks::ViewReferences_Execute()
|
||||
{
|
||||
if( GEditor->GetSelectedActorCount() > 0 )
|
||||
{
|
||||
TArray< UObject* > ReferencedAssets;
|
||||
GEditor->GetReferencedAssetsForEditorSelection( ReferencedAssets );
|
||||
|
||||
if (ReferencedAssets.Num() > 0)
|
||||
{
|
||||
TArray< FName > ViewableObjects;
|
||||
for( auto ObjectIter = ReferencedAssets.CreateConstIterator(); ObjectIter; ++ObjectIter )
|
||||
{
|
||||
// Don't allow user to perform certain actions on objects that aren't actually assets (e.g. Level Script blueprint objects)
|
||||
const auto EditingObject = *ObjectIter;
|
||||
if( EditingObject != NULL && EditingObject->IsAsset() )
|
||||
{
|
||||
ViewableObjects.Add( EditingObject->GetOuter()->GetFName());
|
||||
}
|
||||
}
|
||||
|
||||
IReferenceViewerModule::Get().InvokeReferenceViewerTab(ViewableObjects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool FLevelEditorActionCallbacks::CanViewReferences()
|
||||
{
|
||||
TArray< UObject* > ReferencedAssets;
|
||||
GEditor->GetReferencedAssetsForEditorSelection(ReferencedAssets);
|
||||
return ReferencedAssets.Num() > 0;
|
||||
}
|
||||
|
||||
void FLevelEditorActionCallbacks::EditAsset_Clicked( const EToolkitMode::Type ToolkitMode, TWeakPtr< SLevelEditor > LevelEditor, bool bConfirmMultiple )
|
||||
{
|
||||
if( GEditor->GetSelectedActorCount() > 0 )
|
||||
|
||||
@@ -221,6 +221,8 @@ void FLevelEditorContextMenu::FillMenu( FMenuBuilder& MenuBuilder, TWeakPtr<SLev
|
||||
|
||||
}
|
||||
|
||||
MenuBuilder.AddMenuEntry( FGlobalEditorCommonCommands::Get().ViewReferences );
|
||||
|
||||
}
|
||||
MenuBuilder.EndSection();
|
||||
}
|
||||
|
||||
@@ -758,6 +758,12 @@ public:
|
||||
*/
|
||||
static void FindInContentBrowser_Clicked();
|
||||
|
||||
/** Called when the ViewReferences command is executed */
|
||||
static void ViewReferences_Execute();
|
||||
|
||||
/** If true ViewReferences_Execute can be called */
|
||||
static bool CanViewReferences();
|
||||
|
||||
/** Called to when "Edit Asset" is clicked */
|
||||
static void EditAsset_Clicked( const EToolkitMode::Type ToolkitMode, TWeakPtr< class SLevelEditor > LevelEditor, bool bAskMultiple );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user