Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor/Private/LevelEditorActions.cpp
Matt Kuhlenschmidt e2ba04378b Copying //UE4/Dev-Editor to //UE4/Dev-Main (Source: //UE4/Dev-Editor @ 3133954)
#lockdown Nick.Penwarden
#rb none

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3077573 on 2016/08/04 by Nick.Darnell

	Removing some unused code, adding additional needed modules to editor tests.

	#rb none

Change 3077580 on 2016/08/04 by Nick.Darnell

	Removing the test plugins, going to be recreating them in EngineTest.

Change 3082659 on 2016/08/09 by Nick.Darnell

	Automation - Presets are now stored in json files stored in Config so they can be shared, and human readable.  Working on screenshot automation, getting it where it needs to be to permit us to have repeatable tests for comarison.  Removing the option to not take full size screenshots, that defeats the purpose of being able to compare them.

	#rb none

Change 3082766 on 2016/08/09 by Jamie.Dale

	Fixed crashes when dealing with code-points outside the BMP on platforms with UTF-32 FStrings

	ICU always deals with its offsets as UTF-16 (as it always uses UTF-16 internally with icu::UnicodeString), so there were a couple of places in code (break iteration, and bidi detection) where we needed to adjust those UTF-16 offsets to UTF-32 offsets in the case where FString is UTF-32.

	#jira UE-33971
	#rb James.Hopkin

Change 3083067 on 2016/08/09 by Nick.Darnell

	Automation - Working on screenshot support, system now allows a lot more customization in terms of how large the shot is.

	#rb none

Change 3084475 on 2016/08/10 by Richard.TalbotWatkin

	Fixed issue with ModelComponent replication in client/server PIE if BSP is rebuilt. ModelComponent now implements IsNameStableForNetworking and always returns true, as a level's model components will never be rebuilt during a game session. Brush poly normals are now only fixed up in Editor builds.
	#jira UE-34391 - No run animation on client that is not focused when running 2 player and dedicated server
	#codereview Matt.Kuhlenschmidt
	#rb none

Change 3084661 on 2016/08/10 by Matt.Kuhlenschmidt

	Added grayscale texture importing support

	#rb none

Change 3084774 on 2016/08/10 by Cody.Albert

	Adding controller support for ComboBox widget

	#jira UE-33826
	#rb nick.darnell

Change 3085716 on 2016/08/11 by Nick.Darnell

	UMG - Taking the Widget Component and Widget Interaction Components out of experimental.  Removed old importing support for upgrading ancient versions of widget components.  Removing parbola distortion, as users can now do whatever they want in their custom MID they can override the widget with.

	#rb none

Change 3085733 on 2016/08/11 by Nick.Darnell

	UMG - Documenting the meta parameters allowed on widgets, like we do for regular UObjects.  For binding widgets from blueprints you can now do BindWidget (unchanged), and to simplify binding widgets optionally, you can now just do (BindWidgetOptional), rather than the combination of BindWidget + OptionalWidget=true.  Made generating the Design time wrapper call a little more efficent, by optimizing it away by force inlining a noop.  Also added some additional checking when we forcefully set focus in UMG, to help people catch cases where they set focus, but didn't make the widget focusable.

	#rb none

Change 3085734 on 2016/08/11 by Nick.Darnell

	Texture - Making GetDefaultMipMapBias a bit more efficent in the common case.

	#rb none

Change 3085736 on 2016/08/11 by Nick.Darnell

	Static Lighting - Warning the user when they build lighting, but have bForceNoPrecomputedLighting set to true on the world settings.

	#rb none

Change 3085737 on 2016/08/11 by Nick.Darnell

	Editor - code organization.

	#rb none

Change 3085875 on 2016/08/11 by Nick.Darnell

	UMG - You can now use 'G' to toggle game mode on the designer so that you can disable and enable the dashed lines around containers.  The option in the settings is now used as the default when you startup a designer.

	#rb none

Change 3086209 on 2016/08/11 by Ben.Salem

	Make our automated test pass reporting more robust and pipe out to JSON in \saved\automation\logs\AutomationReport-{CL}-{Timestamp}.json format.
	#rb adric.worley, william.ewen

Change 3086515 on 2016/08/11 by Nick.Darnell

	Editor - Fixing a crash in the curve table customization.  If the row doesn't exist, it would crash, we now protect against that case.

	#rb Matt.Kuhlenschmidt

Change 3087216 on 2016/08/12 by Jamie.Dale

	Fixed an issue where re-scanning a package file may leave old assets in the asset registry

	We didn't used to clear out anything associated with the old package before scanning the file, which could result in old assets being left if they'd since been removed from the package.

	This also exposes a PackageDeleted function to allow people to manually clear anything associated with a package (if doing some custom asset work).

	#rb Andrew.Rodham

Change 3087219 on 2016/08/12 by Jamie.Dale

	Updated TextRenderComponent to support multiple font pages

	It used to use the correct UV data, but wouldn't set the correct texture page when rendering. It now creates MIDs for all of the texture pages used by the font, and will use these MIDs (which override the font page on the material) when rendering the text (batched on sequential index/vertex buffer data with the same texture page).

	#rb Matt.Kuhlenschmidt

Change 3087308 on 2016/08/12 by Alex.Delesky

	#jira UE-14727  - Support for editing TSet properties in the editor's Details panel has been added.

	#rb Matt.Kuhlenschmidt

Change 3089140 on 2016/08/15 by Jamie.Dale

	We now abort a directory watch if we lose access to the directory in question

	This prevents an infinite loop in the call to MsgWaitForMultipleObjectsEx if a watched directory is deleted.

	#jira UE-30172
	#rb Andrew.Rodham

Change 3089148 on 2016/08/15 by Alexis.Matte

	Allow fbx export of any actor type.
	#rb none
	#codereview dmitriy.dyomin

Change 3089211 on 2016/08/15 by Jamie.Dale

	Unified access to the parent window for external dialogs

	A lot of places used to ad-hoc use the MainFrame window, even when they had access to a widget that may be belong to a different window. This could cause issues where an external dialog could appear behind a modal UE4 window (as it would appear above the MainFrame), and be inaccessible.

	You can now use IMainFrameModule::GetBestParentWindowHandleForDialogs to get the best window handle to use for an external dialog. This will either be the parent window for the given widget (if known), or failing that, the MainFrame window.

	#rb Andrew.Rodham

Change 3089640 on 2016/08/15 by Jamie.Dale

	Wrapped UMaterialExpression::MenuCategories in WITH_EDITORONLY_DATA to avoid gathering it for game-only loc

	#rb none

Change 3089661 on 2016/08/15 by Nick.Darnell

	Editor - There's a new view option "Show C++ Classes" in the content browser.  Lets you hide all those C++ folders most folks probably don't care to see.

	#rb none

Change 3089667 on 2016/08/15 by Cody.Albert

	Updating RoutePointerUpEvent to call OnDrop for touch events when dragging

	#jira UE-34709
	#rb nick.darnell

Change 3089694 on 2016/08/15 by Jamie.Dale

	Applied a fix to the ExcludeClasses setting in the loc gather

	#rb none

Change 3089889 on 2016/08/15 by Nick.Darnell

	Automation - Continued work on the screenshot portion of the automation system.  Going to start using the adapter information in the screenshots taken, otherwise we can't accurately test a plethora of devices sharing the same OS, with different capabilities.

	#rb none

Change 3090256 on 2016/08/16 by Nick.Darnell

	Automation - working on screenshots.
	#rb none

Change 3090322 on 2016/08/16 by Nick.Darnell

	Automation - Adding modified screenshot function.

	#rb none

Change 3090335 on 2016/08/16 by Nick.Darnell

	Automation - The tests were determined to need to be shared afterall, but at least keeping them as plugins.  Moved to Engine plugins.

	#rb none

Change 3090881 on 2016/08/16 by Nick.Darnell

	Automation - Moving the content over and fixing up some code so that the AutoRimport tests work as expected.

	#rb none

Change 3090884 on 2016/08/16 by Nick.Darnell

	Plugins - There's now support for generating a Content Only plugin from the new plugin wizard.

	#rb none

Change 3090911 on 2016/08/16 by Nick.Darnell

	Feature Packs - If there's an error loading a manifest, it's now an error, not a warning.

	#rb none

Change 3090913 on 2016/08/16 by Jamie.Dale

	Optimization and usability improvements of the MemoryProfiler2 tool

	 - Optimized the processing of the Callgraph, Histogram, and Short lived allocations views.
	    - The callgraph view is now using a virtualized tree view mapped to our own internal tree. This allows us to amortize the cost of adding nodes to the TreeView as the user views the nodes in the tree. In my own test, this took callgraph generation from ~45 seconds to ~5 seconds.
	    - The Histogram view was vastly optimized via the use of a HashSet on the callstack filter, and the batch addition of unsorted callstacks that are sorted once at the end. In my own test, this took histogram generation from ~15 minutes to ~2 seconds.
	    - The Short lived allocations view was optimized by avoiding redundant sorting, including maintaining a sorted order while inserting items, and instead doing a final sort at the end. The column selection was also optimized by avoiding copying the entire dataset just to resort it. In my own test, this took short lived allocation generation from ~1 minute to ~3 seconds.

	 - Added a user-configurable list of allocator functions to trim (which now includes FMemory and operator new by default, and produces much cleaner callstacks).

	#jira UETOOL-948
	#jira UETOOL-949
	#rb James.Hopkin

Change 3090962 on 2016/08/16 by Jamie.Dale

	Fixed double assignment of filter functions

	#rb none

Change 3090989 on 2016/08/16 by Nick.Darnell

	Editor - Attempting to fix the build, non-unity issue I suspect.

	#rb none

Change 3091754 on 2016/08/17 by Nick.Darnell

	FbxAutomationTestBuilder is now a plugin.  Users won't see it unless they've enabled the plugin (so primarily internal QA).  Reorganized the automation tools and testing menu to be a bit lower in the main menu, and gave them a more test sounding name.  Additionally made some modifications to the workspace menu structure to allow generating just a subset of a workplace menu so that I could target where I wanted to insert all of the automation tool menu items, rather than just allowing the general placement of them under developer tools...etc.

	#rb none
	#codereview Alexis.Matte

Change 3091758 on 2016/08/17 by Nick.Darnell

	Slate / Editor - Trying to make the editor less focus greedy.  Now when there are notification popups and tabs attempt to grab your attention we now do a few activation ownership checks to ensure that it or a parent window actually owns activation.  Not doing this has the nasty side effect of things like notifications and message log errors that popup while playing the game (if the game is in new window PIE), causing the game to be hidden, and focus returned to the editor.  Ran into this a lot running the automation tests, the new PIE window that's launched to run tests is immediately hidden as soon as the tests log a warning or error or a notification about high res screenshots happens.

	#rb none

	#codereview Nick.Atamas,Matt.Kuhlenschmidt

Change 3091829 on 2016/08/17 by Nick.Darnell

	Build - Attempting to repair the build.

	#rb none

Change 3091920 on 2016/08/17 by Nick.Darnell

	Build - Another attempt at fixing the mac build.

	#rb none

Change 3093380 on 2016/08/18 by Matt.Kuhlenschmidt

	Ignore group actors when checking for references to other actors when deleting.  The check for references is designed for gameplay affecting references which groups are not.  Having this show up for groups is annoying

	#rb none

Change 3094474 on 2016/08/19 by Jamie.Dale

	Fixed PS4 error when building with USE_MALLOC_PROFILER, and optimized symbol name resolution for a build with USE_MALLOC_PROFILER enabled

	#jira UETOOL-951
	#rb James.Hopkin

Change 3094581 on 2016/08/19 by Jamie.Dale

	Added missing allocator filter needed by PS4 profiles

	#rb none

Change 3094681 on 2016/08/19 by Richard.TalbotWatkin

	Fixed issue where painting override vertex colors on a SpeedTree mesh would cause its wind animation to cease. The OverrideVertexColors vertex factory needed to be registered with the SpeedTree renderer.
	#jira UE-32762 - Custom VertexPaint on SpeedTrees interferes with wind animation
	#rb none

Change 3095163 on 2016/08/19 by Trung.Le

	#jira UE-20849: Added tooltips to the inputs of the Material final result node
	#rb matt.kuhlenschmidt

Change 3095285 on 2016/08/19 by Trung.Le

	#jira UE-20849 In SGraphNodeMaterialResult, renamed ToolTip to ToolTipWidget so we're not hiding class member
	#rb none

Change 3095344 on 2016/08/19 by Alexis.Matte

	#jira UE-34690 When using the optionnal matrix to change the scene root node, we have to flush the fbx evaluation engine.
	Add also a new option to allow the user to automatically convert the fbx scene to unreal unit (centimeter).

	#rb none
	#codereview matt.kuhlenschmidt

Change 3096162 on 2016/08/22 by Alexis.Matte

	#jira UE-34763 Remove offending no-action combo box entry when the json file is readonly. Also clean up other combo box menu.
	#rb none
	#codereview matt.kuhlenschmidt

Change 3096261 on 2016/08/22 by Alexis.Matte

	#jira UE-33121 Make sure re-import all and import all fix all the issue before starting the job. So it get not interrupt during the process.

	#rb lina.halper
	#codereview lina.halper

Change 3096344 on 2016/08/22 by Jamie.Dale

	NSString conversion fix for UTF-32 strings containing characters outside of the BMP

	#jira UE-33971
	#rb Peter.Sauerbrei, James.Hopkin

Change 3096605 on 2016/08/22 by Alex.Delesky

	#jira UE-34787 - Dropdown menus in standalone programs will now correctly display tooltips if they have any.

	#rb Matt.Kuhlenschmidt

Change 3096615 on 2016/08/22 by Alex.Delesky

	#jira UE-33334 - Scrolling up on the mouse wheel when using the orbit camera should no longer move away from the orbit point when the camera moves too close to the orbit origin.

	#rb Matt.Kuhlenschmidt

Change 3096619 on 2016/08/22 by Alex.Delesky

	#jira UE-34084 - Structs containing an enum with a value that contains a whitespace character will now serialize correctly when copied from the Details Panel.

	#rb Matt.Kuhlenschmidt

Change 3097644 on 2016/08/23 by Matt.Kuhlenschmidt

	PR #2729: Fix a typo in the comment (Contributed by adcentury)

	#rb none

Change 3097648 on 2016/08/23 by Matt.Kuhlenschmidt

	PR #2726: Undef unused macros (Contributed by shrimpy56)

	#rb none

Change 3097697 on 2016/08/23 by Matt.Kuhlenschmidt

	Guard against crash when details panels rebuild when their customizations have been torn down

	https://jira.ol.epicgames.net/browse/UE-35048

	#rb none

Change 3097757 on 2016/08/23 by Alex.Delesky

	#jira UE-14727  - Support for editing TMap properties in the editor's Details panel has been added. This change also removes the Duplicate option from TSet elements, and disallows entry of duplicates elements into a TSet or duplicate keys into a TMap

	#rb Matt.Kuhlenschmidt

Change 3098164 on 2016/08/23 by Alexis.Matte

	#jira UE-34686 Fbx importer bImportMeshesInBoneHierarchy is used also by the animation.
	#rb none
	#codereview matt.kuhlenschmidt

Change 3098502 on 2016/08/23 by Alexis.Matte

	#jira UE-30951 Fbx option dialog, we disable the option to bake pivot if transform vertex position is true
	#rb none
	#codereview matt.kuhlenschmidt

Change 3099986 on 2016/08/24 by Jamie.Dale

	Fixing non-editor builds

	#rb none

Change 3101138 on 2016/08/25 by Matt.Kuhlenschmidt

	Fixed viewport redraw callback not being called when certian property modifications occur in the details panel (reset to default, array size changes, etc)

	#rb none

Change 3101280 on 2016/08/25 by Jamie.Dale

	Fixed crash when counting memory over internationalization meta-data

	- The serialization code only used to handle loading or saving, now it handles loading or not loading.
	- The Type of the meta-data wasn't set by all constructors. For safety it has been removed and replaced with a virtual function that the derived types override.

	#rb James.Hopkin

Change 3101283 on 2016/08/25 by Jamie.Dale

	MProf2 platform and symbol parsing improvements

	 - Updated ISymbolParser to work with lazy symbol resolution (handled via the UI when looking at full callstacks).
	 - Added a PS4 symbol parser which handles performing full file/line resolution for symbols.
	 - Removed all the V3 file format support and legacy platform handling.
	 - Optimized FStreamInfo.GetNameIndex so it can be used by the lazy symbol fixup.

	#rb James.Hopkin

Change 3101586 on 2016/08/25 by Jamie.Dale

	Small code cleanup and path normalization

	#rb James.Hopkin

Change 3101837 on 2016/08/25 by Alexis.Matte

	#jira UE-35101 we now store the sourceanimationname to retrieve the correct animtrack when re-importing animations
	#rb none
	#codereview matt.kuhlenschmidt

Change 3102537 on 2016/08/26 by Jamie.Dale

	Fix for potential crash in FICUCamelCaseBreakIterator

	In platforms with UTF-32 strings, the index returned by FICUTextCharacterIterator may not be in the same range as FString, so we need to call InternalIndexToSourceIndex to ensure that it is.

	#rb James.Hopkin

Change 3102582 on 2016/08/26 by Matt.Kuhlenschmidt

	Log the freetype version when it starts up (for debugging purposes)

	#rb none

Change 3102657 on 2016/08/26 by Alexis.Matte

	#jira UE-29177 When re-importing a texture we want to notify materials using this texture so they can recompile the shader.
	#review-3101585 @uriel.doyon
	#rb matt.kuhlenschmidt

Change 3102704 on 2016/08/26 by Jamie.Dale

	Added symbol meta-data support to MProf2

	You can now define platform specific meta-data using FPlatformStackWalk::GetSymbolMetaData, which is then stored within the generated .mprof file.

	PS4 uses this meta-data to say where the original .self file can be found, so that MProf2 can usually automatically load the .self file without having to bother the user.

	#rb James.Hopkin

Change 3102878 on 2016/08/26 by Matt.Kuhlenschmidt

	Added support for outline fonts
	- An outline size (in slate units), optional material and optional fill color can be specified with each font info.
	- Outlines do not contribute to measurement directly so the text measuring and shaping methods have been modified to account for outlines
	- Fixed a bug where font materials do not work properly if part of the font's rendered glyphs were in a different atlas

	#rb jamie.dale

Change 3102879 on 2016/08/26 by Jamie.Dale

	Bumped the MProf2 version so we can tell which build of the tool can load v6 mprof files

	#rb none

Change 3102960 on 2016/08/26 by Alexis.Matte

	build fix
	#rb none

Change 3103032 on 2016/08/26 by Jamie.Dale

	Fixed SEditableText and SMultiLineEditableText not setting the correct foreground color when painting

	#jira UE-34936
	#rb Matt.Kuhlenschmidt

Change 3103278 on 2016/08/26 by Jamie.Dale

	Fixing Clang warnings

	#rb none

Change 3104211 on 2016/08/29 by Ben.Marsh

	Add build script for automated tests, and create settings file for Dev-Editor which adds an agent pool for running them.

	#rb none

Change 3104290 on 2016/08/29 by Alex.Delesky

	Adding additional documentation accessible from the editor for TSet and TMap properties, along with a quick clarification on container properties to let the user know what kind of container they're working with.

	#rb Matt.Kuhlenschmidt

Change 3104292 on 2016/08/29 by Alex.Delesky

	#jira UE-35039 - Command/Control user keybindings will no longer flip-flop when the editor is opened on Mac.

	#rb Matt.Kuhlenschmidt

Change 3104294 on 2016/08/29 by Alex.Delesky

	#jira UE-34952 - The user will no longer encounter an ensure when setting the value of Period equal to or less than 0 on the circular throbber widget

	#rb Matt.Kuhlenschmidt

Change 3104295 on 2016/08/29 by Matt.Kuhlenschmidt

	PR #2682: Remove unused bUseDesktopResolutionForFullscreen (Contributed by stfx)

	#rb none

Change 3104296 on 2016/08/29 by Alex.Delesky

	#jira UE-35160 - The Auto Distance Error for LOD meshes can now be set to any value larger than zero.

	#rb Matt.Kuhlenschmidt

Change 3104348 on 2016/08/29 by Matt.Kuhlenschmidt

	Added the ability to clear the preview mesh on a material instance.  Previously there was no way to null it out.

	#rb none

Change 3104355 on 2016/08/29 by Matt.Kuhlenschmidt

	Guard against crash with invalid path to the default physical material.  Just create a new one if it doesnt exist and warn about it.

	#rb none
	#jira UE-31865

Change 3104396 on 2016/08/29 by Ben.Marsh

	Fix incrorrect agent names for running automated tests

Change 3104610 on 2016/08/29 by Alex.Delesky

	Fix for AutomationTool compile editor from changes introduced today.

	#rb None

Change 3104611 on 2016/08/29 by Michael.Dupuis

	#jira UETOOL-253
	#rb Alexis.Matte

Change 3105826 on 2016/08/30 by Gareth.Martin

	Added console variables to discard grass and/or scalable foliage data on load
	#jira UE-35086
	#rb Benn

Change 3106126 on 2016/08/30 by Matt.Kuhlenschmidt

	Eliminated bad code duplication between retainer widgets and element batcher

	#rb none
	#codereview nick.darnell

Change 3106449 on 2016/08/30 by Michael.Dupuis

	#jira UETOOL-229 Added generic command icons used in Edit Menu (including contextual menu)
	#rb Alexis.Matte

Change 3106966 on 2016/08/30 by Jamie.Dale

	Fixed FApp::IsAuthorizedUser not considering the SessionOwner override

	#rb Max.Preussner

Change 3107687 on 2016/08/31 by Michael.Dupuis

	Checkout/Make Writable on proper config file

	#rb Matt Kuhlenschmidt

Change 3107736 on 2016/08/31 by Matt.Kuhlenschmidt

	Fixed mode typos in the lerp instruction

	#rb none

Change 3107830 on 2016/08/31 by Matt.Kuhlenschmidt

	Logging and guard against UEditorEngine::TeardownPlaySession crash.

	#rb none
	https://jira.ol.epicgames.net/browse/UE-35325

Change 3107912 on 2016/08/31 by Alex.Delesky

	#jira UE-35181 - Normalizing paths when retrieving absolute filenames for source control operations.

	#rb Matt.Kuhlenschmidt

Change 3107986 on 2016/08/31 by Matt.Kuhlenschmidt

	Removed PropertyTestObject.h out of UnrealEd.h so you dont have to compile the entire editor when changing this one file.

	#rb none

Change 3108027 on 2016/08/31 by Chris.Wood

	Re-added lost doc comment for analytics event "Engine.AbnormalShutdown".

	#rb none - just a comment in a cpp file
	#codereview wes.hunt

Change 3108580 on 2016/08/31 by Mike.Fricker

	Deleted the "Live Editor" plugins from UE4
	- These were undocumented, buggy and never finished, and we have no plans to complete them
	- Both the "LiveEditor" and "LiveEditorListenServer" plugins were deleted, along with related icon files

	#codereview matt.kuhlenschmidt
	#rb matt.kuhlenschmidt

Change 3108604 on 2016/08/31 by Mike.Fricker

	Added new "MIDI Device" plugin (disabled by default)

	- This is a simple MIDI interface that allows you to receive MIDI events from devices connected to your computer

	- Currently only input is supported.  In the future we might allow for output, as well.

	- In Blueprints, here's how to use it:
	        - Look for "MIDI Device Manager" in the Blueprint RMB menu
	        - Call "Find MIDI Devices" to choose your favorite device.  Break the "Found MIDI Device" struct to see what's available.
	        - Then call "Create MIDI Device Controller" for the device you want.  Store that in a variable.
	        - On your MIDI Device Controller, bind your own Event to the "On MIDI Event" event.  This will be called every game Tick when there is at least one new MIDI event to receive.
	        - Process the data passed into the Event to make your project do stuff!

	- This plugin makes use of the "PortMidi" third party library (which already existed in UE4 -- it was used by the now-deprecated 'LiveEditor' plugin)

	#codereview matt.kuhlenschmidt
	#rb none

Change 3108760 on 2016/08/31 by Alexis.Matte

	#jira UE-25840 Fbx export collision mesh, we now export collision: box, sphere, capsule and convex mesh. There is an option in the editor preference to enable the export of collisions, default value is false.
	#rb none
	#codereview matt.kuhlenschmidt

Change 3109006 on 2016/08/31 by Alex.Delesky

	#ignore Source Control rename test - initial commit

Change 3109044 on 2016/08/31 by Alex.Delesky

	#ignore Testing asset rename from P4 to observe correct behavior.

	#rb none

Change 3109048 on 2016/08/31 by Alex.Delesky

	#ignore Testing P4 rename to identify correct behavior

	#rb none

Change 3110044 on 2016/09/01 by Gareth.Martin

	Fixed painting foliage on blocking "query" actors not working
	#jira UE-33852
	#rb Allan.Bentham

Change 3110133 on 2016/09/01 by Alexis.Matte

	Fix crash in function GetForceRecompileTextureIdsHash
	#rb none
	#codereview jamie.dale

Change 3111848 on 2016/09/02 by Mike.Fricker

	MIDI Device plugin: Fixed compilation error on Clang compilers (Mac, Linux)
	- Fixed bad enum cast
	#rb none

Change 3111995 on 2016/09/02 by Michael.Dupuis

	#jira UE-35263

	Do not try selecting the actor if the actor is in the blueprint
	Properly Refresh the ToopTip & Hyper Link to take into account blueprint recreation process

	#rb Alexis Matte

Change 3112280 on 2016/09/02 by Michael.Dupuis

	Call MakeWritable if source control fail

	#rb Alexis Matte

Change 3112335 on 2016/09/02 by Cody.Albert

	Updating cursor hiding logic to not improperly hide cursor when left clicking in ortho mode

	#jira UE-35306
	#rb none

Change 3112478 on 2016/09/02 by Alexis.Matte

	#jira UE-20059 Use a base material to import fbx material.
	#rb uriel.doyon
	#codereview matt.kuhlenschmidt
	#1468 Github pull request number

Change 3113912 on 2016/09/06 by Michael.Dupuis

	#jira UE-32288 Fixed Console params display
	#rb Alexis Matte

Change 3114026 on 2016/09/06 by Alex.Delesky

	#jira UE-35123 - The Details panel in a Texture editor or Simple Asset editor window will no longer disappear when the inspected asset is imported again.

	#rb Matt.Kuhlenschmidt

Change 3114032 on 2016/09/06 by Alex.Delesky

	PR #2733: Improved the project launcher progress page (Contributed by projectgheist)

	#jira UE-34027
	#rb Matt.Kuhlenschmidt

Change 3114034 on 2016/09/06 by Alex.Delesky

	#jira UE-35265 - Copying a comment node from a Material Function and pasting it inside a Material will no longer render the Material unsaveable

	#rb Matt.Kuhlenschmidt

Change 3114071 on 2016/09/06 by Nick.Darnell

	[AUTOMATED TEST] Automatic checkin, testing functionality.

Change 3114109 on 2016/09/06 by Nick.Darnell

	[AUTOMATED TEST] Automatic checkin, testing functionality.

Change 3114562 on 2016/09/06 by Nick.Darnell

	Adding LevelEditor to the FbxAutomationTestBuilder to fix a compiler issue.

	#rb none

Change 3114701 on 2016/09/06 by Michael.Dupuis

	#jira UE-31988 add const to all usage of TArray<ItemType>* as it was done in SListView
	#rb Alexis Matte

Change 3114861 on 2016/09/06 by Matt.Kuhlenschmidt

	Prevent non-thread safe slate code from running on the slate loading thread

	#rb none

Change 3115698 on 2016/09/07 by Nick.Darnell

	Make sure the commands are available - during functional testing that was found to not always be the case.

	#rb none

Change 3115719 on 2016/09/07 by Nick.Darnell

	Adding an IsRegistered command to commands.

	#rb none

Change 3115721 on 2016/09/07 by Nick.Darnell

	Adding a new built VirtualReality feature pack, this new one contains the update manifest that will parse correctly.

	#rb none

Change 3115722 on 2016/09/07 by Nick.Darnell

	IsBindWidgetProperty now returns false if the property passed in is null.

	#rb none

Change 3115734 on 2016/09/07 by Alexis.Matte

	#jira UE-30166 Support fbx sdk 2017
	#rb none

Change 3115737 on 2016/09/07 by Nick.Darnell

	Adding an image comparer for screenshots.  Removing some content from EngineTest.

	#rb none

Change 3115743 on 2016/09/07 by Nick.Darnell

	Checkpointing a bunch of progress towards a screenshot comparison workflow that allows us to diff screenshots taken on various platforms and hardware.  Disabling many tests that are not passing.  Updating a few tests to log better errors, and fixed a few tests with easy bugs in them so they would start passing again.  All editor tests currently passing!

	#rb none

Change 3115748 on 2016/09/07 by Nick.Darnell

	Making the RuntimeTests plugin a Developer module, so that it doesn't get included in shipping builds.

	#rb none

Change 3115789 on 2016/09/07 by Jamie.Dale

	We now favor Traditional Chinese for Hong Kong and Macau

	#rb James.Hopkin

Change 3115799 on 2016/09/07 by Jamie.Dale

	Removed validity check on source cultures when remapping, as platforms may use invalid cultures that need to be remapped

	#rb James.Hopkin

Change 3115826 on 2016/09/07 by Nick.Darnell

	Adding missing files.

	#rb none

Change 3115838 on 2016/09/07 by Nick.Darnell

	Back out revision 6 from //UE4/Dev-Editor/Engine/Source/Runtime/UMG/Public/Components/WidgetInteractionComponent.h

	#rb none

Change 3116007 on 2016/09/07 by Alexis.Matte

	build fix
	#rb none

Change 3116057 on 2016/09/07 by Jamie.Dale

	Fixed widget snapshot messages so they appear in the message debugger

	#rb none

Change 3116112 on 2016/09/07 by Nick.Darnell

	Removing the FbxAutomationBuilder file that go recreated on a merge from main.

	#rb none

Change 3116365 on 2016/09/07 by Michael.Dupuis

	#jira UE-20765 Added missing class flag to test (CLASS_CONFIG) and change a bit how the checkout/make writable work.
	#codereview Matt.Kuhlenschmidt
	#rb Alexis.Matte

Change 3116622 on 2016/09/07 by Alexis.Matte

	#jira UE-35608 Use the same naming convention when trying to retrieve uv channel by name.
	#rb matt.kuhlenschmidt

Change 3116638 on 2016/09/07 by Jamie.Dale

	Ensured that manifests and archives don't try and load data that they can't parse

	#rb none

Change 3117397 on 2016/09/08 by Gareth.Martin

	Added rotate and blend support to the landscape mirror tool
	#jira UE-34829
	#rb Jack.Porter

Change 3117459 on 2016/09/08 by Gareth.Martin

	Fixed crash saving a hidden landscape level with an offset (cloned from 4.13.1)
	#jira UE-35301
	#rb Jack.Porter

Change 3117462 on 2016/09/08 by Gareth.Martin

	Fixed invisible landscape components and crashes when tessellation is enabled (cloned from 4.13.1)
	#jira UE-35494
	#rb Benn.Gallagher

Change 3117583 on 2016/09/08 by Nick.Darnell

	Continued work on automation support for screenshot comparison, stubbing in a commandlet that can be run after automation tests that would perform the diffing.  Need to finish rigging it up so that deltas and results can be dumped out somewhere and consumed by a tool to approve shots.

	#rb none

Change 3117595 on 2016/09/08 by Nick.Darnell

	Updating the build script for AutomatedTests, going to see if this works!

	#rb none

Change 3117808 on 2016/09/08 by Nick.Darnell

	Adding header includes for async.

	#rb none

Change 3117812 on 2016/09/08 by Matt.Kuhlenschmidt

	Partially taken from Pr 2381

	Fixed Array Properties to handle duplicates properly and fixed Material Parameter Collection duplicate Guid problem.

	#rb none

Change 3117851 on 2016/09/08 by Jamie.Dale

	Silenced some redundant P4 errors that could be generated when running a stat update on a file

	Some of the options produced errors when working with newly added files. These errors are now downgraded to infos like they are for the main stat command.

	#rb Ben.Marsh
	#codereview Thomas.Sarkanen

Change 3117853 on 2016/09/08 by Gareth.Martin

	Clean up landscape includes and PCH
	#rb steve.robb

Change 3117859 on 2016/09/08 by Alex.Delesky

	#jira UE-35321 - Minimized windows will no longer act like they are visible when determining what widgets are currently underneath the mouse.

	#rb Nick.Darnell

Change 3117997 on 2016/09/08 by Nick.Darnell

	Updating the automation tests build script to use Editor-Cmd

	#rb none

Change 3118005 on 2016/09/08 by Matt.Kuhlenschmidt

	Properly reference graph node on material expressions so they are not GC'd while an expression still uses them

	#jira UE-35362
	#rb none

Change 3118043 on 2016/09/08 by Alex.Delesky

	#jira UE-30649 - Removed unnecessary returns from UWidget API.

	PR #2377: fix widget bug. (Contributed by dorgonman)

	#rb none

Change 3118045 on 2016/09/08 by Matt.Kuhlenschmidt

	Guard against crash saving config during level editor shutdown

	#rb none
	#jira UE-35605

Change 3118074 on 2016/09/08 by Matt.Kuhlenschmidt

	PR #2783: Removed #pragme once from CPP files (Contributed by projectgheist)

	#rb none

Change 3118078 on 2016/09/08 by Michael.Dupuis

	#jira UE-32065 Removed the -windows that was added as a default option and add it simply if fullscreen is not specified
	#rb Alexis.Matte

Change 3118080 on 2016/09/08 by Michael.Dupuis

	#jira UE-31131 Do not show a contextual menu if the menu is empty
	#rb Alexis.Matte

Change 3118087 on 2016/09/08 by Matt.Kuhlenschmidt

	Constify this method

	#rb none

Change 3118166 on 2016/09/08 by Nick.Darnell

	Trying additional command options for the build machine for automation.

	#rb none

Change 3118222 on 2016/09/08 by Matt.Kuhlenschmidt

	Fix actor delete during mesh paint not working during undo

	#rb none
	#jira UE-35684

Change 3118298 on 2016/09/08 by Alexis.Matte

	#jira UE-35302 Export all LODs for static mesh when there is no force LOD
	#rb uriel.doyon

Change 3118325 on 2016/09/08 by Matt.Kuhlenschmidt

	Fixed reset to default not appearing for slate brushes

	#rb none
	#jira UE-34958

Change 3119321 on 2016/09/09 by Matt.Kuhlenschmidt

	Guard against crash with an invalid world trying to be opened from the content browser

	#rb none
	https://jira.ol.epicgames.net/browse/UE-35712

Change 3119433 on 2016/09/09 by Nick.Darnell

	Removing a hack added by Paragon that prevents applications from resizing in real time as the user drags the size of the window around.

	#rb Matt.Kuklenschmidt
	#jira UE-35789

Change 3119448 on 2016/09/09 by Alex.Delesky

	When simulating touch events using the mouse, clicking the mouse will no longer let a drag operation continue. This should also allow the finger that started a drag to continue dragging items until it is released from the surface.

	#rb Nick.Darnell

Change 3119522 on 2016/09/09 by Jamie.Dale

	Fixed FDetailCategoryImpl::ShouldBeExpanded not honoring bShouldBeInitiallyCollapsed when bRestoreExpansionState was true

	#rb Matt.Kuhlenschmidt

Change 3119528 on 2016/09/09 by Jamie.Dale

	Some UI re-work to the localization dashboard

	This makes a better use of the available space, and will make it easier to make some other planned changes in the future.

	#rb James.Hopkin

Change 3119861 on 2016/09/09 by Michael.Dupuis

	#jira UE-9284 Added the Play/Stop button on the thumbnail
	#rb Alexis.Matte

Change 3120027 on 2016/09/09 by Alexis.Matte

	incorporate some fixes from licensee for LOD group re-import workflow
	#jira UE-32268
	#rb uriel.doyon
	#codereview matt.kuhlenschmidt

Change 3120845 on 2016/09/12 by Gareth.Martin

	Fixed crash in landscape editor when "Early Z" is enabled (cloned from 4.13.1)
	#jira UE-35850
	#rb Allan.Bentham

Change 3120980 on 2016/09/12 by Nick.Darnell

	Adding a commandlet that is runnable for comparing screenshots.  Adding comparing and exporting capability to the screenshot manager.

	#rb none

Change 3120992 on 2016/09/12 by Alex.Delesky

	#jira UE-35575 - TScriptInterface UProperties now have asset picker support.

	#rb Matt.Kuhlenschmidt

Change 3121074 on 2016/09/12 by Michael.Dupuis

	#jira UE-30092
	Added path length in error message when typing
	Added display of current filepath lenght for cooking

	#rb Alexis.Matte

Change 3121113 on 2016/09/12 by Nick.Darnell

	Adding some placeholder examples to show people how to author tests in EngineTest.

	#rb none

Change 3121152 on 2016/09/12 by Gareth.Martin

	Added TElementType, TIsContiguousContainer traits
	Added GetData(), GetNum() generic functions
	#rb Steve.Robb

Change 3121702 on 2016/09/12 by Jamie.Dale

	Optimized a loop over a sorted list to instead use a binary search

	This speeds up the short-lived allocation view generation.

	We also now dump the exception information to the Trace log when in a non-debug build.

	#rb James.Hopkin

Change 3121721 on 2016/09/12 by Jamie.Dale

	We now set the window mode first when resizing the game viewport to ensure that the work area is correct

	Fullscreen windows can affect the available work area size, which can break centering when moving between fullscreen and windowed mode.

	#jira UE-32842
	#rb Matt.Kuhlenschmidt

Change 3122578 on 2016/09/13 by Jamie.Dale

	Small code clean up

	Removed a use of the placement new style array addition.

	#rb none

Change 3122634 on 2016/09/13 by Jamie.Dale

	We now immediately update DefaultConfigCheckOutNeeded when checking out/making writable the config file, rather than wait for the text tick

	#jira UE-34865
	#rb James.Hopkin

Change 3122656 on 2016/09/13 by Jamie.Dale

	Fixed array combo button not focusing its contents, which prevented the menu closing correctly

	#jira UE-33667
	#rb none

Change 3122661 on 2016/09/13 by Nick.Darnell

	Checkpointing additional work on the screenshot compare dialog, moving some Directory path picker widget into a more common area.  Moving some "Find the best top level window handle for this widget for dialogs' code out of the main frame module and into Slate Application where it probably belongs.

	#rb none

Change 3122678 on 2016/09/13 by Jamie.Dale

	Fixing CIS error on Clang

	CoreUObject needs to be included before USTRUCT can be used.

	#rb none

Change 3122686 on 2016/09/13 by Jamie.Dale

	Fixing CIS error on Clang

	CoreUObject needs to be included before UCLASS can be used.

	#rb none

Change 3122728 on 2016/09/13 by Nick.Darnell

	UMG - Exposing a trace channel for the WIC, defaults to Visibility.  Improving how the WIC handles the cursor moving off the widget, it now maintains the last hit location rather than 0,0 which would cause things like dragged Sliders to reset to the left.  Ideally - the WIC would know the underlying widget has capture and continue to fake collision against an imaginary plane to simulate a continuous surface.

	#jira UE-35167
	#rb none

Change 3122775 on 2016/09/13 by Nick.Darnell

	Automation - Fixing an error with the ScreenshotTools plugin, needed to add an the include for Engine.h to the PCH.

	#rb none

Change 3122779 on 2016/09/13 by Nick.Darnell

	Widgetnimation - Exposing more of the class to C++.

	#rb none

Change 3122793 on 2016/09/13 by Nick.Darnell

	Fixing a crash in UWidgetComponent::UpdateRenderTarget updating a null material instance.

	#jira UE-35796
	#rb none

Change 3122834 on 2016/09/13 by Matt.Kuhlenschmidt

	Fixed crash undoing moves after bsp creation

	https://jira.ol.epicgames.net/browse/UE-35880

	#rb none

Change 3122835 on 2016/09/13 by Nick.Darnell

	Reverting changes to WIdgetAnimation

	#rb none

Change 3122897 on 2016/09/13 by Matt.Kuhlenschmidt

	Fixed non-editor compile error
	#rb none

Change 3122988 on 2016/09/13 by Alexis.Matte

	Material workflow refactor
	#jira UETOOL-774
	#rb matt.kuhlenschmidt

Change 3123006 on 2016/09/13 by Jamie.Dale

	Fixed dynamic collections not returning anything

	#jira UE-35869
	#rb James.Hopkin

Change 3123145 on 2016/09/13 by Alexis.Matte

	Fix fbx automation test. The test found a regression cause by CL: 3120027. In the case where we dont have a LODGroup we dont want to add LODs before the build.
	#jira UE-32268
	#rb none
	#codereview matt.kuhlenschmidt

Change 3123148 on 2016/09/13 by Matt.Kuhlenschmidt

	Fix fortnite compile error

	#rb alexis.matte

Change 3123208 on 2016/09/13 by Jamie.Dale

	The 'find culprit' dialog now honors the user choice

	#rb RichTW

Change 3123545 on 2016/09/13 by Nick.Darnell

	Slate - Adjusting the window dialog host finding code to do a better job of searching for slate windows and excluding popups and non-regular windows.

	#rb none

Change 3124494 on 2016/09/14 by Jamie.Dale

	Added ~ to the list of invalid characters for object/package names

	#jira UE-12908
	#rb Matt.Kuhlenschmidt

Change 3124513 on 2016/09/14 by Gareth.Martin

	Implemented filter to allow painting foliage on other foliage
	- Altered foliage filters so it will no longer paint on object types which don't have a filter, e.g. skeletal meshes
	#rb Allan.Bentham
	#2472

Change 3124523 on 2016/09/14 by Jamie.Dale

	PR #2724: Fix ScrollBox right mouse/touch grab scrolling functionality (Contributed by aarmbruster)

	#jira UE-34811
	#jira UE-32082
	#rb none

Change 3124607 on 2016/09/14 by Nick.Darnell

	UMG - Adding BoundsScale support to the WidgetComponent's CalcBounds function.

	#jira UE-35667
	#rb none

Change 3124785 on 2016/09/14 by Gareth.Martin

	Made some foliage functions editor-only to fix non-editor build
	#rb none

Change 3124795 on 2016/09/14 by Gareth.Martin

	Saved/loaded the new foliage filter
	#rb Allan.Bentham
	#2472

Change 3124915 on 2016/09/14 by Michael.Dupuis

	#jira UE-19511
	Add support for Add to source control on DefaultEditorPerProjectUserSettings file
	Remove CheckoutNotice when not editing a DefaultXXXX.ini file
	Edit proper config file either we're modifying settings from a Default file or Local user file
	#codereview Matt.Kuhlenschmidt Max.Preussner
	#rb Alexis.Matte

Change 3125266 on 2016/09/14 by Jamie.Dale

	Fixed ULocalizationTarget::DeleteFiles not deleting cultures, and using SCC wrong

	#rb none

Change 3125385 on 2016/09/14 by Matt.Kuhlenschmidt

	Fix crash when using SaveAs to save over top of an existing level

	#rb none
	https://jira.ol.epicgames.net/browse/UE-35919
	https://jira.ol.epicgames.net/browse/UE-35921

Change 3125487 on 2016/09/14 by Alexis.Matte

	Fix cook content, regression induce by the material workflow refactor
	#rb matt.kuhlenschmidt

Change 3126217 on 2016/09/15 by Gareth.Martin

	Unset bHasPerInstanceHitProxies on landscape grass components, as they don't have individually editable instances
	#rb Allan.Bentham

Change 3126311 on 2016/09/15 by Jamie.Dale

	Placement mode fixes

	 - The display name is now cached correctly on construction, and the FPlaceableItem instance used with SPlacementAssetEntry is now const.
	 - Ensured that the ID used by FPlaceableItem could never overflow.
	 - Fixed some types being missing from the "All Classes" list.
	 - Fixed the escape key not cancelling the search.

	#jira UE-35972
	#rb James.Hopkin

Change 3126325 on 2016/09/15 by Jamie.Dale

	Made sure that UWorld::GetAssetRegistryTags called its Super function so that properties tagged as AssetRegistrySearchable will be added.

	#rb Andrew.Rodham

Change 3126403 on 2016/09/15 by Gareth.Martin

	Added Find and Contains functions to TBitArray
	#rb Steve.Robb

Change 3126405 on 2016/09/15 by Gareth.Martin

	Allowed instances of Hierarchical Instanced Mesh Components to be moved around with the transform widget in the blueprint editor
	- Just like regular instanced mesh components!
	Also fixed not being able to move instances of an instanced mesh component when it is the root component
	Also also fixed Hierarchical Instanced Mesh Components not flushing their async tree build on saving (this was causing log spam from PostLoad when dragging instances around as the blueprint would constantly reinstance the component before the async tree build had finished)
	#jira UE-29357
	#rb Allan.Bentham

Change 3126444 on 2016/09/15 by Jamie.Dale

	Fixed the loc dashboard configs not working with SCC

	This isn't a great solution, but the whole way the loc dashboard manages its config data is in need of an overhaul.

	#rb none

Change 3126446 on 2016/09/15 by Jamie.Dale

	Fixed loc dashboard game and engine targets sharing the same expansion settting

	#rb none

Change 3126555 on 2016/09/15 by Chris.Wood

	Removed WER from Windows crash handling. Crashes saved to log folder and passed to CRC with explicit path.
	[UE-34470] - Investigate WER settings and if they can conflict with CRC on Windows

	#rb Steve.Robb

Change 3126586 on 2016/09/15 by Gareth.Martin

	Fixed missing landscape components when using a LODBias (cloned from 4.13.1)
	#jira UE-35873
	#rb Jack.Porter

Change 3126610 on 2016/09/15 by Jamie.Dale

	Stopped PS4 from always staging all ICU data files

	#rb Marcus.Wassmer

Change 3126779 on 2016/09/15 by Michael.Dupuis

	#jira UE-32914 Improve the help text to provide usage examples and params
	#rb Alexis.Matte

Change 3126849 on 2016/09/15 by Matt.Kuhlenschmidt

	Fix font material and outline font material not being animatable in sequencer

	#rb frank.fella

Change 3126858 on 2016/09/15 by Matt.Kuhlenschmidt

	File not saved
	#rb none

Change 3127001 on 2016/09/15 by Matt.Kuhlenschmidt

	Fixed reset to default state still not appearing in all cases after changing a property.

	#rb none

Change 3127038 on 2016/09/15 by Nick.Darnell

	UMG - Improving focus setting for users on widgets.  If we're unable to set the focus immediately, possibly because the user is setting focus in the Construct callback before the widget is in the tree, we now update the SlateOperations FReply on LocalPlayer to set focus next frame when it's more likely the widget will become focusable.

	#rb none

Change 3127061 on 2016/09/15 by Nick.Darnell

	Slate - We now have a reentrancy guard in TPanelChildren to avoid the broad cases where users might attempt to remove children while all children are being removed.  Which is an easy case to engineer if you've got widgets spawning children managed by another widget, that all go away at the same time, thus causing the parent to attempt to cleanup children.  The end result is a delete while deleting.  So now TPanelChildren prevents adds/removes while emptying the list of children.

	#jira UE-35726
	#rb Matt.Kuchlenschmidt

Change 3127205 on 2016/09/15 by Alex.Delesky

	#jira UE-18013 - Users can now add Textures, Materials, or Sprites to a Widget Blueprint directly from the content browser. This also fixes a few issues with adding Widget Blueprints to another Widget BP from the content browser, such as adding a widget to itself or creating a circular dependency.

	#rb Nick.Darnell

Change 3127971 on 2016/09/16 by Matt.Kuhlenschmidt

	Fix crash in scene outliner if actors become invalid

	#rb none

	https://jira.ol.epicgames.net/browse/UE-35932

Change 3128011 on 2016/09/16 by Matt.Kuhlenschmidt

	Added guards for crashes accessing slate resources for deleted uobjects

	#rb nick.darnell

Change 3128067 on 2016/09/16 by Michael.Dupuis

	#jira UE-34158 Add an option to auto expand advanced details
	#rb Alexis.Matte

Change 3128073 on 2016/09/16 by Michael.Dupuis

	#jira UE-1145
	Set Save As to Ctrl + Alt + S
	Set Save All to Ctrl + Shift + S
	Set Save Current to Ctrl + S

	#rb Alexis.Matte

Change 3128117 on 2016/09/16 by Jamie.Dale

	Updated the pin-type filter combo to filter on both the localized and source type descriptions

	#jira UE-36081
	#rb none

Change 3128177 on 2016/09/16 by Alexis.Matte

	#jira UE-35946 Remove unnecessary GetReadValue call with bad parameter. The read value call is cache so subsequent call was returning the bad cache value.

	#rb michael.dupuis
	#codereview matt.kuhlenschmidt

Change 3128387 on 2016/09/16 by Gareth.Martin

	Fixed location and rotation of arrow widget in the landscape mirror tool when using one of the new "Rotate" modes
	#jira UE-36093
	#rb none

Change 3128445 on 2016/09/16 by Matt.Kuhlenschmidt

	Guard against scene outliner crash.  Print out tree when items appear twice.
	https://jira.ol.epicgames.net/browse/UE-35935

	#rb none

Change 3128454 on 2016/09/16 by Matt.Kuhlenschmidt

	Remove category for WindowTitleBarArea.  It is very custom for internal use and should not be a top level widget

	#rb none

Change 3128482 on 2016/09/16 by Michael.Dupuis

	Added new key binding for generic Save, Save As
	Added new key binding for Save All for the content browser

	#rb Alexis.Matte (approved by MattK)

Change 3128560 on 2016/09/16 by Matt.Kuhlenschmidt

	Fix build warning

	#codereview nick.darnell
	#rb none

Change 3128642 on 2016/09/16 by Alexis.Matte

	#jira UE-36047 We now convert the light color correctly when importing and exporting fbx files. UE4 is sRGB and FBX is linear
	#rb none
	#codereview matt.kuhlenschmidt

Change 3128733 on 2016/09/16 by Nick.Darnell

	UMG - Fixing a bad merge, some code was removed causing all BindWidget statements to fail to compile correctly.

	#jira UE-36105
	#rb none

Change 3128768 on 2016/09/16 by Matt.Kuhlenschmidt

	Fix selection outline showing around edges of all internal mesh sections of a component instead of around the entire actor

	#rb none

Change 3128779 on 2016/09/16 by Matt.Kuhlenschmidt

	Fix offset characters on some small fonts

	#rb none

Change 3130057 on 2016/09/19 by Jamie.Dale

	Fixing volatility and invalidation issues for text widgets

	#jira UE-33988
	#rb Nick.Darnell

Change 3130064 on 2016/09/19 by Jamie.Dale

	Changed mprof meta-data to allow unicode strings and updated ReadString to deal with them correctly

	#rb James.Hopkin

Change 3130233 on 2016/09/19 by Michael.Dupuis

	#jira UE-32914 Added missing args that the UI supported
	#rb Alexis.Matte

Change 3130265 on 2016/09/19 by Nick.Darnell

	Automation - Cleaning up some API items.

	#rb none

Change 3130378 on 2016/09/19 by Matt.Kuhlenschmidt

	Fix reentrancy saving assets while a prompt for checkout dialog is open

	#rb none

Change 3130398 on 2016/09/19 by Jamie.Dale

	Fixing UHT error when building

	#rb none

Change 3132101 on 2016/09/20 by Nick.Darnell

	UMG - Adding a toolbar option in the designer for the 'G' command, similar to 'Game View' in the level editor, it disables all the dashed lines / future editor visuals.

	#rb none

Change 3132110 on 2016/09/20 by Nick.Darnell

	PR #2792: ShowFlags for WidgetComponents (Contributed by projectgheist)

	#jira UE-13770

	#rb Nick.Darnell

Change 3132111 on 2016/09/20 by Nick.Darnell

	UMG - The retainer now embeds a virtual window into the focus path so that paths are resolved correctly.

	#rb none

Change 3132138 on 2016/09/20 by Michael.Dupuis

	#jira UE-30945 Added missing PostEditComponentMove after drag is finished
	#rb Alexis.Matte

Change 3132147 on 2016/09/20 by Michael.Dupuis

	#jira UE-30866 Fixed the filter to work properly
	#rb Alexis.Matte

Change 3132190 on 2016/09/20 by Matt.Kuhlenschmidt

	Fix static analysis warnings in this file

	#rb none

Change 3132231 on 2016/09/20 by Nick.Darnell

	Slate - Updating the material blend states to match what is expected of Slate rendering, which differs a lot from the scene renderer with the way it treats alpha.  This fixes translucent rendering with the retainer widget, users will need to set their materials to Alpha Composite though for it to behave as expected.

	#jira UE-33285
	#rb none

Change 3132255 on 2016/09/20 by Alex.Delesky

	#jira UE-36048 - TMap and TSet properties are now disallowed from adding more children through the Details panel when they contain the dfault value for a key or element. Reset to Default is also no longer allowed on a Map or Set child when it will result in a second default value existing within the container.

	#rb Matt.Kuhlenschmidt

Change 3132587 on 2016/09/20 by Mike.Fricker

	MIDI Plugin: Fixed a CIS error in shipping configuration (introduced in CL 3108604)
	#rb none
	#lockdown matt.kuhlenschmidt

Change 3132623 on 2016/09/20 by Matt.Kuhlenschmidt

	Fix crash opening the cooker settings

	https://jira.it.epicgames.net/browse/UE-36197

	#rb none
	#lockdown nick.darnell

Change 3133144 on 2016/09/20 by Nick.Darnell

	Build configuration for automation tests.

	#rb none
	#lockdown matt.kuhlenschmidt

Change 3133206 on 2016/09/20 by Matt.Kuhlenschmidt

	Fix default material on odin text

	#rb none
	#lockdown nick.darnell

Change 3133913 on 2016/09/21 by Nick.Darnell

	Back out revision 17 from //UE4/Dev-Editor/Engine/Source/Runtime/UMG/Private/Slate/SRetainerWidget.cpp

	#rb none
	#jira UE-36231
	#lockdown matt.kuhlenschmidt

[CL 3133983 by Matt Kuhlenschmidt in Main branch]
2016-09-21 10:07:18 -04:00

3228 lines
132 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "LevelEditor.h"
#include "Matinee/MatineeActor.h"
#include "Engine/LevelScriptBlueprint.h"
#include "LightingBuildOptions.h"
#include "EditorSupportDelegates.h"
#include "SLevelEditor.h"
#include "LevelEditorActions.h"
#include "SLevelViewport.h"
#include "EditorBuildUtils.h"
#include "Toolkits/AssetEditorManager.h"
#include "ScopedTransaction.h"
#include "Editor/Kismet/Public/BlueprintEditorModule.h"
#include "Editor/PropertyEditor/Public/PropertyEditorModule.h"
#include "Editor/ContentBrowser/Public/ContentBrowserModule.h"
#include "Editor/MainFrame/Public/MainFrame.h"
#include "Editor/UnrealEd/Private/GeomFitUtils.h"
#include "Editor/UnrealEd/Public/BSPOps.h"
#include "Editor/LevelEditor/Public/DlgDeltaTransform.h"
#include "Runtime/Engine/Classes/PhysicsEngine/BodySetup.h"
#include "Editor/NewLevelDialog/Public/NewLevelDialogModule.h"
#include "DelegateFilter.h"
#include "BlueprintUtilities.h"
#include "MRUFavoritesList.h"
#include "Editor/SceneOutliner/Private/SSocketChooser.h"
#include "SnappingUtils.h"
#include "Layers/ILayers.h"
#include "IPlacementModeModule.h"
#include "AssetSelection.h"
#include "IDocumentation.h"
#include "SourceCodeNavigation.h"
#include "Dialogs/DlgPickAssetPath.h"
#include "AssetToolsModule.h"
#include "BlueprintEditorUtils.h"
#include "KismetEditorUtilities.h"
#include "DesktopPlatformModule.h"
#include "EngineAnalytics.h"
#include "AnalyticsEventAttribute.h"
#include "IAnalyticsProvider.h"
#include "ReferenceViewer.h"
#include "ISizeMapModule.h"
#include "Developer/MeshUtilities/Public/MeshUtilities.h"
#include "EditorClassUtils.h"
#include "ComponentEditorUtils.h"
#include "EditorActorFolders.h"
#include "ActorPickerMode.h"
#include "EngineBuildSettings.h"
#include "HotReloadInterface.h"
#include "ISourceControlModule.h"
#include "SourceControlWindows.h"
#include "NotificationManager.h"
#include "SNotificationList.h"
#include "Engine/Selection.h"
#include "EngineUtils.h"
#include "Engine/StaticMeshActor.h"
#include "Engine/Polys.h"
#include "Components/LightComponent.h"
#include "Engine/StaticMesh.h"
#include "Engine/Light.h"
#include "Animation/SkeletalMeshActor.h"
#include "Animation/AnimSequence.h"
#include "Editor/KismetWidgets/Public/CreateBlueprintFromActorDialog.h"
#include "EditorProjectSettings.h"
#include "HierarchicalLODUtilities.h"
#include "HierarchicalLODUtilitiesModule.h"
#include "Engine/LODActor.h"
#include "AsyncResult.h"
#include "IPortalApplicationWindow.h"
#include "IPortalServiceLocator.h"
#include "MaterialShaderQualitySettings.h"
#include "IVREditorModule.h"
#include "ComponentRecreateRenderStateContext.h"
DEFINE_LOG_CATEGORY_STATIC(LevelEditorActions, Log, All);
#define LOCTEXT_NAMESPACE "LevelEditorActions"
const FName HotReloadModule("HotReload");
namespace LevelEditorActionsHelpers
{
/**
* If the passed in class is generated by a Blueprint, it will open that Blueprint, otherwise it will help the user create a Blueprint based on that class
*
* @param InWindowTitle The window title if the Blueprint needs to be created
* @param InBlueprintClass The class to create a Blueprint based on or to open if it is a Blueprint
* @param InLevelEditor When opening the Blueprint, this level editor is the parent window
* @param InNewBPName If we have to create a new BP, this is the suggested name
*/
UBlueprint* OpenOrCreateBlueprintFromClass(FText InWindowTitle, UClass* InBlueprintClass, TWeakPtr< SLevelEditor > InLevelEditor, FString InNewBPName = TEXT(""))
{
UBlueprint* Blueprint = NULL;
// If the current set class is not a Blueprint, we need to allow the user to create one to edit
if(!InBlueprintClass->ClassGeneratedBy)
{
Blueprint = FKismetEditorUtilities::CreateBlueprintFromClass(InWindowTitle, InBlueprintClass, InNewBPName);
}
else
{
Blueprint = Cast<UBlueprint>(InBlueprintClass->ClassGeneratedBy);
}
if(Blueprint)
{
// @todo Re-enable once world centric works
const bool bOpenWorldCentric = false;
FAssetEditorManager::Get().OpenEditorForAsset(
Blueprint,
bOpenWorldCentric ? EToolkitMode::WorldCentric : EToolkitMode::Standalone,
InLevelEditor.Pin() );
}
return Blueprint;
}
/** Check to see whether this world is a persistent world with a valid file on disk */
bool IsPersistentWorld(UWorld* InWorld)
{
UPackage* Pkg = InWorld ? InWorld->GetOutermost() : nullptr;
if (Pkg && FPackageName::IsValidLongPackageName(Pkg->GetName()))
{
FString FileName;
return FPackageName::DoesPackageExist(Pkg->GetName(), nullptr, &FileName);
}
return false;
}
}
bool FLevelEditorActionCallbacks::DefaultCanExecuteAction()
{
return FSlateApplication::Get().IsNormalExecution();
}
void FLevelEditorActionCallbacks::BrowseDocumentation()
{
IDocumentation::Get()->OpenHome(FDocumentationSourceInfo(TEXT("help_menu")));
}
void FLevelEditorActionCallbacks::BrowseAPIReference()
{
IDocumentation::Get()->OpenAPIHome();
}
void FLevelEditorActionCallbacks::BrowseCVars()
{
GEditor->Exec(GetWorld(), TEXT("help"));
}
void FLevelEditorActionCallbacks::BrowseViewportControls()
{
FString URL;
if (FUnrealEdMisc::Get().GetURL(TEXT("ViewportControlsURL"), URL))
{
FPlatformProcess::LaunchURL(*URL, NULL, NULL);
}
}
void FLevelEditorActionCallbacks::NewLevel()
{
if (GUnrealEd->WarnIfLightingBuildIsCurrentlyRunning())
{
return;
}
IMainFrameModule& MainFrameModule = FModuleManager::GetModuleChecked<IMainFrameModule>("MainFrame");
FString TemplateMapPackageName;
FNewLevelDialogModule& NewLevelDialogModule = FModuleManager::LoadModuleChecked<FNewLevelDialogModule>("NewLevelDialog");
if (NewLevelDialogModule.CreateAndShowNewLevelDialog(MainFrameModule.GetParentWindow(), TemplateMapPackageName))
{
// The new map screen will return a blank TemplateName if the user has selected to begin a new blank map
if (TemplateMapPackageName.IsEmpty())
{
GEditor->CreateNewMapForEditing();
}
else
{
// New map screen returned a non-empty TemplateName, so the user has selected to begin from a template map
bool TemplateFound = false;
// Search all template map folders for a match with TemplateName
const bool bIncludeReadOnlyRoots = true;
if ( FPackageName::IsValidLongPackageName(TemplateMapPackageName, bIncludeReadOnlyRoots) )
{
const FString MapPackageFilename = FPackageName::LongPackageNameToFilename(TemplateMapPackageName, FPackageName::GetMapPackageExtension());
if ( FPaths::FileExists(MapPackageFilename) )
{
// File found because the size check came back non-zero
TemplateFound = true;
// If there are any unsaved changes to the current level, see if the user wants to save those first.
bool bPromptUserToSave = true;
bool bSaveMapPackages = true;
bool bSaveContentPackages = false;
if ( FEditorFileUtils::SaveDirtyPackages(bPromptUserToSave, bSaveMapPackages, bSaveContentPackages) )
{
// Load the template map file - passes LoadAsTemplate==true making the
// level load into an untitled package that won't save over the template
FEditorFileUtils::LoadMap(*MapPackageFilename, /*bLoadAsTemplate=*/true);
}
}
}
if (!TemplateFound)
{
UE_LOG( LevelEditorActions, Warning, TEXT("Couldn't find template map package %s"), *TemplateMapPackageName);
GEditor->CreateNewMapForEditing();
}
}
}
}
bool FLevelEditorActionCallbacks::NewLevel_CanExecute()
{
return FSlateApplication::Get().IsNormalExecution() && !GLevelEditorModeTools().IsTracking();
}
void FLevelEditorActionCallbacks::OpenLevel()
{
FEditorFileUtils::LoadMap();
}
bool FLevelEditorActionCallbacks::OpenLevel_CanExecute()
{
return FSlateApplication::Get().IsNormalExecution() && !GLevelEditorModeTools().IsTracking();
}
void FLevelEditorActionCallbacks::DeltaTransform()
{
if (GUnrealEd->WarnIfLightingBuildIsCurrentlyRunning())
{
return;
}
FDlgDeltaTransform DeltaDialog;
const FDlgDeltaTransform::EResult MoveDialogResult = DeltaDialog.ShowModal();
}
void FLevelEditorActionCallbacks::OpenRecentFile( int32 RecentFileIndex )
{
IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>( "MainFrame" );
FMainMRUFavoritesList* RecentsAndFavorites = MainFrameModule.GetMRUFavoritesList();
// Save the name of the file we are attempting to load as VerifyFile/AskSaveChanges might rearrange the MRU list on us
const FString NewPackageName = RecentsAndFavorites->GetMRUItem( RecentFileIndex );
if( RecentsAndFavorites->VerifyMRUFile( RecentFileIndex ) )
{
// Prompt the user to save any outstanding changes.
if( FEditorFileUtils::SaveDirtyPackages(true, true, false) )
{
FString NewFilename;
if (FPackageName::TryConvertLongPackageNameToFilename(NewPackageName, NewFilename, FPackageName::GetMapPackageExtension()))
{
// Load the requested level.
FEditorFileUtils::LoadMap(NewFilename);
}
}
else
{
// something went wrong or the user pressed cancel. Return to the editor so the user doesn't lose their changes
}
}
}
void FLevelEditorActionCallbacks::OpenFavoriteFile( int32 FavoriteFileIndex )
{
IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>( "MainFrame" );
FMainMRUFavoritesList* MRUFavoritesList = MainFrameModule.GetMRUFavoritesList();
const FString PackageName = MRUFavoritesList->GetFavoritesItem( FavoriteFileIndex );
if( MRUFavoritesList->VerifyFavoritesFile( FavoriteFileIndex ) )
{
// Prompt the user to save any outstanding changes
if( FEditorFileUtils::SaveDirtyPackages(true, true, false) )
{
FString FileName;
if (FPackageName::TryConvertLongPackageNameToFilename(PackageName, FileName, FPackageName::GetMapPackageExtension()))
{
// Load the requested level.
FEditorFileUtils::LoadMap(FileName);
}
// Move the item to the head of the list
MRUFavoritesList->MoveFavoritesItemToHead(PackageName);
}
else
{
// something went wrong or the user pressed cancel. Return to the editor so the user doesn't lose their changes
}
}
}
void FLevelEditorActionCallbacks::ToggleFavorite()
{
IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>( "MainFrame" );
FMainMRUFavoritesList* MRUFavoritesList = MainFrameModule.GetMRUFavoritesList();
check( MRUFavoritesList );
if (LevelEditorActionsHelpers::IsPersistentWorld(GetWorld()))
{
const FString PackageName = GetWorld()->GetOutermost()->GetName();
// If the map was already favorited, remove it from the favorites
if ( MRUFavoritesList->ContainsFavoritesItem(PackageName) )
{
MRUFavoritesList->RemoveFavoritesItem(PackageName);
}
// If the map was not already favorited, add it to the favorites
else
{
MRUFavoritesList->AddFavoritesItem(PackageName);
}
}
}
void FLevelEditorActionCallbacks::RemoveFavorite( int32 FavoriteFileIndex )
{
IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>( "MainFrame" );
FMainMRUFavoritesList* MRUFavoritesList = MainFrameModule.GetMRUFavoritesList();
const FString PackageName = MRUFavoritesList->GetFavoritesItem( FavoriteFileIndex );
if( MRUFavoritesList->VerifyFavoritesFile( FavoriteFileIndex ) )
{
if ( MRUFavoritesList->ContainsFavoritesItem(PackageName) )
{
MRUFavoritesList->RemoveFavoritesItem(PackageName);
}
}
}
bool FLevelEditorActionCallbacks::ToggleFavorite_CanExecute()
{
// Disable the favorites button if the map isn't associated to a file yet (new map, never before saved, etc.)
return LevelEditorActionsHelpers::IsPersistentWorld(GetWorld());
}
bool FLevelEditorActionCallbacks::ToggleFavorite_IsChecked()
{
bool bIsChecked = false;
if (LevelEditorActionsHelpers::IsPersistentWorld(GetWorld()))
{
const FString PackageName = GetWorld()->GetOutermost()->GetName();
IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>( "MainFrame" );
bIsChecked = MainFrameModule.GetMRUFavoritesList()->ContainsFavoritesItem(PackageName);
}
return bIsChecked;
}
bool FLevelEditorActionCallbacks::CanSaveWorld()
{
return FSlateApplication::Get().IsNormalExecution() && (!GUnrealEd || !GUnrealEd->GetPackageAutoSaver().IsAutoSaving());
}
void FLevelEditorActionCallbacks::Save()
{
FEditorFileUtils::SaveCurrentLevel();
}
void FLevelEditorActionCallbacks::SaveAs()
{
FString SavedFilename;
bool bSaved = FEditorFileUtils::SaveLevelAs( GetWorld()->PersistentLevel, &SavedFilename );
if (bSaved)
{
FEditorFileUtils::LoadMap(SavedFilename);
}
}
void FLevelEditorActionCallbacks::SaveAllLevels()
{
const bool bPromptUserToSave = false;
const bool bSaveMapPackages = true;
const bool bSaveContentPackages = false;
const bool bFastSave = false;
FEditorFileUtils::SaveDirtyPackages( bPromptUserToSave, bSaveMapPackages, bSaveContentPackages, bFastSave );
}
void FLevelEditorActionCallbacks::ImportScene_Clicked()
{
FEditorFileUtils::Import();
}
void FLevelEditorActionCallbacks::ExportAll_Clicked()
{
const bool bExportSelectedActorsOnly = false;
FEditorFileUtils::Export( bExportSelectedActorsOnly );
}
void FLevelEditorActionCallbacks::ExportSelected_Clicked()
{
const bool bExportSelectedActorsOnly = true;
FEditorFileUtils::Export( bExportSelectedActorsOnly );
}
bool FLevelEditorActionCallbacks::ExportSelected_CanExecute()
{
// Only enable the option if at least one thing is selected and its not a worldsettings
return GEditor->GetSelectedActors()->Num() > 0 && !GEditor->IsWorldSettingsSelected();
}
void FLevelEditorActionCallbacks::AttachToActor(AActor* ParentActorPtr)
{
USceneComponent* ComponentWithSockets = NULL;
//@TODO: Should create a menu for each component that contains sockets, or have some form of disambiguation within the menu (like a fully qualified path)
// Instead, we currently only display the sockets on the root component
if (ParentActorPtr != NULL)
{
if (USceneComponent* RootComponent = Cast<USceneComponent>(ParentActorPtr->GetRootComponent()))
{
if (RootComponent->HasAnySockets())
{
ComponentWithSockets = RootComponent;
}
}
}
// Show socket chooser if we have sockets to select
if (ComponentWithSockets != NULL)
{
FLevelEditorModule& LevelEditorModule = FModuleManager::GetModuleChecked<FLevelEditorModule>( "LevelEditor");
TSharedPtr< ILevelEditor > LevelEditor = LevelEditorModule.GetFirstLevelEditor();
// Create as context menu
FSlateApplication::Get().PushMenu(
LevelEditor.ToSharedRef(),
FWidgetPath(),
SNew(SSocketChooserPopup)
.SceneComponent( ComponentWithSockets )
.OnSocketChosen_Static( &FLevelEditorActionCallbacks::AttachToSocketSelection, ParentActorPtr ),
FSlateApplication::Get().GetCursorPos(),
FPopupTransitionEffect( FPopupTransitionEffect::ContextMenu )
);
}
else
{
AttachToSocketSelection( NAME_None, ParentActorPtr );
}
}
void FLevelEditorActionCallbacks::AttachToSocketSelection(const FName SocketName, AActor* ParentActorPtr)
{
FSlateApplication::Get().DismissAllMenus();
if(ParentActorPtr != NULL)
{
// Attach each child
FScopedTransaction Transaction(LOCTEXT("AttachActors", "Attach actors"));
bool bAttached = false;
for ( FSelectionIterator It( GEditor->GetSelectedActorIterator() ) ; It ; ++It )
{
AActor* Actor = Cast<AActor>( *It );
if (GEditor->CanParentActors(ParentActorPtr, Actor))
{
bAttached = true;
GEditor->ParentActors(ParentActorPtr, Actor, SocketName);
}
}
if (!bAttached)
{
Transaction.Cancel();
}
}
}
void FLevelEditorActionCallbacks::SetMaterialQualityLevel( EMaterialQualityLevel::Type NewQualityLevel )
{
auto* Settings = GetMutableDefault<UEditorPerProjectUserSettings>();
Settings->MaterialQualityLevel = NewQualityLevel;
Settings->PostEditChange();
//Ensure the material quality cvar is also set.
static IConsoleVariable* MaterialQualityLevelVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.MaterialQualityLevel"));
MaterialQualityLevelVar->Set(NewQualityLevel, ECVF_SetByScalability);
GUnrealEd->RedrawAllViewports();
}
bool FLevelEditorActionCallbacks::IsMaterialQualityLevelChecked( EMaterialQualityLevel::Type TestQualityLevel )
{
static const auto MaterialQualityLevelVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.MaterialQualityLevel"));
EMaterialQualityLevel::Type MaterialQualityLevel = (EMaterialQualityLevel::Type)FMath::Clamp(MaterialQualityLevelVar->GetValueOnGameThread(), 0, (int32)EMaterialQualityLevel::Num-1);
return TestQualityLevel == MaterialQualityLevel;
}
void FLevelEditorActionCallbacks::SetPreviewPlatform(FName MaterialQualityPlatform)
{
UMaterialShaderQualitySettings* MaterialShaderQualitySettings = UMaterialShaderQualitySettings::Get();
const FName InitialPreviewPlatform = MaterialShaderQualitySettings->GetPreviewPlatform();
const ERHIFeatureLevel::Type InitialFeatureLevel = GetWorld()->FeatureLevel;
MaterialShaderQualitySettings->SetPreviewPlatform(MaterialQualityPlatform);
SetFeatureLevelPreview(ERHIFeatureLevel::ES2);
if (
// Rebuild materials if the preview platform has changed.
InitialPreviewPlatform != MaterialQualityPlatform
// If the feature level changed then materials have been rebuilt already.
&& InitialFeatureLevel == ERHIFeatureLevel::ES2 )
{
FGlobalComponentRecreateRenderStateContext Recreate;
FlushRenderingCommands();
UMaterial::AllMaterialsCacheResourceShadersForRendering();
UMaterialInstance::AllMaterialsCacheResourceShadersForRendering();
}
}
bool FLevelEditorActionCallbacks::IsPreviewPlatformChecked(FName MaterialQualityPlatform)
{
const FName& PreviewPlatform = UMaterialShaderQualitySettings::Get()->GetPreviewPlatform();
return PreviewPlatform == MaterialQualityPlatform && ERHIFeatureLevel::ES2 == GetWorld()->FeatureLevel;
}
void FLevelEditorActionCallbacks::SetFeatureLevelPreview(ERHIFeatureLevel::Type InPreviewFeatureLevel)
{
// Record this feature level as we want to use it for all subsequent level creation and loading
GEditor->DefaultWorldFeatureLevel = InPreviewFeatureLevel;
GetWorld()->ChangeFeatureLevel(InPreviewFeatureLevel);
// Update any currently running PIE sessions.
for (TObjectIterator<UWorld> It; It; ++It)
{
UWorld* ItWorld = *It;
if (ItWorld->WorldType == EWorldType::PIE)
{
ItWorld->ChangeFeatureLevel(InPreviewFeatureLevel);
}
}
GUnrealEd->RedrawAllViewports();
}
bool FLevelEditorActionCallbacks::IsFeatureLevelPreviewChecked(ERHIFeatureLevel::Type InPreviewFeatureLevel)
{
return InPreviewFeatureLevel == GetWorld()->FeatureLevel;
}
void FLevelEditorActionCallbacks::ConfigureLightingBuildOptions( const FLightingBuildOptions& Options )
{
GConfig->SetBool( TEXT("LightingBuildOptions"), TEXT("OnlyBuildSelected"), Options.bOnlyBuildSelected, GEditorPerProjectIni );
GConfig->SetBool( TEXT("LightingBuildOptions"), TEXT("OnlyBuildCurrentLevel"), Options.bOnlyBuildCurrentLevel, GEditorPerProjectIni );
GConfig->SetBool( TEXT("LightingBuildOptions"), TEXT("OnlyBuildSelectedLevels"),Options.bOnlyBuildSelectedLevels, GEditorPerProjectIni );
GConfig->SetBool( TEXT("LightingBuildOptions"), TEXT("OnlyBuildVisibility"), Options.bOnlyBuildVisibility, GEditorPerProjectIni );
}
void FLevelEditorActionCallbacks::Build_Execute()
{
// Reset build options
ConfigureLightingBuildOptions( FLightingBuildOptions() );
// Build everything!
FEditorBuildUtils::EditorBuild( GetWorld(), FBuildOptions::BuildAll );
}
void FLevelEditorActionCallbacks::BuildAndSubmitToSourceControl_Execute()
{
FLevelEditorModule& LevelEditorModule = FModuleManager::GetModuleChecked<FLevelEditorModule>( TEXT("LevelEditor") );
LevelEditorModule.SummonBuildAndSubmit();
}
void FLevelEditorActionCallbacks::BuildLightingOnly_Execute()
{
// Reset build options
ConfigureLightingBuildOptions( FLightingBuildOptions() );
// Build lighting!
const bool bAllowLightingDialog = false;
FEditorBuildUtils::EditorBuild( GetWorld(), FBuildOptions::BuildLighting, bAllowLightingDialog );
}
bool FLevelEditorActionCallbacks::BuildLighting_CanExecute()
{
static const auto AllowStaticLightingVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.AllowStaticLighting"));
const bool bAllowStaticLighting = (!AllowStaticLightingVar || AllowStaticLightingVar->GetValueOnGameThread() != 0);
return bAllowStaticLighting;
}
void FLevelEditorActionCallbacks::BuildReflectionCapturesOnly_Execute()
{
GEditor->UpdateReflectionCaptures();
}
void FLevelEditorActionCallbacks::BuildLightingOnly_VisibilityOnly_Execute()
{
// Configure build options
FLightingBuildOptions LightingBuildOptions;
LightingBuildOptions.bOnlyBuildVisibility = true;
ConfigureLightingBuildOptions( LightingBuildOptions );
// Build lighting!
const bool bAllowLightingDialog = false;
FEditorBuildUtils::EditorBuild( GetWorld(), FBuildOptions::BuildLighting, bAllowLightingDialog );
// Reset build options
ConfigureLightingBuildOptions( FLightingBuildOptions() );
}
bool FLevelEditorActionCallbacks::LightingBuildOptions_UseErrorColoring_IsChecked()
{
bool bUseErrorColoring = false;
GConfig->GetBool(TEXT("LightingBuildOptions"), TEXT("UseErrorColoring"), bUseErrorColoring, GEditorPerProjectIni);
return bUseErrorColoring;
}
void FLevelEditorActionCallbacks::LightingBuildOptions_UseErrorColoring_Toggled()
{
bool bUseErrorColoring = false;
GConfig->GetBool( TEXT("LightingBuildOptions"), TEXT("UseErrorColoring"), bUseErrorColoring, GEditorPerProjectIni );
GConfig->SetBool( TEXT("LightingBuildOptions"), TEXT("UseErrorColoring"), !bUseErrorColoring, GEditorPerProjectIni );
}
bool FLevelEditorActionCallbacks::LightingBuildOptions_ShowLightingStats_IsChecked()
{
bool bShowLightingBuildInfo = false;
GConfig->GetBool(TEXT("LightingBuildOptions"), TEXT("ShowLightingBuildInfo"), bShowLightingBuildInfo, GEditorPerProjectIni);
return bShowLightingBuildInfo;
}
void FLevelEditorActionCallbacks::LightingBuildOptions_ShowLightingStats_Toggled()
{
bool bShowLightingBuildInfo = false;
GConfig->GetBool( TEXT("LightingBuildOptions"), TEXT("ShowLightingBuildInfo"), bShowLightingBuildInfo, GEditorPerProjectIni );
GConfig->SetBool( TEXT("LightingBuildOptions"), TEXT("ShowLightingBuildInfo"), !bShowLightingBuildInfo, GEditorPerProjectIni );
}
void FLevelEditorActionCallbacks::BuildGeometryOnly_Execute()
{
// Build geometry!
FEditorBuildUtils::EditorBuild( GetWorld(), FBuildOptions::BuildVisibleGeometry );
}
void FLevelEditorActionCallbacks::BuildGeometryOnly_OnlyCurrentLevel_Execute()
{
// Build geometry (current level)!
FEditorBuildUtils::EditorBuild( GetWorld(), FBuildOptions::BuildGeometry );
}
void FLevelEditorActionCallbacks::BuildPathsOnly_Execute()
{
// Build paths!
FEditorBuildUtils::EditorBuild( GetWorld(), FBuildOptions::BuildAIPaths );
}
void FLevelEditorActionCallbacks::BuildLODsOnly_Execute()
{
// Build HLOD
FEditorBuildUtils::EditorBuild(GetWorld(), FBuildOptions::BuildHierarchicalLOD);
}
void FLevelEditorActionCallbacks::BuildTextureStreamingOnly_Execute()
{
FEditorBuildUtils::EditorBuildTextureStreaming(GetWorld());
}
bool FLevelEditorActionCallbacks::IsLightingQualityChecked( ELightingBuildQuality TestQuality )
{
int32 CurrentQualityLevel;
GConfig->GetInt(TEXT("LightingBuildOptions"), TEXT("QualityLevel"), CurrentQualityLevel, GEditorPerProjectIni);
return TestQuality == CurrentQualityLevel;
}
void FLevelEditorActionCallbacks::SetLightingQuality( ELightingBuildQuality NewQuality )
{
GConfig->SetInt(TEXT("LightingBuildOptions"), TEXT("QualityLevel"), (int32)NewQuality, GEditorPerProjectIni);
}
float FLevelEditorActionCallbacks::GetLightingDensityIdeal()
{
return ( GEngine->IdealLightMapDensity );
}
void FLevelEditorActionCallbacks::SetLightingDensityIdeal( float Value )
{
GEngine->IdealLightMapDensity = Value;
// We need to make sure that Maximum is always slightly larger than ideal...
if (GEngine->IdealLightMapDensity >= GEngine->MaxLightMapDensity - 0.01f)
{
SetLightingDensityMaximum( GEngine->IdealLightMapDensity + 0.01f );
}
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
}
float FLevelEditorActionCallbacks::GetLightingDensityMaximum()
{
return ( GEngine->MaxLightMapDensity );
}
void FLevelEditorActionCallbacks::SetLightingDensityMaximum( float Value )
{
GEngine->MaxLightMapDensity = Value;
// We need to make sure that Maximum is always slightly larger than ideal...
if (GEngine->MaxLightMapDensity <= GEngine->IdealLightMapDensity + 0.01f)
{
GEngine->MaxLightMapDensity = GEngine->IdealLightMapDensity + 0.01f;
}
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
}
float FLevelEditorActionCallbacks::GetLightingDensityColorScale()
{
return ( GEngine->RenderLightMapDensityColorScale );
}
void FLevelEditorActionCallbacks::SetLightingDensityColorScale( float Value )
{
GEngine->RenderLightMapDensityColorScale = Value;
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
}
float FLevelEditorActionCallbacks::GetLightingDensityGrayscaleScale()
{
return ( GEngine->RenderLightMapDensityGrayscaleScale );
}
void FLevelEditorActionCallbacks::SetLightingDensityGrayscaleScale( float Value )
{
GEngine->RenderLightMapDensityGrayscaleScale = Value;
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
}
void FLevelEditorActionCallbacks::SetLightingDensityRenderGrayscale()
{
GEngine->bRenderLightMapDensityGrayscale = !GEngine->bRenderLightMapDensityGrayscale;
GEngine->SaveConfig();
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
}
bool FLevelEditorActionCallbacks::IsLightingDensityRenderGrayscaleChecked()
{
return GEngine->bRenderLightMapDensityGrayscale;
}
void FLevelEditorActionCallbacks::SetLightingResolutionStaticMeshes( ECheckBoxState NewCheckedState )
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
Settings.bStaticMeshes = ( NewCheckedState == ECheckBoxState::Checked );
}
ECheckBoxState FLevelEditorActionCallbacks::IsLightingResolutionStaticMeshesChecked()
{
return ( FLightmapResRatioAdjustSettings::Get().bStaticMeshes ? ECheckBoxState::Checked : ECheckBoxState::Unchecked );
}
void FLevelEditorActionCallbacks::SetLightingResolutionBSPSurfaces( ECheckBoxState NewCheckedState )
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
Settings.bBSPSurfaces = ( NewCheckedState == ECheckBoxState::Checked );
}
ECheckBoxState FLevelEditorActionCallbacks::IsLightingResolutionBSPSurfacesChecked()
{
return ( FLightmapResRatioAdjustSettings::Get().bBSPSurfaces ? ECheckBoxState::Checked : ECheckBoxState::Unchecked );
}
void FLevelEditorActionCallbacks::SetLightingResolutionLevel( FLightmapResRatioAdjustSettings::AdjustLevels NewLevel )
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
Settings.LevelOptions = NewLevel;
}
bool FLevelEditorActionCallbacks::IsLightingResolutionLevelChecked( FLightmapResRatioAdjustSettings::AdjustLevels TestLevel )
{
return ( FLightmapResRatioAdjustSettings::Get().LevelOptions == TestLevel );
}
void FLevelEditorActionCallbacks::SetLightingResolutionSelectedObjectsOnly()
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
Settings.bSelectedObjectsOnly = !Settings.bSelectedObjectsOnly;
}
bool FLevelEditorActionCallbacks::IsLightingResolutionSelectedObjectsOnlyChecked()
{
return FLightmapResRatioAdjustSettings::Get().bSelectedObjectsOnly;
}
float FLevelEditorActionCallbacks::GetLightingResolutionMinSMs()
{
return static_cast<float>( FLightmapResRatioAdjustSettings::Get().Min_StaticMeshes );
}
void FLevelEditorActionCallbacks::SetLightingResolutionMinSMs( float Value )
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
Settings.Min_StaticMeshes = static_cast<int32>( Value );
}
float FLevelEditorActionCallbacks::GetLightingResolutionMaxSMs()
{
return static_cast<float>( FLightmapResRatioAdjustSettings::Get().Max_StaticMeshes );
}
void FLevelEditorActionCallbacks::SetLightingResolutionMaxSMs( float Value )
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
Settings.Max_StaticMeshes = static_cast<int32>( Value );
}
float FLevelEditorActionCallbacks::GetLightingResolutionMinBSPs()
{
return static_cast<float>( FLightmapResRatioAdjustSettings::Get().Min_BSPSurfaces );
}
void FLevelEditorActionCallbacks::SetLightingResolutionMinBSPs( float Value )
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
Settings.Min_BSPSurfaces = static_cast<int32>( Value );
}
float FLevelEditorActionCallbacks::GetLightingResolutionMaxBSPs()
{
return static_cast<float>( FLightmapResRatioAdjustSettings::Get().Max_BSPSurfaces );
}
void FLevelEditorActionCallbacks::SetLightingResolutionMaxBSPs( float Value )
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
Settings.Max_BSPSurfaces = static_cast<int32>( Value );
}
int32 FLevelEditorActionCallbacks::GetLightingResolutionRatio()
{
return FMath::RoundToInt(FLightmapResRatioAdjustSettings::Get().Ratio * 100.0f);
}
void FLevelEditorActionCallbacks::SetLightingResolutionRatio( int32 Value )
{
FLightmapResRatioAdjustSettings& Settings = FLightmapResRatioAdjustSettings::Get();
const float NewValue = Value / 100.0f;
if ( Settings.Ratio != NewValue )
{
Settings.Ratio = NewValue;
Settings.ApplyRatioAdjustment();
}
}
void FLevelEditorActionCallbacks::SetLightingResolutionRatioCommit( int32 Value, ETextCommit::Type CommitInfo)
{
if ((CommitInfo == ETextCommit::OnEnter) || (CommitInfo == ETextCommit::OnUserMovedFocus))
{
SetLightingResolutionRatio( Value );
}
}
void FLevelEditorActionCallbacks::ShowLightingStaticMeshInfo()
{
if (GUnrealEd)
{
GUnrealEd->ShowLightingStaticMeshInfoWindow();
}
}
void FLevelEditorActionCallbacks::ShowSceneStats()
{
if (GUnrealEd)
{
GUnrealEd->OpenSceneStatsWindow();
}
}
void FLevelEditorActionCallbacks::ShowTextureStats()
{
if (GUnrealEd)
{
GUnrealEd->OpenTextureStatsWindow();
}
}
void FLevelEditorActionCallbacks::MapCheck_Execute()
{
GEditor->Exec( GetWorld(), TEXT("MAP CHECK") );
}
bool FLevelEditorActionCallbacks::CanShowSourceCodeActions()
{
if (GEditor)
{
// Don't allow hot reloading if we're running networked PIE instances
// The reason, is it's fairly complicated to handle the re-wiring that needs to happen when we re-instance objects like player controllers, possessed pawns, etc...
const TIndirectArray<FWorldContext>& WorldContextList = GEditor->GetWorldContexts();
for (const FWorldContext& WorldContext : WorldContextList)
{
if (WorldContext.World() && WorldContext.World()->WorldType == EWorldType::PIE && WorldContext.World()->NetDriver)
{
return false;
}
}
}
IHotReloadInterface& HotReloadSupport = FModuleManager::LoadModuleChecked<IHotReloadInterface>(HotReloadModule);
// If there is at least one loaded game module, source code actions should be available.
return HotReloadSupport.IsAnyGameModuleLoaded();
}
void FLevelEditorActionCallbacks::RecompileGameCode_Clicked()
{
// Don't allow a recompile while already compiling!
IHotReloadInterface& HotReloadSupport = FModuleManager::LoadModuleChecked<IHotReloadInterface>(HotReloadModule);
if( !HotReloadSupport.IsCurrentlyCompiling() )
{
// Don't wait -- we want compiling to happen asynchronously
const bool bWaitForCompletion = false;
HotReloadSupport.DoHotReloadFromEditor(bWaitForCompletion);
}
}
bool FLevelEditorActionCallbacks::Recompile_CanExecute()
{
// We're not able to recompile if a compile is already in progress!
IHotReloadInterface& HotReloadSupport = FModuleManager::LoadModuleChecked<IHotReloadInterface>(HotReloadModule);
return !HotReloadSupport.IsCurrentlyCompiling() && !(FApp::GetEngineIsPromotedBuild() && FEngineBuildSettings::IsPerforceBuild());
}
void FLevelEditorActionCallbacks::ConnectToSourceControl_Clicked()
{
// Show login window regardless of current status - its useful as a shortcut to change settings.
ISourceControlModule& SourceControlModule = ISourceControlModule::Get();
SourceControlModule.ShowLoginDialog(FSourceControlLoginClosed(), ELoginWindowMode::Modeless, EOnLoginWindowStartup::PreserveProvider);
}
bool FLevelEditorActionCallbacks::CheckOutModifiedFiles_CanExecute()
{
ISourceControlModule& SourceControlModule = ISourceControlModule::Get();
if (ISourceControlModule::Get().IsEnabled() &&
ISourceControlModule::Get().GetProvider().IsAvailable())
{
TArray<UPackage*> PackagesToSave;
FEditorFileUtils::GetDirtyWorldPackages(PackagesToSave);
FEditorFileUtils::GetDirtyContentPackages(PackagesToSave);
return PackagesToSave.Num() > 0;
}
return false;
}
void FLevelEditorActionCallbacks::CheckOutModifiedFiles_Clicked()
{
TArray<UPackage*> PackagesToSave;
FEditorFileUtils::GetDirtyWorldPackages(PackagesToSave);
FEditorFileUtils::GetDirtyContentPackages(PackagesToSave);
const bool bCheckDirty = true;
const bool bPromptUserToSave = false;
FEditorFileUtils::PromptForCheckoutAndSave(PackagesToSave, bCheckDirty, bPromptUserToSave);
}
bool FLevelEditorActionCallbacks::SubmitToSourceControl_CanExecute()
{
ISourceControlModule& SourceControlModule = ISourceControlModule::Get();
return ISourceControlModule::Get().IsEnabled() &&
ISourceControlModule::Get().GetProvider().IsAvailable() &&
FSourceControlWindows::CanChoosePackagesToCheckIn();
}
void FLevelEditorActionCallbacks::SubmitToSourceControl_Clicked()
{
FSourceControlWindows::ChoosePackagesToCheckIn();
}
void FLevelEditorActionCallbacks::GoToCodeForActor_Clicked()
{
const auto& SelectedActorInfo = AssetSelectionUtils::GetSelectedActorInfo();
if( SelectedActorInfo.SelectionClass != nullptr )
{
FString ClassHeaderPath;
if( FSourceCodeNavigation::FindClassHeaderPath( SelectedActorInfo.SelectionClass, ClassHeaderPath ) && IFileManager::Get().FileSize( *ClassHeaderPath ) != INDEX_NONE )
{
FString AbsoluteHeaderPath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*ClassHeaderPath);
FSourceCodeNavigation::OpenSourceFile( AbsoluteHeaderPath );
}
}
}
void FLevelEditorActionCallbacks::GoToDocsForActor_Clicked()
{
const auto& SelectedActorInfo = AssetSelectionUtils::GetSelectedActorInfo();
if( SelectedActorInfo.SelectionClass != nullptr )
{
FString DocumentationLink = FEditorClassUtils::GetDocumentationLink(SelectedActorInfo.SelectionClass);
if (!DocumentationLink.IsEmpty())
{
IDocumentation::Get()->Open( DocumentationLink, FDocumentationSourceInfo(TEXT("rightclick_viewdoc")) );
}
}
}
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::ViewSizeMap_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());
}
}
ISizeMapModule::Get().InvokeSizeMapTab(ViewableObjects);
}
}
}
bool FLevelEditorActionCallbacks::CanViewSizeMap()
{
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 )
{
TArray< UObject* > ReferencedAssets;
const bool bIgnoreOtherAssetsIfBPReferenced = true;
GEditor->GetReferencedAssetsForEditorSelection( ReferencedAssets, bIgnoreOtherAssetsIfBPReferenced );
bool bShouldOpenEditors = (ReferencedAssets.Num() == 1);
if (ReferencedAssets.Num() > 1)
{
if (bConfirmMultiple)
{
int32 Response = FMessageDialog::Open(
EAppMsgType::YesNo,
LOCTEXT("OpenAllAssetEditors", "There is more than one referenced asset in the selection. Do you want to open them all for editing?")
);
bShouldOpenEditors = (Response == EAppReturnType::Yes);
}
else
{
bShouldOpenEditors = true;
}
}
if (bShouldOpenEditors)
{
// Clear focus so the level viewport can receive its focus lost call (and clear pending keyup events which wouldn't arrive)
FSlateApplication::Get().ClearKeyboardFocus(EFocusCause::WindowActivate);
auto LevelEditorSharedPtr = LevelEditor.Pin();
if (LevelEditorSharedPtr.IsValid())
{
for (auto Asset : ReferencedAssets)
{
FAssetEditorManager::Get().OpenEditorForAsset(Asset, ToolkitMode, LevelEditorSharedPtr);
}
}
}
}
}
void FLevelEditorActionCallbacks::LockActorMovement_Clicked()
{
GEditor->ToggleSelectedActorMovementLock();
}
void FLevelEditorActionCallbacks::DetachActor_Clicked()
{
GEditor->DetachSelectedActors();
}
void FLevelEditorActionCallbacks::AttachSelectedActors()
{
GUnrealEd->AttachSelectedActors();
}
void FLevelEditorActionCallbacks::AttachActorIteractive()
{
if(GUnrealEd->GetSelectedActorCount())
{
FActorPickerModeModule& ActorPickerMode = FModuleManager::Get().GetModuleChecked<FActorPickerModeModule>("ActorPickerMode");
ActorPickerMode.BeginActorPickingMode(
FOnGetAllowedClasses(),
FOnShouldFilterActor::CreateStatic(&FLevelEditorActionCallbacks::IsAttachableActor),
FOnActorSelected::CreateStatic(&FLevelEditorActionCallbacks::AttachToActor)
);
}
}
bool FLevelEditorActionCallbacks::IsAttachableActor( const AActor* const ParentActor )
{
for ( FSelectionIterator It( GEditor->GetSelectedActorIterator() ) ; It ; ++It )
{
AActor* Actor = static_cast<AActor*>( *It );
if (!GEditor->CanParentActors(ParentActor, Actor))
{
return false;
}
USceneComponent* ChildRoot = Actor->GetRootComponent();
USceneComponent* ParentRoot = ParentActor->GetRootComponent();
if (ChildRoot != nullptr && ParentRoot != nullptr && ChildRoot->IsAttachedTo(ParentRoot))
{
return false;
}
}
return true;
}
void FLevelEditorActionCallbacks::CreateNewOutlinerFolder_Clicked()
{
const FName NewFolderName = FActorFolders::Get().GetDefaultFolderNameForSelection(*GetWorld());
FActorFolders::Get().CreateFolderContainingSelection(*GetWorld(), NewFolderName);
}
void FLevelEditorActionCallbacks::GoHere_Clicked( const FVector* Point )
{
if( GCurrentLevelEditingViewportClient )
{
FVector ZoomToPoint;
if( !Point )
{
FSceneViewFamilyContext ViewFamily(FSceneViewFamily::ConstructionValues(
GCurrentLevelEditingViewportClient->Viewport,
GCurrentLevelEditingViewportClient->GetWorld()->Scene,
GCurrentLevelEditingViewportClient->EngineShowFlags)
.SetRealtimeUpdate(true));
FSceneView* SceneView = GCurrentLevelEditingViewportClient->CalcSceneView(&ViewFamily);
if(SceneView)
{
FIntPoint MousePosition;
FVector WorldOrigin;
FVector WorldDirection;
GCurrentLevelEditingViewportClient->Viewport->GetMousePos(MousePosition);
SceneView->DeprojectFVector2D(MousePosition, WorldOrigin, WorldDirection);
FHitResult HitResult;
static FName FocusOnPoint = FName(TEXT("FocusOnPoint"));
FCollisionQueryParams LineParams(FocusOnPoint, true);
if(GCurrentLevelEditingViewportClient->GetWorld()->LineTraceSingleByObjectType(HitResult, WorldOrigin, WorldOrigin + WorldDirection * HALF_WORLD_MAX, FCollisionObjectQueryParams(ECC_WorldStatic), LineParams))
{
ZoomToPoint = HitResult.ImpactPoint;
}
}
}
else
{
ZoomToPoint = *Point;
}
const float PushOutSize = 500;
FBox BoundingBox(ZoomToPoint-PushOutSize, ZoomToPoint+PushOutSize);
GCurrentLevelEditingViewportClient->FocusViewportOnBox(BoundingBox);
}
}
bool FLevelEditorActionCallbacks::LockActorMovement_IsChecked()
{
return GEditor->HasLockedActors();
}
void FLevelEditorActionCallbacks::AddActor_Clicked( UActorFactory* ActorFactory, FAssetData AssetData, bool bUsePlacement )
{
UObject* Object = AssetData.GetAsset();
if(bUsePlacement && IPlacementModeModule::IsAvailable() && Object != NULL)
{
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
LevelEditorModule.FocusViewport();
// Make sure we're in actor placement mode
GLevelEditorModeTools().ActivateMode(FBuiltinEditorModes::EM_Placement);
TArray<UObject*> AssetsToPlace;
AssetsToPlace.Add(Object);
auto* PlacementMode = GLevelEditorModeTools().GetActiveModeTyped<IPlacementMode>(FBuiltinEditorModes::EM_Placement);
PlacementMode->StartPlacing(AssetsToPlace, ActorFactory);
}
else
{
FLevelEditorActionCallbacks::AddActor(ActorFactory, AssetData, NULL);
}
}
AActor* FLevelEditorActionCallbacks::AddActor( UActorFactory* ActorFactory, const FAssetData& AssetData, const FTransform* ActorTransform )
{
AActor* NewActor = GEditor->UseActorFactory( ActorFactory, AssetData, ActorTransform );
if ( NewActor != NULL && IPlacementModeModule::IsAvailable() )
{
IPlacementModeModule::Get().AddToRecentlyPlaced( AssetData.GetAsset(), ActorFactory );
}
return NewActor;
}
void FLevelEditorActionCallbacks::AddActorFromClass_Clicked( UClass* ActorClass )
{
FLevelEditorActionCallbacks::AddActorFromClass(ActorClass);
}
AActor* FLevelEditorActionCallbacks::AddActorFromClass( UClass* ActorClass )
{
AActor* NewActor = NULL;
if ( ActorClass )
{
// Look for an actor factory capable of creating actors of that type.
UActorFactory* ActorFactory = GEditor->FindActorFactoryForActorClass( ActorClass );
if( ActorFactory )
{
NewActor = GEditor->UseActorFactoryOnCurrentSelection( ActorFactory, nullptr );
if ( NewActor != NULL && IPlacementModeModule::IsAvailable() )
{
IPlacementModeModule::Get().AddToRecentlyPlaced( ActorClass, ActorFactory );
}
}
else
{
// No actor factory was found; use SpawnActor instead.
GUnrealEd->Exec( GetWorld(), *FString::Printf( TEXT("ACTOR ADD CLASS=%s"), *ActorClass->GetName() ) );
}
}
return NewActor;
}
void FLevelEditorActionCallbacks::ReplaceActors_Clicked( UActorFactory* ActorFactory, FAssetData AssetData )
{
FLevelEditorActionCallbacks::ReplaceActors(ActorFactory, AssetData);
}
AActor* FLevelEditorActionCallbacks::ReplaceActors( UActorFactory* ActorFactory, const FAssetData& AssetData )
{
AActor* NewActor = NULL;
// Have a first stab at filling in the factory properties.
FText ErrorMessage;
if( ActorFactory->CanCreateActorFrom( AssetData, ErrorMessage ) )
{
// Replace all selected actors with actors created from the specified factory
GEditor->ReplaceSelectedActors( ActorFactory, AssetData );
if ( IPlacementModeModule::IsAvailable() )
{
IPlacementModeModule::Get().AddToRecentlyPlaced( AssetData.GetAsset(), ActorFactory );
}
}
else
{
FNotificationInfo ErrorNotification( ErrorMessage );
ErrorNotification.Image = FEditorStyle::GetBrush(TEXT("MessageLog.Error"));
ErrorNotification.bFireAndForget = true;
ErrorNotification.ExpireDuration = 3.0f; // Need this message to last a little longer than normal since the user may want to "Show Log"
ErrorNotification.bUseThrobber = true;
FSlateNotificationManager::Get().AddNotification(ErrorNotification);
}
return NewActor;
}
void FLevelEditorActionCallbacks::ReplaceActorsFromClass_Clicked( UClass* ActorClass )
{
if ( ActorClass )
{
// Look for an actor factory capable of creating actors of that type.
UActorFactory* ActorFactory = GEditor->FindActorFactoryForActorClass( ActorClass );
if( ActorFactory )
{
// Replace all selected actors with actors created from the specified factory
UObject* TargetAsset = GEditor->GetSelectedObjects()->GetTop<UObject>();
FText ErrorMessage;
FText UnusedErrorMessage;
const FAssetData NoAssetData;
const FAssetData TargetAssetData(TargetAsset);
if( ActorFactory->CanCreateActorFrom( TargetAssetData, ErrorMessage ) )
{
// Replace all selected actors with actors created from the specified factory
GEditor->ReplaceSelectedActors( ActorFactory, TargetAssetData );
}
else if ( ActorFactory->CanCreateActorFrom( NoAssetData, UnusedErrorMessage ) )
{
// Replace all selected actors with actors created from the specified factory
GEditor->ReplaceSelectedActors( ActorFactory, NoAssetData );
}
else
{
FNotificationInfo ErrorNotification( ErrorMessage );
ErrorNotification.Image = FEditorStyle::GetBrush(TEXT("MessageLog.Error"));
ErrorNotification.bFireAndForget = true;
ErrorNotification.ExpireDuration = 3.0f; // Need this message to last a little longer than normal since the user may want to "Show Log"
ErrorNotification.bUseThrobber = true;
FSlateNotificationManager::Get().AddNotification(ErrorNotification);
}
}
else
{
// No actor factory was found; use SpawnActor instead.
GUnrealEd->Exec( GetWorld(), *FString::Printf( TEXT("ACTOR REPLACE CLASS=%s"), *ActorClass->GetName() ) );
}
}
}
bool FLevelEditorActionCallbacks::Duplicate_CanExecute()
{
TArray<FEdMode*> ActiveModes;
GLevelEditorModeTools().GetActiveModes( ActiveModes );
for( int32 ModeIndex = 0; ModeIndex < ActiveModes.Num(); ++ModeIndex )
{
const EEditAction::Type CanProcess = ActiveModes[ModeIndex]->GetActionEditDuplicate();
if (CanProcess == EEditAction::Process)
{
return true;
}
else if (CanProcess == EEditAction::Halt)
{
return false;
}
}
// If we can copy, we can duplicate
bool bCanCopy = false;
if (GEditor->GetSelectedComponentCount() > 0)
{
TArray<UActorComponent*> SelectedComponents;
for (FSelectionIterator It(GEditor->GetSelectedComponentIterator()); It; ++It)
{
SelectedComponents.Add(CastChecked<UActorComponent>(*It));
}
bCanCopy = FComponentEditorUtils::CanCopyComponents(SelectedComponents);
}
else
{
bCanCopy = GUnrealEd->CanCopySelectedActorsToClipboard(GetWorld());
}
return bCanCopy;
}
bool FLevelEditorActionCallbacks::Delete_CanExecute()
{
TArray<FEdMode*> ActiveModes;
GLevelEditorModeTools().GetActiveModes( ActiveModes );
for( int32 ModeIndex = 0; ModeIndex < ActiveModes.Num(); ++ModeIndex )
{
const EEditAction::Type CanProcess = ActiveModes[ModeIndex]->GetActionEditDelete();
if (CanProcess == EEditAction::Process)
{
return true;
}
else if (CanProcess == EEditAction::Halt)
{
return false;
}
}
bool bCanDelete = false;
if (GEditor->GetSelectedComponentCount() > 0)
{
TArray<UActorComponent*> SelectedComponents;
for (FSelectionIterator It(GEditor->GetSelectedComponentIterator()); It; ++It)
{
SelectedComponents.Add(CastChecked<UActorComponent>(*It));
}
bCanDelete = FComponentEditorUtils::CanDeleteComponents(SelectedComponents);
}
else
{
bCanDelete = GUnrealEd->CanDeleteSelectedActors(GetWorld(), true, false);
}
return bCanDelete;
}
void FLevelEditorActionCallbacks::Rename_Execute()
{
UActorComponent* Component = Cast<UActorComponent>(*GEditor->GetSelectedComponentIterator());
if (Component)
{
GEditor->BroadcastLevelComponentRequestRename(Component);
}
else
{
AActor* Actor = Cast<AActor>(*GEditor->GetSelectedActorIterator());
if (Actor)
{
GEditor->BroadcastLevelActorRequestRename(Actor);
}
}
}
bool FLevelEditorActionCallbacks::Rename_CanExecute()
{
bool bCanRename = false;
if (GEditor->GetSelectedComponentCount() == 1)
{
if (UActorComponent* ComponentToRename = GEditor->GetSelectedComponents()->GetTop<UActorComponent>())
{
// We can't edit non-instance components or the default scene root
bCanRename = ComponentToRename->CreationMethod == EComponentCreationMethod::Instance && ComponentToRename->GetFName() != USceneComponent::GetDefaultSceneRootVariableName();
}
}
else
{
bCanRename = GEditor->GetSelectedActorCount() == 1;
}
return bCanRename;
}
bool FLevelEditorActionCallbacks::Cut_CanExecute()
{
TArray<FEdMode*> ActiveModes;
GLevelEditorModeTools().GetActiveModes( ActiveModes );
for( int32 ModeIndex = 0; ModeIndex < ActiveModes.Num(); ++ModeIndex )
{
const EEditAction::Type CanProcess = ActiveModes[ModeIndex]->GetActionEditCut();
if (CanProcess == EEditAction::Process)
{
return true;
}
else if (CanProcess == EEditAction::Halt)
{
return false;
}
}
bool bCanCut = false;
if (GEditor->GetSelectedComponentCount() > 0)
{
// Make sure the components can be copied and deleted
TArray<UActorComponent*> SelectedComponents;
for (FSelectionIterator It(GEditor->GetSelectedComponentIterator()); It; ++It)
{
SelectedComponents.Add(CastChecked<UActorComponent>(*It));
}
bCanCut = FComponentEditorUtils::CanCopyComponents(SelectedComponents) && FComponentEditorUtils::CanDeleteComponents(SelectedComponents);
}
else
{
// For actors, if we can copy, we can cut
bCanCut = GUnrealEd->CanCopySelectedActorsToClipboard(GetWorld());
}
return bCanCut;
}
bool FLevelEditorActionCallbacks::Copy_CanExecute()
{
TArray<FEdMode*> ActiveModes;
GLevelEditorModeTools().GetActiveModes( ActiveModes );
for( int32 ModeIndex = 0; ModeIndex < ActiveModes.Num(); ++ModeIndex )
{
const EEditAction::Type CanProcess = ActiveModes[ModeIndex]->GetActionEditCopy();
if (CanProcess == EEditAction::Process)
{
return true;
}
else if (CanProcess == EEditAction::Halt)
{
return false;
}
}
bool bCanCopy = false;
if (GEditor->GetSelectedComponentCount() > 0)
{
TArray<UActorComponent*> SelectedComponents;
for (FSelectionIterator It(GEditor->GetSelectedComponentIterator()); It; ++It)
{
SelectedComponents.Add(CastChecked<UActorComponent>(*It));
}
bCanCopy = FComponentEditorUtils::CanCopyComponents(SelectedComponents);
}
else
{
bCanCopy = GUnrealEd->CanCopySelectedActorsToClipboard(GetWorld());
}
return bCanCopy;
}
bool FLevelEditorActionCallbacks::Paste_CanExecute()
{
TArray<FEdMode*> ActiveModes;
GLevelEditorModeTools().GetActiveModes( ActiveModes );
for( int32 ModeIndex = 0; ModeIndex < ActiveModes.Num(); ++ModeIndex )
{
const EEditAction::Type CanProcess = ActiveModes[ModeIndex]->GetActionEditPaste();
if (CanProcess == EEditAction::Process)
{
return true;
}
else if (CanProcess == EEditAction::Halt)
{
return false;
}
}
bool bCanPaste = false;
if (GEditor->GetSelectedComponentCount() > 0)
{
check(GEditor->GetSelectedActorCount() == 1);
auto SelectedActor = CastChecked<AActor>(*GEditor->GetSelectedActorIterator());
bCanPaste = FComponentEditorUtils::CanPasteComponents(SelectedActor->GetRootComponent());
}
else
{
bCanPaste = GUnrealEd->CanPasteSelectedActorsFromClipboard(GetWorld());
}
return bCanPaste;
}
bool FLevelEditorActionCallbacks::PasteHere_CanExecute()
{
return Paste_CanExecute(); // For now, just do the same check as Paste
}
void FLevelEditorActionCallbacks::ExecuteExecCommand( FString Command )
{
UWorld* OldWorld = nullptr;
// The play world needs to be selected if it exists
if (GIsEditor && GEditor->PlayWorld && !GIsPlayInEditorWorld)
{
OldWorld = SetPlayInEditorWorld(GEditor->PlayWorld);
}
GUnrealEd->Exec(GetWorld(), *Command);
// Restore the old world if there was one
if (OldWorld)
{
RestoreEditorWorld(OldWorld);
}
}
void FLevelEditorActionCallbacks::OnSelectAllActorsOfClass( bool bArchetype )
{
GEditor->SelectAllActorsWithClass( bArchetype );
}
void FLevelEditorActionCallbacks::OnSelectComponentOwnerActor()
{
auto ComponentOwner = Cast<AActor>(*GEditor->GetSelectedActorIterator());
check(ComponentOwner);
GEditor->SelectNone(true, true, false);
GEditor->SelectActor(ComponentOwner, true, true, true);
}
bool FLevelEditorActionCallbacks::CanSelectComponentOwnerActor()
{
return GEditor->GetSelectedComponentCount() > 0;
}
void FLevelEditorActionCallbacks::OnSelectAllActorsControlledByMatinee()
{
GEditor->SelectAllActorsControlledByMatinee();
}
void FLevelEditorActionCallbacks::OnSelectOwningHLODCluster()
{
if (GEditor->GetSelectedActorCount() > 0)
{
AActor* Actor = Cast<AActor>(GEditor->GetSelectedActors()->GetSelectedObject(0));
FHierarchicalLODUtilitiesModule& Module = FModuleManager::LoadModuleChecked<FHierarchicalLODUtilitiesModule>("HierarchicalLODUtilities");
IHierarchicalLODUtilities* Utilities = Module.GetUtilities();
ALODActor* ParentActor = Utilities->GetParentLODActor(Actor);
if (Actor && ParentActor)
{
GEditor->SelectNone(false, true);
GEditor->SelectActor(ParentActor, true, false);
GEditor->NoteSelectionChange();
}
}
}
void FLevelEditorActionCallbacks::OnSelectMatineeActor( AMatineeActor * ActorToSelect )
{
GEditor->SelectNone( false, true );
GEditor->SelectActor(ActorToSelect, true, false, true);
GEditor->NoteSelectionChange();
}
void FLevelEditorActionCallbacks::OnSelectMatineeGroup( AActor* Actor )
{
if( GLevelEditorModeTools().IsModeActive( FBuiltinEditorModes::EM_InterpEdit ) )
{
FEdModeInterpEdit* InterpEditMode = (FEdModeInterpEdit*)GLevelEditorModeTools().GetActiveMode( FBuiltinEditorModes::EM_InterpEdit );
if ( InterpEditMode && InterpEditMode->MatineeActor )
{
InterpEditMode->UpdateSelectedActor();
}
}
}
void FLevelEditorActionCallbacks::OnApplyMaterialToSurface()
{
FEditorDelegates::LoadSelectedAssetsIfNeeded.Broadcast();
GUnrealEd->Exec( GetWorld(), TEXT("POLY SETMATERIAL") );
}
void FLevelEditorActionCallbacks::OnSelectAllLights()
{
GEditor->GetSelectedActors()->BeginBatchSelectOperation();
// Select all light actors.
for( ALight* Light : TActorRange<ALight>(GetWorld()) )
{
GUnrealEd->SelectActor( Light, true, false, false );
}
GEditor->GetSelectedActors()->EndBatchSelectOperation();
}
void FLevelEditorActionCallbacks::OnSelectStationaryLightsExceedingOverlap()
{
GEditor->SelectNone( true, true );
for( FActorIterator It(GetWorld()); It; ++It )
{
AActor* Actor = *It;
TInlineComponentArray<ULightComponent*> Components;
Actor->GetComponents(Components);
for (int32 ComponentIndex = 0; ComponentIndex < Components.Num(); ComponentIndex++)
{
ULightComponent* LightComponent = Components[ComponentIndex];
if (LightComponent->GetOwner()
// Use the component's lighting properties to determine if this is a stationary light, instead of checking the actor type
// Because blueprint lights may be operating as stationary lights
&& LightComponent->HasStaticShadowing()
&& !LightComponent->HasStaticLighting()
&& LightComponent->bAffectsWorld
&& LightComponent->CastShadows
&& LightComponent->CastStaticShadows
&& LightComponent->PreviewShadowMapChannel == INDEX_NONE)
{
GUnrealEd->SelectActor( LightComponent->GetOwner(), true, true, false );
}
}
}
}
void FLevelEditorActionCallbacks::OnSurfaceAlignment( ETexAlign AlignmentMode )
{
GTexAlignTools.GetAligner( AlignmentMode )->Align( GetWorld(), AlignmentMode );
}
void FLevelEditorActionCallbacks::RegroupActor_Clicked()
{
GUnrealEd->edactRegroupFromSelected();
}
void FLevelEditorActionCallbacks::UngroupActor_Clicked()
{
GUnrealEd->edactUngroupFromSelected();
}
void FLevelEditorActionCallbacks::LockGroup_Clicked()
{
GUnrealEd->edactLockSelectedGroups();
}
void FLevelEditorActionCallbacks::UnlockGroup_Clicked()
{
GUnrealEd->edactUnlockSelectedGroups();
}
void FLevelEditorActionCallbacks::AddActorsToGroup_Clicked()
{
GUnrealEd->edactAddToGroup();
}
void FLevelEditorActionCallbacks::RemoveActorsFromGroup_Clicked()
{
GUnrealEd->edactRemoveFromGroup();
}
void FLevelEditorActionCallbacks::LocationGridSnap_Clicked()
{
GUnrealEd->Exec( GetWorld(), *FString::Printf( TEXT("MODE GRID=%d"), !GetDefault<ULevelEditorViewportSettings>()->GridEnabled ? 1 : 0 ) );
}
bool FLevelEditorActionCallbacks::LocationGridSnap_IsChecked()
{
return GetDefault<ULevelEditorViewportSettings>()->GridEnabled;
}
void FLevelEditorActionCallbacks::RotationGridSnap_Clicked()
{
GUnrealEd->Exec( GetWorld(), *FString::Printf( TEXT("MODE ROTGRID=%d"), !GetDefault<ULevelEditorViewportSettings>()->RotGridEnabled ? 1 : 0 ) );
}
bool FLevelEditorActionCallbacks::RotationGridSnap_IsChecked()
{
return GetDefault<ULevelEditorViewportSettings>()->RotGridEnabled;
}
void FLevelEditorActionCallbacks::ScaleGridSnap_Clicked()
{
GUnrealEd->Exec( GetWorld(), *FString::Printf( TEXT("MODE SCALEGRID=%d"), !GetDefault<ULevelEditorViewportSettings>()->SnapScaleEnabled ? 1 : 0 ) );
}
bool FLevelEditorActionCallbacks::ScaleGridSnap_IsChecked()
{
return GetDefault<ULevelEditorViewportSettings>()->SnapScaleEnabled;
}
bool FLevelEditorActionCallbacks::SaveAnimationFromSkeletalMeshComponent(AActor * EditorActor, AActor * SimActor, TArray<class USkeletalMeshComponent*> & OutEditorComponents)
{
FLevelEditorModule& LevelEditorModule = FModuleManager::GetModuleChecked<FLevelEditorModule>( TEXT("LevelEditor") );
// currently blueprint actors don't work because their property can't get copied over.
if (Cast<UBlueprintGeneratedClass>(EditorActor->GetClass()) != nullptr)
{
return false;
}
// find all skel components
TInlineComponentArray<class USkeletalMeshComponent *> SimSkelComponents;
SimActor->GetComponents<USkeletalMeshComponent>(SimSkelComponents);
if(SimSkelComponents.Num() > 0)
{
// see if simulating,
bool bSimulating = false;
for (auto & Comp : SimSkelComponents)
{
bSimulating |= (Comp->SkeletalMesh && Comp->SkeletalMesh->Skeleton && Comp->IsSimulatingPhysics());
}
// if any of them are legitimately simulating
if (bSimulating)
{
// ask users if you'd like to make an animation
FFormatNamedArguments Args;
Args.Add(TEXT("ActorName"), FText::FromString(GetNameSafe(EditorActor)));
FText AskQuestion = FText::Format(LOCTEXT("KeepSimulationChanges_AskSaveAnimation", "Would you like to save animations from simulation for {ActorName} actor"), Args);
if(EAppReturnType::Yes == FMessageDialog::Open(EAppMsgType::YesNo, AskQuestion))
{
for (auto & Comp : SimSkelComponents)
{
if (Comp->SkeletalMesh && Comp->SkeletalMesh->Skeleton && Comp->IsSimulatingPhysics())
{
// now record to animation
class UAnimSequence* Sequence = LevelEditorModule.OnCaptureSingleFrameAnimSequence().IsBound() ? LevelEditorModule.OnCaptureSingleFrameAnimSequence().Execute(Comp) : nullptr;
if(Sequence)
{
Comp->SetAnimationMode(EAnimationMode::AnimationSingleNode);
Comp->AnimationData.AnimToPlay = Sequence;
Comp->SetAnimation(Sequence);
Comp->SetSimulatePhysics(false);
// add the matching component to EditorCompoennts
class USkeletalMeshComponent * MatchingComponent = Cast<USkeletalMeshComponent>(EditorUtilities::FindMatchingComponentInstance(Comp, EditorActor));
if (MatchingComponent)
{
OutEditorComponents.Add(MatchingComponent);
}
else
{
UE_LOG(LevelEditorActions, Warning, TEXT("Matching component could not be found %s(%s)"), *GetNameSafe(Comp), *GetNameSafe(EditorActor));
}
}
}
}
return true;
}
}
}
return false;
}
void FLevelEditorActionCallbacks::OnKeepSimulationChanges()
{
// @todo simulate: There are lots of types of changes that can't be "kept", like attachment or newly-spawned actors. This
// feature currently only supports propagating changes to regularly-editable properties on an instance of a PIE actor
// that still exists in the editor world.
// Make sure we have some actors selected, and PIE is running
if( GEditor->GetSelectedActorCount() > 0 && GEditor->PlayWorld != NULL )
{
int32 UpdatedActorCount = 0;
int32 TotalCopiedPropertyCount = 0;
FString FirstUpdatedActorLabel;
{
const FScopedTransaction Transaction( NSLOCTEXT( "LevelEditorCommands", "KeepSimulationChanges", "Keep Simulation Changes" ) );
TArray<class USkeletalMeshComponent*> ComponentsToReinitialize;
for( auto ActorIt( GEditor->GetSelectedActorIterator() ); ActorIt; ++ActorIt )
{
auto* SimWorldActor = CastChecked<AActor>( *ActorIt );
// Find our counterpart actor
AActor* EditorWorldActor = EditorUtilities::GetEditorWorldCounterpartActor( SimWorldActor );
if( EditorWorldActor != NULL )
{
SaveAnimationFromSkeletalMeshComponent(EditorWorldActor, SimWorldActor, ComponentsToReinitialize);
// We only want to copy CPF_Edit properties back, or properties that are set through editor manipulation
// NOTE: This needs to match what we're doing in the BuildSelectedActorInfo() function
const auto CopyOptions = ( EditorUtilities::ECopyOptions::Type )(
EditorUtilities::ECopyOptions::CallPostEditChangeProperty |
EditorUtilities::ECopyOptions::CallPostEditMove |
EditorUtilities::ECopyOptions::OnlyCopyEditOrInterpProperties |
EditorUtilities::ECopyOptions::FilterBlueprintReadOnly);
const int32 CopiedPropertyCount = EditorUtilities::CopyActorProperties( SimWorldActor, EditorWorldActor, CopyOptions );
if( CopiedPropertyCount > 0 )
{
++UpdatedActorCount;
TotalCopiedPropertyCount += CopiedPropertyCount;
if( FirstUpdatedActorLabel.IsEmpty() )
{
FirstUpdatedActorLabel = EditorWorldActor->GetActorLabel();
}
}
}
// need to reinitialize animation
for (auto MeshComp : ComponentsToReinitialize)
{
if(MeshComp->SkeletalMesh)
{
MeshComp->InitAnim(true);
}
}
}
}
// Let the user know what happened
{
FNotificationInfo NotificationInfo( FText::GetEmpty() );
NotificationInfo.bFireAndForget = true;
NotificationInfo.FadeInDuration = 0.25f;
NotificationInfo.FadeOutDuration = 1.0f;
NotificationInfo.ExpireDuration = 1.0f;
NotificationInfo.bUseLargeFont = false;
NotificationInfo.bUseSuccessFailIcons = true;
NotificationInfo.bAllowThrottleWhenFrameRateIsLow = false; // Don't throttle as it causes distracting hitches in Simulate mode
SNotificationItem::ECompletionState CompletionState;
if( UpdatedActorCount > 0 )
{
if( UpdatedActorCount > 1 )
{
FFormatNamedArguments Args;
Args.Add( TEXT("UpdatedActorCount"), UpdatedActorCount );
Args.Add( TEXT("TotalCopiedPropertyCount"), TotalCopiedPropertyCount );
NotificationInfo.Text = FText::Format( NSLOCTEXT( "LevelEditorCommands", "KeepSimulationChanges_MultipleActorsUpdatedNotification", "Saved state for {UpdatedActorCount} actors ({TotalCopiedPropertyCount} properties)" ), Args );
}
else
{
FFormatNamedArguments Args;
Args.Add( TEXT("FirstUpdatedActorLabel"), FText::FromString( FirstUpdatedActorLabel ) );
Args.Add( TEXT("TotalCopiedPropertyCount"), TotalCopiedPropertyCount );
NotificationInfo.Text = FText::Format( NSLOCTEXT( "LevelEditorCommands", "KeepSimulationChanges_ActorUpdatedNotification", "Saved state for {FirstUpdatedActorLabel} ({TotalCopiedPropertyCount} properties)" ), Args );
}
CompletionState = SNotificationItem::CS_Success;
}
else
{
NotificationInfo.Text = NSLOCTEXT( "LevelEditorCommands", "KeepSimulationChanges_NoActorsUpdated", "No properties were copied" );
CompletionState = SNotificationItem::CS_Fail;
}
const auto Notification = FSlateNotificationManager::Get().AddNotification( NotificationInfo );
Notification->SetCompletionState( CompletionState );
}
}
}
bool FLevelEditorActionCallbacks::CanExecuteKeepSimulationChanges()
{
return AssetSelectionUtils::GetSelectedActorInfo().NumSimulationChanges > 0;
}
void FLevelEditorActionCallbacks::OnMakeSelectedActorLevelCurrent()
{
GUnrealEd->MakeSelectedActorsLevelCurrent();
}
void FLevelEditorActionCallbacks::OnMoveSelectedToCurrentLevel()
{
GEditor->MoveSelectedActorsToLevel( GetWorld()->GetCurrentLevel() );
}
void FLevelEditorActionCallbacks::OnFindActorLevelInContentBrowser()
{
GEditor->SyncActorLevelsToContentBrowser();
}
bool FLevelEditorActionCallbacks::CanExecuteFindActorLevelInContentBrowser()
{
return GEditor->CanSyncActorLevelsToContentBrowser();
}
void FLevelEditorActionCallbacks::OnFindLevelsInLevelBrowser()
{
const bool bDeselectOthers = true;
GEditor->SelectLevelInLevelBrowser( bDeselectOthers );
}
void FLevelEditorActionCallbacks::OnSelectLevelInLevelBrowser()
{
const bool bDeselectOthers = false;
GEditor->SelectLevelInLevelBrowser( bDeselectOthers );
}
void FLevelEditorActionCallbacks::OnDeselectLevelInLevelBrowser()
{
GEditor->DeselectLevelInLevelBrowser();
}
void FLevelEditorActionCallbacks::OnFindActorInLevelScript()
{
GUnrealEd->FindSelectedActorsInLevelScript();
}
void FLevelEditorActionCallbacks::OnShowWorldProperties( TWeakPtr< SLevelEditor > LevelEditor )
{
FLevelEditorModule& LevelEditorModule = FModuleManager::GetModuleChecked<FLevelEditorModule>( TEXT("LevelEditor") );
LevelEditorModule.GetLevelEditorTabManager()->InvokeTab(FName("WorldSettingsTab"));
}
void FLevelEditorActionCallbacks::OpenContentBrowser()
{
FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
ContentBrowserModule.Get().FocusPrimaryContentBrowser(true);
}
void FLevelEditorActionCallbacks::OpenMarketplace()
{
auto Service = GEditor->GetServiceLocator()->GetServiceRef<IPortalApplicationWindow>();
if (Service->IsAvailable())
{
TAsyncResult<bool> Result = Service->NavigateTo(TEXT("/ue/marketplace"));
if (FEngineAnalytics::IsAvailable())
{
FEngineAnalytics::GetProvider().RecordEvent(TEXT("Editor.Usage.OpenMarketplace"));
}
}
else
{
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if (DesktopPlatform != nullptr)
{
TArray<FAnalyticsEventAttribute> EventAttributes;
FOpenLauncherOptions OpenOptions(TEXT("ue/marketplace"));
if ( DesktopPlatform->OpenLauncher(OpenOptions) )
{
EventAttributes.Add(FAnalyticsEventAttribute(TEXT("OpenSucceeded"), TEXT("TRUE")));
}
else
{
EventAttributes.Add(FAnalyticsEventAttribute(TEXT("OpenSucceeded"), TEXT("FALSE")));
if (EAppReturnType::Yes == FMessageDialog::Open(EAppMsgType::YesNo, LOCTEXT("InstallMarketplacePrompt", "The Marketplace requires the Epic Games Launcher, which does not seem to be installed on your computer. Would you like to install it now?")))
{
FOpenLauncherOptions InstallOptions(true, TEXT("ue/marketplace"));
if (!DesktopPlatform->OpenLauncher(InstallOptions))
{
EventAttributes.Add(FAnalyticsEventAttribute(TEXT("InstallSucceeded"), TEXT("FALSE")));
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("Sorry, there was a problem installing the Launcher.\nPlease try to install it manually!")));
}
else
{
EventAttributes.Add(FAnalyticsEventAttribute(TEXT("InstallSucceeded"), TEXT("TRUE")));
}
}
}
EventAttributes.Add(FAnalyticsEventAttribute(TEXT("Source"), TEXT("EditorToolbar")));
if( FEngineAnalytics::IsAvailable() )
{
FEngineAnalytics::GetProvider().RecordEvent(TEXT("Editor.Usage.OpenMarketplace"), EventAttributes);
}
}
}
}
void FLevelEditorActionCallbacks::ToggleVR()
{
IVREditorModule& VREditorModule = IVREditorModule::Get();
VREditorModule.EnableVREditor( !VREditorModule.IsVREditorEnabled() );
}
bool FLevelEditorActionCallbacks::ToggleVR_CanExecute()
{
IVREditorModule& VREditorModule = IVREditorModule::Get();
return VREditorModule.IsVREditorAvailable();
}
bool FLevelEditorActionCallbacks::ToggleVR_IsChecked()
{
IVREditorModule& VREditorModule = IVREditorModule::Get();
return VREditorModule.IsVREditorEnabled();
}
bool FLevelEditorActionCallbacks::ToggleVR_IsVisible()
{
return GetDefault<UEditorExperimentalSettings>()->bEnableVREditing;
}
bool FLevelEditorActionCallbacks::CanSelectGameModeBlueprint()
{
bool bCheckOutNeeded = false;
FString ConfigFilePath = FPaths::ConvertRelativePathToFull(FString::Printf(TEXT("%sDefaultEngine.ini"), *FPaths::SourceConfigDir()));
if(ISourceControlModule::Get().IsEnabled())
{
// note: calling QueueStatusUpdate often does not spam status updates as an internal timer prevents this
//ISourceControlModule::Get().QueueStatusUpdate(ConfigFilePath);
ISourceControlProvider& SourceControlProvider = ISourceControlModule::Get().GetProvider();
FSourceControlStatePtr SourceControlState = SourceControlProvider.GetState(ConfigFilePath, EStateCacheUsage::Use);
bCheckOutNeeded = SourceControlState.IsValid() && SourceControlState->CanCheckout();
}
else
{
bCheckOutNeeded = (FPaths::FileExists(ConfigFilePath) && IFileManager::Get().IsReadOnly(*ConfigFilePath));
}
return !bCheckOutNeeded;
}
void FLevelEditorActionCallbacks::OpenLevelBlueprint( TWeakPtr< SLevelEditor > LevelEditor )
{
if( LevelEditor.Pin()->GetWorld()->GetCurrentLevel() )
{
ULevelScriptBlueprint* LevelScriptBlueprint = LevelEditor.Pin()->GetWorld()->PersistentLevel->GetLevelScriptBlueprint();
if (LevelScriptBlueprint)
{
// @todo Re-enable once world centric works
const bool bOpenWorldCentric = false;
FAssetEditorManager::Get().OpenEditorForAsset(
LevelScriptBlueprint,
bOpenWorldCentric ? EToolkitMode::WorldCentric : EToolkitMode::Standalone,
LevelEditor.Pin() );
}
else
{
FMessageDialog::Open( EAppMsgType::Ok, NSLOCTEXT("UnrealEd", "UnableToCreateLevelScript", "Unable to find or create a level blueprint for this level.") );
}
}
}
void FLevelEditorActionCallbacks::CreateBlankBlueprintClass()
{
// Use the BlueprintFactory to allow the user to pick a parent class for the new Blueprint class
UBlueprintFactory* NewFactory = Cast<UBlueprintFactory>(NewObject<UFactory>(GetTransientPackage(), UBlueprintFactory::StaticClass()));
FEditorDelegates::OnConfigureNewAssetProperties.Broadcast(NewFactory);
if ( NewFactory->ConfigureProperties() )
{
UClass* SelectedClass = NewFactory->ParentClass;
// Now help the user pick a path and name for the new Blueprint
UBlueprint* Blueprint = FKismetEditorUtilities::CreateBlueprintFromClass(NSLOCTEXT("LevelEditorCommands", "CreateBlankBlueprintClass_Title", "Create Blank Blueprint Class"), SelectedClass);
if( Blueprint )
{
// @todo Re-enable once world centric works
const bool bOpenWorldCentric = false;
FAssetEditorManager::Get().OpenEditorForAsset(
Blueprint,
bOpenWorldCentric ? EToolkitMode::WorldCentric : EToolkitMode::Standalone);
}
}
}
bool FLevelEditorActionCallbacks::CanHarvestSelectedActorsIntoBlueprintClass()
{
return GEditor->GetSelectedActorCount() > 0;
}
void FLevelEditorActionCallbacks::HarvestSelectedActorsIntoBlueprintClass()
{
const bool bHarvest = true;
FCreateBlueprintFromActorDialog::OpenDialog(bHarvest);
}
bool FLevelEditorActionCallbacks::CanSubclassSelectedActorIntoBlueprintClass()
{
bool bCanSubclass = GEditor->GetSelectedActorCount() == 1;
if (bCanSubclass)
{
AActor* Actor = Cast<AActor>(*GEditor->GetSelectedActorIterator());
bCanSubclass = FKismetEditorUtilities::CanCreateBlueprintOfClass(Actor->GetClass());
}
return bCanSubclass;
}
void FLevelEditorActionCallbacks::SubclassSelectedActorIntoBlueprintClass()
{
const bool bHarvest = false;
FCreateBlueprintFromActorDialog::OpenDialog(bHarvest);
}
void FLevelEditorActionCallbacks::CheckOutProjectSettingsConfig( )
{
FString ConfigFilePath = FPaths::ConvertRelativePathToFull(FString::Printf(TEXT("%sDefaultEngine.ini"), *FPaths::SourceConfigDir()));
if(ISourceControlModule::Get().IsEnabled())
{
SourceControlHelpers::CheckOutFile(ConfigFilePath);
}
else
{
FPlatformFileManager::Get().GetPlatformFile().SetReadOnly(*ConfigFilePath, false);
}
}
void FLevelEditorActionCallbacks::OnShowOnlySelectedActors()
{
const FScopedTransaction Transaction( NSLOCTEXT( "LevelEditorCommands", "ShowOnlySelectedActors", "Show Only Selected Actors" ) );
// First hide unselected as this will also hide group actor members
GUnrealEd->edactHideUnselected( GetWorld() );
// Then unhide selected to ensure that everything that's selected will be unhidden
GUnrealEd->edactUnhideSelected(GetWorld());
}
void FLevelEditorActionCallbacks::OnToggleTransformWidgetVisibility()
{
GLevelEditorModeTools().SetShowWidget( !GLevelEditorModeTools().GetShowWidget() );
GUnrealEd->RedrawAllViewports();
}
bool FLevelEditorActionCallbacks::OnGetTransformWidgetVisibility()
{
return GLevelEditorModeTools().GetShowWidget();
}
void FLevelEditorActionCallbacks::OnAllowTranslucentSelection()
{
auto* Settings = GetMutableDefault<UEditorPerProjectUserSettings>();
// Toggle 'allow select translucent'
Settings->bAllowSelectTranslucent = !Settings->bAllowSelectTranslucent;
Settings->PostEditChange();
// Need to refresh hit proxies as we changed what should be rendered into them
GUnrealEd->RedrawAllViewports();
}
bool FLevelEditorActionCallbacks::OnIsAllowTranslucentSelectionEnabled()
{
return GetDefault<UEditorPerProjectUserSettings>()->bAllowSelectTranslucent == true;
}
void FLevelEditorActionCallbacks::OnAllowGroupSelection()
{
AGroupActor::ToggleGroupMode();
}
bool FLevelEditorActionCallbacks::OnIsAllowGroupSelectionEnabled()
{
return GUnrealEd->bGroupingActive;
}
void FLevelEditorActionCallbacks::OnToggleStrictBoxSelect()
{
ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();
ViewportSettings->bStrictBoxSelection = !ViewportSettings->bStrictBoxSelection;
ViewportSettings->PostEditChange();
}
bool FLevelEditorActionCallbacks::OnIsStrictBoxSelectEnabled()
{
return GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;
}
void FLevelEditorActionCallbacks::OnToggleTransparentBoxSelect()
{
ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();
ViewportSettings->bTransparentBoxSelection = !ViewportSettings->bTransparentBoxSelection;
ViewportSettings->PostEditChange();
}
bool FLevelEditorActionCallbacks::OnIsTransparentBoxSelectEnabled()
{
return GetDefault<ULevelEditorViewportSettings>()->bTransparentBoxSelection;
}
void FLevelEditorActionCallbacks::OnDrawBrushMarkerPolys()
{
GEditor->Exec( GetWorld(), *FString::Printf( TEXT("MODE SHOWBRUSHMARKERPOLYS=%d"), !GEditor->bShowBrushMarkerPolys ? 1 : 0 ) );
GEditor->SaveConfig();
}
bool FLevelEditorActionCallbacks::OnIsDrawBrushMarkerPolysEnabled()
{
return GEditor->bShowBrushMarkerPolys;
}
void FLevelEditorActionCallbacks::OnToggleOnlyLoadVisibleInPIE()
{
ULevelEditorPlaySettings* PlaySettings = GetMutableDefault<ULevelEditorPlaySettings>();
PlaySettings->bOnlyLoadVisibleLevelsInPIE = !PlaySettings->bOnlyLoadVisibleLevelsInPIE;
PlaySettings->PostEditChange();
PlaySettings->SaveConfig();
}
bool FLevelEditorActionCallbacks::OnIsOnlyLoadVisibleInPIEEnabled()
{
return GetDefault<ULevelEditorPlaySettings>()->bOnlyLoadVisibleLevelsInPIE;
}
void FLevelEditorActionCallbacks::OnToggleSocketSnapping()
{
GEditor->bEnableSocketSnapping = !GEditor->bEnableSocketSnapping;
GEditor->RedrawLevelEditingViewports();
}
bool FLevelEditorActionCallbacks::OnIsSocketSnappingEnabled()
{
return GEditor->bEnableSocketSnapping;
}
void FLevelEditorActionCallbacks::OnToggleParticleSystemLOD()
{
GEngine->bEnableEditorPSysRealtimeLOD = !GEngine->bEnableEditorPSysRealtimeLOD;
GEditor->RedrawLevelEditingViewports();
}
bool FLevelEditorActionCallbacks::OnIsParticleSystemLODEnabled()
{
return GEditor->bEnableEditorPSysRealtimeLOD;
}
void FLevelEditorActionCallbacks::OnToggleFreezeParticleSimulation()
{
IConsoleManager& ConsoleManager = IConsoleManager::Get();
IConsoleVariable* CVar = ConsoleManager.FindConsoleVariable(TEXT("FX.FreezeParticleSimulation"));
if (CVar)
{
CVar->Set(CVar->GetInt() == 0 ? 1 : 0, ECVF_SetByConsole);
}
}
bool FLevelEditorActionCallbacks::OnIsParticleSimulationFrozen()
{
IConsoleManager& ConsoleManager = IConsoleManager::Get();
static const auto* CVar = ConsoleManager.FindTConsoleVariableDataInt(TEXT("FX.FreezeParticleSimulation"));
if (CVar)
{
return CVar->GetValueOnGameThread() != 0;
}
return false;
}
void FLevelEditorActionCallbacks::OnToggleParticleSystemHelpers()
{
GEditor->bDrawParticleHelpers = !GEditor->bDrawParticleHelpers;
}
bool FLevelEditorActionCallbacks::OnIsParticleSystemHelpersEnabled()
{
return GEditor->bDrawParticleHelpers;
}
void FLevelEditorActionCallbacks::OnToggleLODViewLocking()
{
GEditor->bEnableLODLocking = !GEditor->bEnableLODLocking;
GEditor->RedrawLevelEditingViewports();
}
bool FLevelEditorActionCallbacks::OnIsLODViewLockingEnabled()
{
return GEditor->bEnableLODLocking;
}
void FLevelEditorActionCallbacks::OnToggleLevelStreamingVolumePrevis()
{
ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();
ViewportSettings->bLevelStreamingVolumePrevis = !ViewportSettings->bLevelStreamingVolumePrevis;
ViewportSettings->PostEditChange();
}
bool FLevelEditorActionCallbacks::OnIsLevelStreamingVolumePrevisEnabled()
{
return GetDefault<ULevelEditorViewportSettings>()->bLevelStreamingVolumePrevis;
}
FText FLevelEditorActionCallbacks::GetAudioVolumeToolTip()
{
if ( !GEditor->IsRealTimeAudioMuted() )
{
const float Volume = GEditor->GetRealTimeAudioVolume() * 100.0f;
return FText::AsNumber( FMath::RoundToInt(Volume) );
}
return NSLOCTEXT("UnrealEd", "Muted", "Muted" );
}
float FLevelEditorActionCallbacks::GetAudioVolume()
{
return GEditor->GetRealTimeAudioVolume();
}
void FLevelEditorActionCallbacks::OnAudioVolumeChanged(float Volume)
{
GEditor->SetRealTimeAudioVolume(Volume);
}
bool FLevelEditorActionCallbacks::GetAudioMuted()
{
return GEditor->IsRealTimeAudioMuted();
}
void FLevelEditorActionCallbacks::OnAudioMutedChanged(bool bMuted)
{
GEditor->MuteRealTimeAudio(bMuted);
}
void FLevelEditorActionCallbacks::SnapObjectToView_Clicked()
{
const FScopedTransaction Transaction(NSLOCTEXT("UnrealEd", "SnapObjectToView", "Snap Object to View"));
for (FSelectionIterator It(GEditor->GetSelectedActorIterator()); It; ++It)
{
AActor* Actor = Cast<AActor>(*It);
Actor->Modify();
FVector Location = GCurrentLevelEditingViewportClient->GetViewLocation();
FRotator Rotation = GCurrentLevelEditingViewportClient->GetViewRotation();
Actor->SetActorLocation(Location);
Actor->SetActorRotation(Rotation);
}
}
void FLevelEditorActionCallbacks::OnEnableActorSnap()
{
FSnappingUtils::EnableActorSnap( !FSnappingUtils::IsSnapToActorEnabled() );
// If the setting is enabled and there's no distance, revert to default
if ( FSnappingUtils::IsSnapToActorEnabled() && FSnappingUtils::GetActorSnapDistance() == 0.0f )
{
FSnappingUtils::SetActorSnapDistance( 1.0f );
}
}
bool FLevelEditorActionCallbacks::OnIsActorSnapEnabled()
{
return FSnappingUtils::IsSnapToActorEnabled();
}
void FLevelEditorActionCallbacks::OnEnableVertexSnap()
{
ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();
ViewportSettings->bSnapVertices = !ViewportSettings->bSnapVertices;
}
bool FLevelEditorActionCallbacks::OnIsVertexSnapEnabled()
{
return GetDefault<ULevelEditorViewportSettings>()->bSnapVertices;
}
FText FLevelEditorActionCallbacks::GetActorSnapTooltip()
{
// If the setting is enabled, return the distance, otherwise say disabled
if ( FSnappingUtils::IsSnapToActorEnabled() )
{
static const FNumberFormattingOptions FormatOptions = FNumberFormattingOptions()
.SetMinimumFractionalDigits(2)
.SetMaximumFractionalDigits(2);
return FText::AsNumber( FSnappingUtils::GetActorSnapDistance(), &FormatOptions );
}
return NSLOCTEXT("UnrealEd", "Disabled", "Disabled" );
}
float FLevelEditorActionCallbacks::GetActorSnapSetting()
{
// If the setting is enabled, return the distance, otherwise say 0
if (FSnappingUtils::IsSnapToActorEnabled() )
{
return FSnappingUtils::GetActorSnapDistance(true) ;
}
return 0.0f;
}
void FLevelEditorActionCallbacks::SetActorSnapSetting(float Distance)
{
FSnappingUtils::SetActorSnapDistance( Distance );
// If the distance is 0, disable the setting until it's > 0
FSnappingUtils::EnableActorSnap( ( Distance > 0.0f ? true : false ) );
}
void FLevelEditorActionCallbacks::OnToggleHideViewportUI()
{
GLevelEditorModeTools().SetHideViewportUI( !GLevelEditorModeTools().IsViewportUIHidden() );
}
bool FLevelEditorActionCallbacks::IsViewportUIHidden()
{
return GLevelEditorModeTools().IsViewportUIHidden();
}
bool FLevelEditorActionCallbacks::IsEditorModeActive( FEditorModeID EditorMode )
{
return GLevelEditorModeTools().IsModeActive( EditorMode );
}
void FLevelEditorActionCallbacks::OnAddVolume( UClass* VolumeClass )
{
GUnrealEd->Exec( GetWorld(), *FString::Printf( TEXT("BRUSH ADDVOLUME CLASS=%s"), *VolumeClass->GetName() ) );
// A new volume actor was added, update the volumes visibility.
// This volume should be hidden if the user doesn't have this type of volume visible.
GUnrealEd->UpdateVolumeActorVisibility( VolumeClass );
GEditor->RedrawAllViewports();
}
void FLevelEditorActionCallbacks::OnAddMatinee()
{
// Warn the user prior to creating our actor
if ( GEditor->ShouldOpenMatinee( NULL ) )
{
// Spawn a matinee actor at the origin, and either move infront of the camera or focus camera on it (depending on the viewport) and open for edit
UActorFactory* ActorFactory = GEditor->FindActorFactoryForActorClass( AMatineeActor::StaticClass() );
check( ActorFactory );
AMatineeActor* MatineeActor = CastChecked<AMatineeActor>( FLevelEditorActionCallbacks::AddActor( ActorFactory, FAssetData(), &FTransform::Identity ) );
if( GCurrentLevelEditingViewportClient->IsPerspective() )
{
GEditor->MoveActorInFrontOfCamera( *MatineeActor, GCurrentLevelEditingViewportClient->GetViewLocation(), GCurrentLevelEditingViewportClient->GetViewRotation().Vector() );
}
else
{
GEditor->MoveViewportCamerasToActor( *MatineeActor, false );
}
GEditor->OpenMatinee( MatineeActor, false );
}
}
void FLevelEditorActionCallbacks::SelectActorsInLayers()
{
// Iterate over selected actors and make a list of all layers the selected actors belong to.
TArray< FName > SelectedLayers;
for ( FSelectionIterator It( GEditor->GetSelectedActorIterator() ) ; It ; ++It )
{
AActor* Actor = Cast<AActor>( *It );
// Add them to the list of selected layers.
for( int32 LayerIndex = 0 ; LayerIndex < Actor->Layers.Num() ; ++LayerIndex )
{
SelectedLayers.AddUnique( Actor->Layers[ LayerIndex ] );
}
}
bool bSelect = true;
bool bNotify = true;
GEditor->Layers->SelectActorsInLayers( SelectedLayers, bSelect, bNotify );
}
void FLevelEditorActionCallbacks::SetWidgetMode( FWidget::EWidgetMode WidgetMode )
{
if( !GLevelEditorModeTools().IsTracking() )
{
GLevelEditorModeTools().SetWidgetMode( WidgetMode );
GEditor->RedrawAllViewports();
}
}
bool FLevelEditorActionCallbacks::IsWidgetModeActive( FWidget::EWidgetMode WidgetMode )
{
return GLevelEditorModeTools().GetWidgetMode() == WidgetMode;
}
bool FLevelEditorActionCallbacks::CanSetWidgetMode( FWidget::EWidgetMode WidgetMode )
{
return GLevelEditorModeTools().GetShowWidget() == true;
}
bool FLevelEditorActionCallbacks::IsTranslateRotateModeVisible()
{
return GetDefault<ULevelEditorViewportSettings>()->bAllowTranslateRotateZWidget;
}
void FLevelEditorActionCallbacks::SetCoordinateSystem( ECoordSystem CoordinateSystem )
{
GLevelEditorModeTools().SetCoordSystem( CoordinateSystem );
}
bool FLevelEditorActionCallbacks::IsCoordinateSystemActive( ECoordSystem CoordinateSystem )
{
return GLevelEditorModeTools().GetCoordSystem() == CoordinateSystem;
}
void FLevelEditorActionCallbacks::MoveActorToGrid_Clicked( bool InAlign, bool bInPerActor )
{
const FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "MoveActorToGrid", "Snap Origin to Grid") );
MoveActorTo_Clicked( InAlign, NULL, bInPerActor );
}
void FLevelEditorActionCallbacks::MoveActorToActor_Clicked( bool InAlign )
{
AActor* Actor = GEditor->GetSelectedActors()->GetBottom<AActor>();
if( Actor )
{
const FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "MoveActorToActor", "Snap Origin to Actor") );
MoveActorTo_Clicked( InAlign, Actor );
}
}
void FLevelEditorActionCallbacks::MoveActorTo_Clicked( const bool InAlign, const AActor* InDestination/* = NULL*/, bool bInPerActor/* = false*/ )
{
// Fires ULevel::LevelDirtiedEvent when falling out of scope.
FScopedLevelDirtied LevelDirtyCallback;
// Update the pivot location.
FVector Delta = FVector::ZeroVector;
FVector NewLocation = FVector::ZeroVector;
FRotator NewRotation = FRotator::ZeroRotator;
if(!bInPerActor)
{
if ( InDestination )
{
NewLocation = InDestination->GetActorLocation();
NewRotation = InDestination->GetActorRotation();
GEditor->SetPivot( NewLocation, false, true );
}
else
{
const FVector OldPivot = GEditor->GetPivotLocation();
const FVector NewPivot = OldPivot.GridSnap(GEditor->GetGridSize());
Delta = NewPivot - OldPivot;
GEditor->SetPivot( NewPivot, false, true );
}
}
for ( FSelectionIterator It( GEditor->GetSelectedActorIterator() ) ; It ; ++It )
{
AActor* Actor = Cast<AActor>( *It );
checkSlow( Actor );
if ( Actor == InDestination ) // Early out
{
continue;
}
Actor->Modify();
if(!InDestination)
{
if ( bInPerActor )
{
const FVector OldPivot = Actor->GetActorLocation();
const FVector NewPivot = OldPivot.GridSnap(GEditor->GetGridSize());
Delta = NewPivot - OldPivot;
GEditor->SetPivot( NewPivot, false, true );
}
NewLocation = Actor->GetActorLocation() + Delta;
}
Actor->TeleportTo( NewLocation, ( !InAlign ? Actor->GetActorRotation() : NewRotation ), false, true );
Actor->InvalidateLightingCache();
Actor->UpdateComponentTransforms();
Actor->MarkPackageDirty();
LevelDirtyCallback.Request();
}
GEditor->RedrawLevelEditingViewports();
GEditor->RebuildAlteredBSP(); // Update the Bsp of any levels containing a modified brush
}
void FLevelEditorActionCallbacks::SnapTo2DLayer_Clicked()
{
// Fires ULevel::LevelDirtiedEvent when falling out of scope.
FScopedLevelDirtied LevelDirtyCallback;
const ULevelEditorViewportSettings* ViewportSettings = GetDefault<ULevelEditorViewportSettings>();
const ULevelEditor2DSettings* Settings2D = GetDefault<ULevelEditor2DSettings>();
if (Settings2D->SnapLayers.IsValidIndex(ViewportSettings->ActiveSnapLayerIndex))
{
const FScopedTransaction Transaction(NSLOCTEXT("UnrealEd", "SnapSelection2D", "Snap Selection to 2D Layer"));
float SnapDepth = Settings2D->SnapLayers[ViewportSettings->ActiveSnapLayerIndex].Depth;
USelection* SelectedActors = GEditor->GetSelectedActors();
for (FSelectionIterator Iter(*SelectedActors); Iter; ++Iter)
{
AActor* Actor = CastChecked<AActor>(*Iter);
// Only snap actors that are not attached to something else
if (Actor->GetAttachParentActor() == nullptr)
{
FTransform Transform = Actor->GetTransform();
FVector CurrentLocation = Transform.GetLocation();
switch (Settings2D->SnapAxis)
{
case ELevelEditor2DAxis::X: CurrentLocation.X = SnapDepth; break;
case ELevelEditor2DAxis::Y: CurrentLocation.Y = SnapDepth; break;
case ELevelEditor2DAxis::Z: CurrentLocation.Z = SnapDepth; break;
}
Transform.SetLocation(CurrentLocation);
Actor->Modify();
Actor->SetActorTransform(Transform);
Actor->InvalidateLightingCache();
Actor->UpdateComponentTransforms();
Actor->MarkPackageDirty();
LevelDirtyCallback.Request();
}
}
GEditor->RedrawLevelEditingViewports(true);
GEditor->RebuildAlteredBSP();
}
}
bool FLevelEditorActionCallbacks::CanSnapTo2DLayer()
{
const ULevelEditor2DSettings* Settings = GetDefault<ULevelEditor2DSettings>();
return Settings->SnapLayers.IsValidIndex(GetDefault<ULevelEditorViewportSettings>()->ActiveSnapLayerIndex) && (GEditor->GetSelectedActorCount() > 0);
}
void FLevelEditorActionCallbacks::MoveSelectionToDifferent2DLayer_Clicked(bool bGoingUp, bool bForceToTopOrBottom)
{
// Change the active layer first
const ULevelEditor2DSettings* Settings2D = GetDefault<ULevelEditor2DSettings>();
ULevelEditorViewportSettings* SettingsVP = GetMutableDefault<ULevelEditorViewportSettings>();
const int32 NumLayers = Settings2D->SnapLayers.Num();
if (NumLayers > 0)
{
if (bGoingUp && (SettingsVP->ActiveSnapLayerIndex > 0))
{
SettingsVP->ActiveSnapLayerIndex = bForceToTopOrBottom ? 0 : (SettingsVP->ActiveSnapLayerIndex - 1);
SettingsVP->PostEditChange();
}
else if (!bGoingUp && ((SettingsVP->ActiveSnapLayerIndex + 1) < NumLayers))
{
SettingsVP->ActiveSnapLayerIndex = bForceToTopOrBottom ? (NumLayers - 1) : (SettingsVP->ActiveSnapLayerIndex + 1);
SettingsVP->PostEditChange();
}
}
// Snap the selection to the new active layer
SnapTo2DLayer_Clicked();
}
bool FLevelEditorActionCallbacks::CanMoveSelectionToDifferent2DLayer(bool bGoingUp)
{
const ULevelEditor2DSettings* Settings2D = GetDefault<ULevelEditor2DSettings>();
const ULevelEditorViewportSettings* SettingsVP = GetMutableDefault<ULevelEditorViewportSettings>();
const int32 SelectedIndex = SettingsVP->ActiveSnapLayerIndex;
const int32 NumLayers = Settings2D->SnapLayers.Num();
const bool bHasLayerInDirection = bGoingUp ? (SelectedIndex > 0) : (SelectedIndex + 1 < NumLayers);
const bool bHasActorSelected = GEditor->GetSelectedActorCount() > 0;
// Allow it even if there is no layer in the corresponding direction, to let it double as a snap operation shortcut even when at the end stops
return bHasLayerInDirection || bHasActorSelected;
}
void FLevelEditorActionCallbacks::Select2DLayerDeltaAway_Clicked(int32 Delta)
{
const ULevelEditor2DSettings* Settings2D = GetDefault<ULevelEditor2DSettings>();
ULevelEditorViewportSettings* SettingsVP = GetMutableDefault<ULevelEditorViewportSettings>();
const int32 SelectedIndex = SettingsVP->ActiveSnapLayerIndex;
const int32 NumLayers = Settings2D->SnapLayers.Num();
if (NumLayers > 0)
{
const int32 NewIndex = ((NumLayers + SelectedIndex + Delta) % NumLayers);
SettingsVP->ActiveSnapLayerIndex = NewIndex;
SettingsVP->PostEditChange();
}
}
void FLevelEditorActionCallbacks::SnapToFloor_Clicked( bool InAlign, bool InUseLineTrace, bool InUseBounds, bool InUsePivot )
{
const FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "SnapActorsToFloor", "Snap Actors To Floor") );
SnapTo_Clicked( InAlign, InUseLineTrace, InUseBounds, InUsePivot );
}
void FLevelEditorActionCallbacks::SnapActorToActor_Clicked( bool InAlign, bool InUseLineTrace, bool InUseBounds, bool InUsePivot )
{
AActor* Actor = GEditor->GetSelectedActors()->GetBottom<AActor>();
if( Actor )
{
const FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "SnapActorsToActor", "Snap Actors To Actor") );
SnapTo_Clicked( InAlign, InUseLineTrace, InUseBounds, InUsePivot, Actor );
}
}
void FLevelEditorActionCallbacks::SnapTo_Clicked( const bool InAlign, const bool InUseLineTrace, const bool InUseBounds, const bool InUsePivot, AActor* InDestination )
{
// Fires ULevel::LevelDirtiedEvent when falling out of scope.
FScopedLevelDirtied LevelDirtyCallback;
bool bSnappedComponents = false;
if( GEditor->GetSelectedComponentCount() > 0 )
{
for(FSelectedEditableComponentIterator It(GEditor->GetSelectedEditableComponentIterator()); It; ++It)
{
USceneComponent* SceneComponent = Cast<USceneComponent>(*It);
if(SceneComponent)
{
SceneComponent->Modify();
AActor* ActorOwner = SceneComponent->GetOwner();
bSnappedComponents = true;
if(ActorOwner)
{
ActorOwner->Modify();
GEditor->SnapObjectTo(FActorOrComponent(SceneComponent), InAlign, InUseLineTrace, InUseBounds, InUsePivot, FActorOrComponent(InDestination));
ActorOwner->InvalidateLightingCache();
ActorOwner->UpdateComponentTransforms();
LevelDirtyCallback.Request();
}
}
}
USceneComponent* LastComp = GEditor->GetSelectedComponents()->GetBottom<USceneComponent>();
GEditor->SetPivot(LastComp->GetComponentLocation(), false, true);
}
if( !bSnappedComponents )
{
for(FSelectionIterator It(GEditor->GetSelectedActorIterator()); It; ++It)
{
AActor* Actor = Cast<AActor>(*It);
if(Actor)
{
Actor->Modify();
GEditor->SnapObjectTo(FActorOrComponent(Actor), InAlign, InUseLineTrace, InUseBounds, InUsePivot, FActorOrComponent(InDestination));
Actor->InvalidateLightingCache();
Actor->UpdateComponentTransforms();
LevelDirtyCallback.Request();
}
}
AActor* Actor = GEditor->GetSelectedActors()->GetBottom<AActor>();
if(Actor)
{
GEditor->SetPivot(Actor->GetActorLocation(), false, true);
if(GEditor->bGroupingActive)
{
// set group pivot for the root-most group
AGroupActor* ActorGroupRoot = AGroupActor::GetRootForActor(Actor, true, true);
if(ActorGroupRoot)
{
ActorGroupRoot->CenterGroupLocation();
}
}
}
}
GEditor->RedrawLevelEditingViewports();
}
bool FLevelEditorActionCallbacks::ActorSelected_CanExecute()
{
// Had to have something selected
return ( ( GEditor->GetSelectedActorCount() > 0 ) ? true : false );
}
bool FLevelEditorActionCallbacks::ActorsSelected_CanExecute()
{
// Has to have more than one selected
return ( ( GEditor->GetSelectedActorCount() > 1 ) ? true : false );
}
class UWorld* FLevelEditorActionCallbacks::GetWorld()
{
return GEditor->GetEditorWorldContext().World();
}
/** UI_COMMAND takes long for the compile to optimize */
PRAGMA_DISABLE_OPTIMIZATION
void FLevelEditorCommands::RegisterCommands()
{
UI_COMMAND( BrowseDocumentation, "Documentation...", "Opens the main documentation page, and allows you to search across all UE4 support sites.", EUserInterfaceActionType::Button, FInputChord( EKeys::F1 ) );
UI_COMMAND( BrowseAPIReference, "API Reference...", "Opens the API reference documentation", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( BrowseCVars, "Console Variables", "Creates an HTML file to browse the console variables and commands (console command 'help')", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( BrowseViewportControls, "Viewport Controls...", "Opens the viewport controls cheat sheet", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( NewLevel, "New Level...", "Create a new level, or choose a level template to start from.", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Control, EKeys::N ) );
UI_COMMAND( OpenLevel, "Open Level...", "Loads an existing level", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Control, EKeys::O ) );
UI_COMMAND( Save, "Save", "Saves the current level to disk", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Control, EKeys::S) );
UI_COMMAND( SaveAs, "Save As...", "Save the current level as...", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Control|EModifierKey::Alt, EKeys::S ) );
UI_COMMAND( SaveAllLevels, "Save All Levels", "Saves all unsaved levels to disk", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ToggleFavorite, "Toggle Favorite", "Sets whether the currently loaded level will appear in the list of favorite levels", EUserInterfaceActionType::Button, FInputChord() );
for( int32 CurRecentIndex = 0; CurRecentIndex < FLevelEditorCommands::MaxRecentFiles; ++CurRecentIndex )
{
// NOTE: The actual label and tool-tip will be overridden at runtime when the command is bound to a menu item, however
// we still need to set one here so that the key bindings UI can function properly
TSharedRef< FUICommandInfo > OpenRecentFile =
FUICommandInfoDecl(
this->AsShared(),
FName( *FString::Printf( TEXT( "OpenRecentFile%i" ), CurRecentIndex ) ),
FText::Format( NSLOCTEXT( "LevelEditorCommands", "OpenRecentFile", "Open Recent File {0}" ), FText::AsNumber( CurRecentIndex ) ),
NSLOCTEXT( "LevelEditorCommands", "OpenRecentFileToolTip", "Opens a recently opened file" ) )
.UserInterfaceType( EUserInterfaceActionType::Button )
.DefaultChord( FInputChord() );
OpenRecentFileCommands.Add( OpenRecentFile );
}
UI_COMMAND( ImportScene, "Import Into Level...", "Imports a scene from a FBX or T3D format into the current level", EUserInterfaceActionType::Button, FInputChord());
UI_COMMAND( ExportAll, "Export All...", "Exports the entire level to a file on disk (multiple formats are supported.)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ExportSelected, "Export Selected...", "Exports currently-selected objects to a file on disk (multiple formats are supported.)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( Build, "Build All Levels", "Builds all levels (precomputes lighting data and visibility data, generates navigation networks and updates brush models.)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( BuildAndSubmitToSourceControl, "Build and Submit...", "Displays a window that allows you to build all levels and submit them to source control", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( BuildLightingOnly, "Build Lighting", "Only precomputes lighting (all levels.)", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Control|EModifierKey::Shift, EKeys::Semicolon) );
UI_COMMAND( BuildReflectionCapturesOnly, "Update Reflection Captures", "Only updates Reflection Captures (all levels.)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( BuildLightingOnly_VisibilityOnly, "Precompute Static Visibility", "Only precomputes static visibility data (all levels.)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( LightingBuildOptions_UseErrorColoring, "Use Error Coloring", "When enabled, errors during lighting precomputation will be baked as colors into light map data", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( LightingBuildOptions_ShowLightingStats, "Show Lighting Stats", "When enabled, a window containing metrics about lighting performance and memory will be displayed after a successful build.", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( BuildGeometryOnly, "Build Geometry", "Only builds geometry (all levels.)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( BuildGeometryOnly_OnlyCurrentLevel, "Build Geometry (Current Level)", "Builds geometry, only for the current level", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Control | EModifierKey::Shift, EKeys::B) );
UI_COMMAND( BuildPathsOnly, "Build Paths", "Only builds paths (all levels.)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( BuildLODsOnly, "Build LODs", "Only builds LODs (all levels.)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( BuildTextureStreamingOnly, "Build Texture Streaming", "Build texture streaming data", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( LightingQuality_Production, "Production", "Sets precomputed lighting quality to highest possible quality (slowest computation time.)", EUserInterfaceActionType::RadioButton, FInputChord() );
UI_COMMAND( LightingQuality_High, "High", "Sets precomputed lighting quality to high quality", EUserInterfaceActionType::RadioButton, FInputChord() );
UI_COMMAND( LightingQuality_Medium, "Medium", "Sets precomputed lighting quality to medium quality", EUserInterfaceActionType::RadioButton, FInputChord() );
UI_COMMAND( LightingQuality_Preview, "Preview", "Sets precomputed lighting quality to preview quality (fastest computation time.)", EUserInterfaceActionType::RadioButton, FInputChord() );
UI_COMMAND( LightingDensity_RenderGrayscale, "Render Grayscale", "Renders the lightmap density.", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( LightingResolution_CurrentLevel, "Current Level", "Adjust only primitives in the current level.", EUserInterfaceActionType::RadioButton, FInputChord() );
UI_COMMAND( LightingResolution_SelectedLevels, "Selected Levels", "Adjust only primitives in the selected levels.", EUserInterfaceActionType::RadioButton, FInputChord() );
UI_COMMAND( LightingResolution_AllLoadedLevels, "All Loaded Levels", "Adjust primitives in all loaded levels.", EUserInterfaceActionType::RadioButton, FInputChord() );
UI_COMMAND( LightingResolution_SelectedObjectsOnly, "Selected Objects Only", "Adjust only selected objects in the levels.", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( LightingStaticMeshInfo, "Lighting StaticMesh Info...", "Shows the lighting information for the StaticMeshes.", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SceneStats, "Open Scene Stats", "Opens the Scene Stats viewer", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( TextureStats, "Open Texture Stats", "Opens the Texture Stats viewer", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MapCheck, "Open Map Check", "Checks map for errors", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( RecompileGameCode, "Recompile Game Code", "Recompiles and reloads C++ code for game systems on the fly", EUserInterfaceActionType::Button, FInputChord( EKeys::P, EModifierKey::Alt | EModifierKey::Control | EModifierKey::Shift ) );
UI_COMMAND( EditAsset, "Edit Asset", "Edits the asset associated with the selected actor", EUserInterfaceActionType::Button, FInputChord( EKeys::E, EModifierKey::Control ) );
UI_COMMAND( EditAssetNoConfirmMultiple, "Edit Asset", "Edits the asset associated with the selected actor", EUserInterfaceActionType::Button, FInputChord( EKeys::E, EModifierKey::Control | EModifierKey::Shift ) );
UI_COMMAND( GoHere, "Go Here", "Moves the camera to the current mouse position", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapCameraToObject, "Snap View to Object", "Snaps the view to the selected object", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapObjectToCamera, "Snap Object to View", "Snaps the selected object to the view", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( GoToCodeForActor, "Go to C++ Code for Actor", "Opens a code editing IDE and navigates to the source file associated with the seleced actor", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( GoToDocsForActor, "Go to Documentation for Actor", "Opens documentation for the Actor in the default web browser", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( PasteHere, "Paste Here", "Pastes the actor at the click location", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapOriginToGrid, "Snap Origin to Grid", "Snaps the actor to the nearest grid location at its origin", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Control, EKeys::End ) );
UI_COMMAND( SnapOriginToGridPerActor, "Snap Origin to Grid Per Actor", "Snaps each selected actor separately to the nearest grid location at its origin", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( AlignOriginToGrid, "Align Origin to Grid", "Aligns the actor to the nearest grid location at its origin", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapTo2DLayer, "Snap to 2D Layer", "Snaps the actor to the current 2D snap layer", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Control, EKeys::SpaceBar ) );
UI_COMMAND( MoveSelectionUpIn2DLayers, "Bring selection forward a snap layer", "Bring selection forward a snap layer", EUserInterfaceActionType::Button, FInputChord(EKeys::PageUp, EModifierKey::Control) );
UI_COMMAND( MoveSelectionDownIn2DLayers, "Send selection backward a snap layer", "Send selection backward a snap layer", EUserInterfaceActionType::Button, FInputChord(EKeys::PageDown, EModifierKey::Control) );
UI_COMMAND( MoveSelectionToTop2DLayer, "Bring selection to the front snap layer", "Bring selection to the front snap layer", EUserInterfaceActionType::Button, FInputChord(EKeys::PageUp, EModifierKey::Shift | EModifierKey::Control) );
UI_COMMAND( MoveSelectionToBottom2DLayer, "Send selection to the back snap layer", "Send selection to the back snap layer", EUserInterfaceActionType::Button, FInputChord(EKeys::PageDown, EModifierKey::Shift | EModifierKey::Control) );
UI_COMMAND( Select2DLayerAbove, "Select next 2D layer", "Changes the active layer to the next 2D layer", EUserInterfaceActionType::Button, FInputChord(EKeys::PageUp, EModifierKey::Alt) );
UI_COMMAND( Select2DLayerBelow, "Select previous 2D layer", "Changes the active layer to the previous 2D layer", EUserInterfaceActionType::Button, FInputChord(EKeys::PageDown, EModifierKey::Alt) );
UI_COMMAND( SnapToFloor, "Snap to Floor", "Snaps the actor or component to the floor below it", EUserInterfaceActionType::Button, FInputChord( EKeys::End ) );
UI_COMMAND( AlignToFloor, "Align to Floor", "Aligns the actor or component with the floor", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapPivotToFloor, "Snap Pivot to Floor", "Snaps the actor to the floor at its pivot point", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Alt, EKeys::End ) );
UI_COMMAND( AlignPivotToFloor, "Align Pivot to Floor", "Aligns the actor with the floor at its pivot point", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapBottomCenterBoundsToFloor, "Snap Bottom Center Bounds to Floor", "Snaps the actor to the floor at its bottom center bounds", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Shift, EKeys::End ) );
UI_COMMAND( AlignBottomCenterBoundsToFloor, "Align Bottom Center Bounds to Floor", "Aligns the actor with the floor at its bottom center bounds", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapOriginToActor, "Snap Origin to Actor", "SNaps the actor to another actor at its origin", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( AlignOriginToActor, "Align Origin to Actor", "Aligns the actor to another actor at its origin", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapToActor, "Snap to Actor", "Snaps the actor to another actor", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( AlignToActor, "Align to Actor", "Aligns the actor with another actor", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapPivotToActor, "Snap Pivot to Actor", "Snaps the actor to another actor at its pivot point", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( AlignPivotToActor, "Align Pivot to Actor", "Aligns the actor with another actor at its pivot point", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SnapBottomCenterBoundsToActor, "Snap Bottom Center Bounds to Actor", "Snaps the actor to another actor at its bottom center bounds", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( AlignBottomCenterBoundsToActor, "Align Bottom Center Bounds to Actor", "Aligns the actor with another actor at its bottom center bounds", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( DeltaTransformToActors, "Delta Transform", "Apply Delta Transform to selected actors", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MirrorActorX, "Mirror X", "Mirrors the actor along the X axis", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MirrorActorY, "Mirror Y", "Mirrors the actor along the Y axis", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MirrorActorZ, "Mirror Z", "Mirrors the actor along the Z axis", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( LockActorMovement, "Lock Actor Movement", "Locks the actor so it cannot be moved", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( DetachFromParent, "Detach", "Detach the actor from its parent", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( AttachSelectedActors, "Attach Selected Actors", "Attach the selected actors to the last selected actor", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Alt, EKeys::B) );
UI_COMMAND( AttachActorIteractive, "Attach Actor Interactive", "Start an interactive actor picker to let you choose a parent for the currently selected actor", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Alt, EKeys::A) );
UI_COMMAND( CreateNewOutlinerFolder, "Create Folder", "Place the selected actors in a new folder", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( HoldToEnableVertexSnapping, "Hold to Enable Vertex Snapping", "When the key binding is pressed and held vertex snapping will be enabled", EUserInterfaceActionType::ToggleButton, FInputChord(EKeys::V) );
//@ todo Slate better tooltips for pivot options
UI_COMMAND( SavePivotToPrePivot, "Set as Pivot Offset", "Sets the current pivot location as the pivot offset for this actor", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ResetPrePivot, "Reset Pivot Offset", "Resets the pivot offset for this actor", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ResetPivot, "Reset Pivot", "Resets the pivot", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MovePivotHere, "Set Pivot Offset Here", "Sets the pivot offset to the clicked location", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MovePivotHereSnapped, "Set Pivot Offset Here (Snapped)", "Sets the pivot offset to the nearest grid point to the clicked location", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MovePivotToCenter, "Center on Selection", "Centers the pivot to the middle of the selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ConvertToAdditive, "Additive", "Converts the selected brushes to additive brushes", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ConvertToSubtractive, "Subtractive", "Converts the selected brushes to subtractive brushes", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( OrderFirst, "To First", "Changes the drawing order of the selected brushes so they are the first to draw", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( OrderLast, "To Last", "Changes the drawing order of the selected brushes so they are the last to draw", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MakeSolid, "Solid", "Makes the selected brushes solid", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MakeSemiSolid, "Semi-Solid", "Makes the selected brushes semi-solid", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MakeNonSolid, "Non-Solid", "Makes the selected brushes non-solid", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( MergePolys, "Merge", "Merges multiple polygons on a brush face into as few as possible", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SeparatePolys, "Separate", "Reverses the effect of a previous merge", EUserInterfaceActionType::Button, FInputChord() );
// RegroupActors uses GroupActors for it's label and tooltip when simply grouping a selection of actors using overrides. This is to provide display of the chord which is the same for both.
UI_COMMAND( GroupActors, "Group", "Groups the selected actors", EUserInterfaceActionType::Button, FInputChord( /*EKeys::G, EModifierKey::Control*/ ) );
UI_COMMAND( RegroupActors, "Regroup", "Regroups the selected actors into a new group, removing any current groups in the selection", EUserInterfaceActionType::Button, FInputChord( EKeys::G, EModifierKey::Control ) );
UI_COMMAND( UngroupActors, "Ungroup", "Ungroups the selected actors", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Shift, EKeys::G ) );
UI_COMMAND( AddActorsToGroup, "Add to Group", "Adds the selected actors to the selected group", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( RemoveActorsFromGroup, "Remove from Group", "Removes the selected actors from the selected groups", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( LockGroup, "Lock", "Locks the selected groups", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( UnlockGroup, "Unlock", "Unlocks the selected groups", EUserInterfaceActionType::Button, FInputChord() );
#if PLATFORM_MAC
UI_COMMAND( ShowAll, "Show All Actors", "Shows all actors", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Command, EKeys::H ) );
#else
UI_COMMAND( ShowAll, "Show All Actors", "Shows all actors", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Control, EKeys::H ) );
#endif
UI_COMMAND( ShowSelectedOnly, "Show Only Selected", "Shows only the selected actors", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ShowSelected, "Show Selected", "Shows the selected actors", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Shift, EKeys::H ) );
UI_COMMAND( HideSelected, "Hide Selected", "Hides the selected actors", EUserInterfaceActionType::Button, FInputChord( EKeys::H ) );
UI_COMMAND( ShowAllStartup, "Show All At Startup", "Shows all actors at startup", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ShowSelectedStartup, "Show Selected At Startup", "Shows selected actors at startup", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( HideSelectedStartup, "Hide Selected At Startup", "Hide selected actors at startup", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( CycleNavigationDataDrawn, "Cycle Navigation Data Drawn", "Cycles through navigation data (navmeshes for example) to draw one at a time", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Alt, EKeys::N ) );
UI_COMMAND( SelectNone, "Unselect All", "Unselects all actors", EUserInterfaceActionType::Button, FInputChord( EKeys::Escape ) ) ;
UI_COMMAND( InvertSelection, "Invert Selection", "Inverts the current selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectAllActorsOfSameClass, "Select All Actors of Same Class", "Selects all the actors that have the same class", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift|EModifierKey::Control, EKeys::A) );
UI_COMMAND( SelectAllActorsOfSameClassWithArchetype, "Select All Actors with Same Archetype", "Selects all the actors of the same class that have the same archetype", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectComponentOwnerActor, "Select Component Owner", "Select the actor that owns the currently selected component(s)", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectRelevantLights, "Select Relevant Lights", "Select all lights relevant to the current selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectStaticMeshesOfSameClass, "Select All Using Selected Static Meshes (Selected Actor Types)", "Selects all actors with the same static mesh and actor class as the selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectOwningHierarchicalLODCluster, "Select Owning Hierarchical LOD cluster Using Selected Static Mesh (Selected Actor Types)", "Select Owning Hierarchical LOD cluster for the selected actor", EUserInterfaceActionType::Button, FInputChord());
UI_COMMAND( SelectStaticMeshesAllClasses, "Select All Using Selected Static Meshes (All Actor Types)", "Selects all actors with the same static mesh as the selection", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Shift, EKeys::E ) );
UI_COMMAND( SelectSkeletalMeshesOfSameClass, "Select All Using Selected Skeletal Meshes (Selected Actor Types)", "Selects all actors with the same skeletal mesh and actor class as the selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectSkeletalMeshesAllClasses, "Select All Using Selected Skeletal Meshes (All Actor Types)", "Selects all actors with the same skeletal mesh as the selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectAllWithSameMaterial, "Select All With Same Material", "Selects all actors with the same material as the selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectMatchingEmitter, "Select All Matching Emitters", "Selects all emitters with the same particle system as the selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectAllLights, "Select All Lights", "Selects all lights", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectStationaryLightsExceedingOverlap, "Select Stationary Lights exceeding overlap", "Selects all stationary lights exceeding the overlap limit", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectAllAddditiveBrushes, "Select All Additive Brushes", "Selects all additive brushes", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectAllSubtractiveBrushes, "Select All Subtractive Brushes", "Selects all subtractive brushes", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectAllActorsControlledByMatinee, "Select Actors Used by This Matinee", "Selects all actors controlled by this Matinee", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SelectAllSurfaces, "Select All Surfaces", "Selects all bsp surfaces", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::S) );
UI_COMMAND( SurfSelectAllMatchingBrush, "Select Matching Brush", "Selects the surfaces belonging to the same brush as the selected surfaces", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::B) );
UI_COMMAND( SurfSelectAllMatchingTexture, "Select Matching Material", "Selects all surfaces with the same material as the selected surfaces", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::T) );
UI_COMMAND( SurfSelectAllAdjacents, "Select All Adjacent Surfaces", "Selects all surfaces adjacent to the currently selected surfaces", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::J) );
UI_COMMAND( SurfSelectAllAdjacentCoplanars, "Select All Coplanar Surfaces", "Selects all surfaces adjacent and coplanar with the selected surfaces", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::C) );
UI_COMMAND( SurfSelectAllAdjacentWalls, "Select All Adjacent Wall Surfaces", "Selects all adjacent upright surfaces", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::W) );
UI_COMMAND( SurfSelectAllAdjacentFloors, "Select All Adjacent Floor Surfaces", "Selects all adjacent floor sufaces(ones with normals pointing up)", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::U) );
UI_COMMAND( SurfSelectAllAdjacentSlants, "Select All Adjacent Slant Surfaces", "Selects all adjacent slant surfaces (surfaces that are not walls, floors, or ceilings according to their normals) to the currently selected surfaces.", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::Y) );
UI_COMMAND( SurfSelectReverse, "Invert Surface Selection", "Inverts the current surface selection", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::Q) );
UI_COMMAND( SurfSelectMemorize, "Memorize Surface Selection", "Stores the current surface selection in memory", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::M) );
UI_COMMAND( SurfSelectRecall, "Recall Surface Selection", "Replace the current selection with the selection saved in memory", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::R) );
UI_COMMAND( SurfSelectOr, "Surface Selection OR", "Replace the current selection with only the surfaces which are both currently selected and contained within the saved selection in memory", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::O) );
UI_COMMAND( SurfSelectAnd, "Surface Selection AND", "Add the selection of surfaces saved in memory to the current selection", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::A) );
UI_COMMAND( SurfSelectXor, "Surace Selection XOR", " Replace the current selection with only the surfaces that are not in both the current selection and the selection saved in memory", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Shift, EKeys::X) );
UI_COMMAND( SurfUnalign, "Align Surface Default", "Default surface alignment", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SurfAlignPlanarAuto, "Align Surface Planar", "Planar surface alignment", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SurfAlignPlanarWall, "Align Surface Planar Wall", "Planar wall surface alignment", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SurfAlignPlanarFloor, "Align Surface Planar Floor", "Planar floor surface alignment", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SurfAlignBox, "Align Surface Box", "Box surface alignment", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( SurfAlignFit, "Align Surface Fit", "Best fit surface alignment", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ApplyMaterialToSurface, "Apply Material to Surface Selection", "Applies the selected material to the selected surfaces", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( CreateBoundingBoxVolume, "Create Bounding Box Blocking Volume From Mesh", "Create a bounding box blocking volume from the static mesh", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( CreateHeavyConvexVolume, "Heavy Convex Blocking Volume From Mesh", "Creates a heavy convex blocking volume from the static mesh", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( CreateNormalConvexVolume, "Normal Convex Blocking Volume From Mesh", "Creates a normal convex blocking volume from the static mesh", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( CreateLightConvexVolume, "Light Convex Blocking Volume From Mesh", "Creates a light convex blocking volume from the static mesh", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( CreateRoughConvexVolume, "Rought Convex Blocking Volume From Mesh", "Creates a rough convex blocking volume from the static mesh", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( KeepSimulationChanges, "Keep Simulation Changes", "Saves the changes made to this actor in Simulate mode to the actor's default state.", EUserInterfaceActionType::Button, FInputChord( EKeys::K ) );
UI_COMMAND( MakeActorLevelCurrent, "Make Selected Actor's Level Current", "Makes the selected actor's level the current level", EUserInterfaceActionType::Button, FInputChord( EKeys::M ) );
#if PLATFORM_MAC
UI_COMMAND( MoveSelectedToCurrentLevel, "Move Selection to Current Level", "Moves the selected actors to the current level", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Command, EKeys::M ) );
#else
UI_COMMAND( MoveSelectedToCurrentLevel, "Move Selection to Current Level", "Moves the selected actors to the current level", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Control, EKeys::M ) );
#endif
UI_COMMAND( FindActorLevelInContentBrowser, "Find Actor Level in Content Browser", "Finds the selected actors' level in the content browser", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( FindLevelsInLevelBrowser, "Find Levels in Level Browser", "Finds the selected actors' levels in the level browser", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( AddLevelsToSelection, "Add Levels to Selection", "Adds the selected actors' levels to the current level browser selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( RemoveLevelsFromSelection, "Remove Levels from Selection", "Removes the selected actors' levels from the current level browser selection", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( FindActorInLevelScript, "Find in Level Blueprint", "Finds any references to the selected actor in its level's blueprint", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( WorldProperties, "World Settings", "Displays the world settings", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( OpenContentBrowser, "Open Content Browser", "Opens the Content Browser", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Control|EModifierKey::Shift, EKeys::F) );
UI_COMMAND( OpenMarketplace, "Open Marketplace", "Opens the Marketplace", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( AddMatinee, "Add Matinee [Legacy]", "Creates a new matinee actor to edit", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( EditMatinee, "Edit Matinee", "Selects a Matinee to edit", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ToggleVR, "Toggle VR", "Toggles VR (Virtual Reality) mode", EUserInterfaceActionType::ToggleButton, FInputChord( EModifierKey::Alt, EKeys::Tilde ) );
UI_COMMAND( OpenLevelBlueprint, "Open Level Blueprint", "Edit the Level Blueprint for the current level", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( CheckOutProjectSettingsConfig, "Check Out", "Checks out the project settings config file so the game mode can be set.", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( CreateBlankBlueprintClass, "New Empty Blueprint Class...", "Create a new Blueprint Class", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ConvertSelectionToBlueprintViaHarvest, "Convert Selected Components to Blueprint Class...", "Replace all of the selected actors with a new Blueprint Class based on Actor that contains the components", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ConvertSelectionToBlueprintViaSubclass, "Convert Selected Actor to Blueprint Class...", "Replace the selected actor with a new Blueprint subclass based on the class of the selected Actor", EUserInterfaceActionType::Button, FInputChord() );
UI_COMMAND( ShowTransformWidget, "Show Transform Widget", "Toggles the visibility of the transform widgets", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( AllowTranslucentSelection, "Allow Translucent Selection", "Allows translucent objects to be selected", EUserInterfaceActionType::ToggleButton, FInputChord(EKeys::T) );
UI_COMMAND( AllowGroupSelection, "Allow Group Selection", "Allows actor groups to be selected", EUserInterfaceActionType::ToggleButton, FInputChord(EModifierKey::Control|EModifierKey::Shift, EKeys::G) );
UI_COMMAND( StrictBoxSelect, "Strict Box Selection", "When enabled an object must be entirely encompassed by the selection box when marquee box selecting", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( TransparentBoxSelect, "Box Select Occluded Objects", "When enabled, marquee box select operations will also select objects that are occluded by other objects.", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( DrawBrushMarkerPolys, "Draw Brush Polys", "Draws semi-transparent polygons around a brush when selected", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( OnlyLoadVisibleInPIE, "Only Load Visible Levels in Game Preview", "If enabled, when game preview starts, only visible levels will be loaded", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( ToggleSocketSnapping, "Enable Socket Snapping", "Enables or disables snapping to sockets", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( ToggleParticleSystemLOD, "Enable Particle System LOD Switching", "If enabled particle systems will use distance LOD switching in perspective viewports", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( ToggleFreezeParticleSimulation, "Freeze Particle Simulation", "If enabled particle systems will freeze their simulation state", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( ToggleParticleSystemHelpers, "Toggle Particle System Helpers", "Toggles showing particle system helper widgets in viewports", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( ToggleLODViewLocking, "Enable LOD View Locking", "If enabled viewports of the same type will use the same LOD", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( LevelStreamingVolumePrevis, "Enable Automatic Level Streaming", "If enabled, the viewport will stream in levels automatically when the camera is moved", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( EnableActorSnap, "Enable Actor Snapping", "If enabled, actors will snap to the location of other actors when they are within distance", EUserInterfaceActionType::ToggleButton, FInputChord(EModifierKey::Control|EModifierKey::Shift, EKeys::K) );
UI_COMMAND( EnableVertexSnap, "Enable Vertex Snapping","If enabled, actors will snap to the location of the nearest vertex on another actor in the direction of movement", EUserInterfaceActionType::ToggleButton, FInputChord() );
UI_COMMAND( ToggleHideViewportUI, "Hide Viewport UI", "Toggles hidden viewport UI mode. Hides all overlaid viewport UI widgets", EUserInterfaceActionType::ToggleButton, FInputChord() );
//if (FParse::Param( FCommandLine::Get(), TEXT( "editortoolbox" ) ))
//{
// UI_COMMAND( BspMode, "Enable Bsp Mode", "Enables BSP mode", EUserInterfaceActionType::ToggleButton, FInputChord( EModifierKey::Shift, EKeys::One ) );
// UI_COMMAND( MeshPaintMode, "Enable Mesh Paint Mode", "Enables mesh paint mode", EUserInterfaceActionType::ToggleButton, FInputChord( EModifierKey::Shift, EKeys::Two ) );
// UI_COMMAND( LandscapeMode, "Enable Landscape Mode", "Enables landscape editing", EUserInterfaceActionType::ToggleButton, FInputChord( EModifierKey::Shift, EKeys::Three ) );
// UI_COMMAND( FoliageMode, "Enable Foliage Mode", "Enables foliage editing", EUserInterfaceActionType::ToggleButton, FInputChord( EModifierKey::Shift, EKeys::Four ) );
//}
UI_COMMAND( ShowSelectedDetails, "Show Actor Details", "Opens a details panel for the selected actors", EUserInterfaceActionType::Button, FInputChord( EKeys::F4 ) );
UI_COMMAND( RecompileShaders, "Recompile Changed Shaders", "Recompiles shaders which are out of date", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Shift|EModifierKey::Control, EKeys::Period ) );
UI_COMMAND( ProfileGPU, "Profile GPU", "Profiles the GPU for the next frame and opens a window with profiled data", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Shift|EModifierKey::Control, EKeys::Comma ) );
UI_COMMAND( ResetAllParticleSystems, "Reset All Particle Systems", "Resets all particle system emitters (removes all active particles and restarts them)", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Shift, EKeys::Slash ) );
UI_COMMAND( ResetSelectedParticleSystem, "Resets Selected Particle Systems" , "Resets selected particle system emitters (removes all active particles and restarts them)", EUserInterfaceActionType::Button, FInputChord( EKeys::Slash ) );
UI_COMMAND( SelectActorsInLayers, "Select all actors in selected actor's layers", "Selects all actors belonging to the layers of the currently selected actors", EUserInterfaceActionType::Button, FInputChord( EModifierKey::Control, EKeys::L ) );
UI_COMMAND( FocusAllViewportsToSelection, "Focus Selected Actors in All Viewports", "Moves the camera in front of the selected actors in all open viewports", EUserInterfaceActionType::Button, FInputChord( EKeys::F, EModifierKey::Shift ) );
UI_COMMAND(MaterialQualityLevel_Low, "Low", "Sets material quality in the scene to low.", EUserInterfaceActionType::RadioButton, FInputChord());
UI_COMMAND(MaterialQualityLevel_Medium, "Medium", "Sets material quality in the scene to medium.", EUserInterfaceActionType::RadioButton, FInputChord());
UI_COMMAND(MaterialQualityLevel_High, "High", "Sets material quality in the scene to high.", EUserInterfaceActionType::RadioButton, FInputChord());
UI_COMMAND(PreviewPlatformOverride_DefaultES2, "Default Mobile / HTML5 Preview", "Use default mobile settings (no quality overrides).", EUserInterfaceActionType::RadioButton, FInputChord());
UI_COMMAND(PreviewPlatformOverride_AndroidES2, "Android Preview", "Mobile preview using Android's quality settings.", EUserInterfaceActionType::RadioButton, FInputChord());
UI_COMMAND(PreviewPlatformOverride_IOSES2, "iOS ES2 Preview", "Mobile preview using iOS's OpenGL ES2 quality settings.", EUserInterfaceActionType::RadioButton, FInputChord());
UI_COMMAND( ConnectToSourceControl, "Connect to Source Control...", "Opens a dialog to connect to source control.", EUserInterfaceActionType::Button, FInputChord());
UI_COMMAND( ChangeSourceControlSettings, "Change Source Control Settings...", "Opens a dialog to change source control settings.", EUserInterfaceActionType::Button, FInputChord());
UI_COMMAND( CheckOutModifiedFiles, "Check Out Modified Files...", "Opens a dialog to check out any assets which have been modified.", EUserInterfaceActionType::Button, FInputChord());
UI_COMMAND( SubmitToSourceControl, "Submit to Source Control...", "Opens a dialog with check in options for content and levels.", EUserInterfaceActionType::Button, FInputChord());
static const FText FeatureLevelLabels[ERHIFeatureLevel::Num] =
{
NSLOCTEXT("LevelEditorCommands", "FeatureLevelPreviewType_ES2", "Mobile / HTML5"),
NSLOCTEXT("LevelEditorCommands", "FeatureLevelPreviewType_ES31", "High-End Mobile / Metal"),
NSLOCTEXT("LevelEditorCommands", "FeatureLevelPreviewType_SM4", "Shader Model 4"),
NSLOCTEXT("LevelEditorCommands", "FeatureLevelPreviewType_SM5", "Shader Model 5"),
};
static const FText FeatureLevelToolTips[ERHIFeatureLevel::Num] =
{
NSLOCTEXT("LevelEditorCommands", "FeatureLevelPreviewTooltip_ES2", "OpenGLES 2"),
NSLOCTEXT("LevelEditorCommands", "FeatureLevelPreviewTooltip_ES3", "OpenGLES 3.1, Metal"),
NSLOCTEXT("LevelEditorCommands", "FeatureLevelPreviewTooltip_SM4", "DirectX 10, OpenGL 3.3+"),
NSLOCTEXT("LevelEditorCommands", "FeatureLevelPreviewTooltip_SM5", "DirectX 11, OpenGL 4.3+, PS4, XB1"),
};
for (int32 i = 0; i < ERHIFeatureLevel::Num; ++i)
{
FName Name;
GetFeatureLevelName((ERHIFeatureLevel::Type)i, Name);
FeatureLevelPreview[i] =
FUICommandInfoDecl(
this->AsShared(),
Name,
FeatureLevelLabels[i],
FeatureLevelToolTips[i])
.UserInterfaceType(EUserInterfaceActionType::RadioButton)
.DefaultChord(FInputChord());
}
}
PRAGMA_ENABLE_OPTIMIZATION
#undef LOCTEXT_NAMESPACE