Files
UnrealEngineUWP/Engine/Source/Editor/TextureEditor/Private/TextureEditorModule.cpp

113 lines
3.6 KiB
C++
Raw Normal View History

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "Engine/Texture.h"
#include "Toolkits/AssetEditorToolkit.h"
#include "Interfaces/ITextureEditorToolkit.h"
#include "Interfaces/ITextureEditorModule.h"
#include "PropertyEditorModule.h"
#include "TextureEditorSettings.h"
#include "TextureEditorToolkit.h"
#include "ISettingsModule.h"
#include "Customizations/TextureDetailsCustomization.h"
#include "Customizations/CurveLinearColorAtlasDetailsCustomization.h"
#define LOCTEXT_NAMESPACE "FTextureEditorModule"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
extern const FName TextureEditorAppIdentifier = FName(TEXT("TextureEditorApp"));
/*-----------------------------------------------------------------------------
FTextureEditorModule
-----------------------------------------------------------------------------*/
class FTextureEditorModule
: public ITextureEditorModule
{
public:
// ITextureEditorModule interface
virtual TSharedRef<ITextureEditorToolkit> CreateTextureEditor( const EToolkitMode::Type Mode, const TSharedPtr< IToolkitHost >& InitToolkitHost, UTexture* Texture ) override
{
TSharedRef<FTextureEditorToolkit> NewTextureEditor(new FTextureEditorToolkit());
NewTextureEditor->InitTextureEditor(Mode, InitToolkitHost, Texture);
return NewTextureEditor;
}
virtual TSharedPtr<FExtensibilityManager> GetMenuExtensibilityManager( ) override
{
return MenuExtensibilityManager;
}
virtual TSharedPtr<FExtensibilityManager> GetToolBarExtensibilityManager( ) override
{
return ToolBarExtensibilityManager;
}
public:
// IModuleInterface interface
virtual void StartupModule( ) override
{
// register menu extensions
MenuExtensibilityManager = MakeShareable(new FExtensibilityManager);
ToolBarExtensibilityManager = MakeShareable(new FExtensibilityManager);
// register settings
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
if (SettingsModule != nullptr)
{
SettingsModule->RegisterSettings("Editor", "ContentEditors", "TextureEditor",
LOCTEXT("TextureEditorSettingsName", "Texture Editor"),
LOCTEXT("TextureEditorSettingsDescription", "Configure the look and feel of the Texture Editor."),
GetMutableDefault<UTextureEditorSettings>()
);
}
FPropertyEditorModule& PropertyModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
PropertyModule.RegisterCustomClassLayout("Texture", FOnGetDetailCustomizationInstance::CreateStatic(&FTextureDetails::MakeInstance));
PropertyModule.RegisterCustomClassLayout("CurveLinearColorAtlas", FOnGetDetailCustomizationInstance::CreateStatic(&FCurveLinearColorAtlasDetails::MakeInstance));
}
virtual void ShutdownModule( ) override
{
// unregister settings
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
if (SettingsModule != nullptr)
{
SettingsModule->UnregisterSettings("Editor", "ContentEditors", "TextureEditor");
}
// unregister menu extensions
MenuExtensibilityManager.Reset();
ToolBarExtensibilityManager.Reset();
FPropertyEditorModule& PropertyModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden Change 2889481 on 2016/03/02 by Richard.TalbotWatkin Fixed socket preview component in Static Mesh Editor so that it remains correctly attached if the socket is renamed (Contributed by Manny-MADE). PR #2094 #jira UE-27338 - GitHub 2094 : BUGFIX: Socket preview component broken in Static Mesh Editor FSlateAtlasedTextureResource Made changes to the Perforce source control provider so that operations can be cancelled with immediate effect if there is an issue connecting to the server. #jira UE-24632 - "Updating file(s) source control status..." dialog doesn't allow Cancel #RB Thomas.Sarkanen Change 2890359 on 2016/03/02 by Nick.Darnell Jira Mirroring - Adding some tools for matching gits sha to perforce commits. Also adding the program for scraping jira issues and pushing them elsewhere. Change 2892008 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2813475 Change 2892086 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2813457 Change 2892117 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2812830 Change 2892316 on 2016/03/03 by Richard.TalbotWatkin Fixed conversion of brushes to volumes so that the original transform isn't lost. #jira UE-24404 - Convert Actor from BSP to volume can affect the actor transform Change 2892765 on 2016/03/03 by Andrew.Rodham Changed public facing level editor classes to use ILevelEditor instead of SLevelEditor #codereview Mike.Fricker Change 2894154 on 2016/03/04 by Richard.TalbotWatkin Fixed error in USplineComponent::GetSegmentLength when the segment is linear or constant. Change 2894481 on 2016/03/04 by Cody.Albert #jira UE-27830 Fixed mismatched layout name Change 2896339 on 2016/03/06 by Richard.TalbotWatkin Fixed undo issues in texture paint mode. #jira UE-21206 - Texture Painting bugs Change 2896713 on 2016/03/07 by Joe.Conley Replacing #ifndef with #pragma once Change 2896955 on 2016/03/07 by Cody.Albert #jira UE-27711 Added initialization for LastHighlightInteractionTime Change 2898895 on 2016/03/08 by Richard.TalbotWatkin More optimizations to editing actors with a large number of components. Improved performance when executing construction scripts. #jira UE-24821 - Blueprints with thousands of components perform very badly when selected in the Level Viewport Change 2900770 on 2016/03/09 by Joe.Conley Change #ifndef to #pragma once for headers under Runtime/Engine/Public Change 2900835 on 2016/03/09 by Richard.TalbotWatkin Fixed issues with scrolling items into view in STileView. Also fixed bugs in STileView::ReGenerateItems. #jira UE-20441 - Hitting F2 to rename an asset in the Content Browser moves the asset out of view if the CB is at default size and location #jira UE-20807 - Browse to Asset in Content Browser focuses just on the text #codereview Nick.Atamas Change 2900837 on 2016/03/09 by Richard.TalbotWatkin Added an OnKeyDownHandler to SSearchBox and SAssetSearchBox so that functionality for handling keypresses which is normally handled by SEditableText can be overridden. Added custom behavior to SAssetPicker and SAssetSearchBox so that up/down cursor keys can be used to change focus from the text box to the menu. #jira UE-20567 - UX Regression on Open Asset Panel This also addresses a similar issue with the auto-complete popup in the Content Browser search bar. Change 2900847 on 2016/03/09 by Richard.TalbotWatkin Fixed include dependency. Change 2900951 on 2016/03/09 by Richard.TalbotWatkin Fixed non-dependent name lookup for superclass member access. Change 2901325 on 2016/03/09 by Jamie.Dale PR #2107: Output Log Filtering (Contributed by phoboz-net) Change 2901391 on 2016/03/09 by Jamie.Dale Some more output log filter improvements We now defer the search until you finish typing, and the filter list itself now uses toggle buttons (like the content browser) so that you can toggle multiple filters without having to re-open the menu. Change 2901736 on 2016/03/09 by Alexis.Matte #jira UE-14632 Export staticmeshactor which are base on blueprint class as a blueprint instead of exporting it as an actor. #codereview nick.darnell Change 2903162 on 2016/03/10 by Alexis.Matte Fbx scene importer, Fix crash when changing the material base path in the material tab page #codereview nick.darnell Change 2903903 on 2016/03/10 by Richard.TalbotWatkin Fixed crash when attempting to paste an object from the level viewport into the content browser. #jira UE-26100 - Crash when attempting to copy an object from the world into the content browser Change 2903947 on 2016/03/10 by Richard.TalbotWatkin [CL 2937134 by Nick Darnell in Main branch]
2016-04-07 16:16:52 -04:00
PropertyModule.UnregisterCustomClassLayout("Texture");
PropertyModule.UnregisterCustomClassLayout("CurveLinearColorAtlas");
}
private:
// Holds the menu extensibility manager.
TSharedPtr<FExtensibilityManager> MenuExtensibilityManager;
// Holds the tool bar extensibility manager.
TSharedPtr<FExtensibilityManager> ToolBarExtensibilityManager;
};
IMPLEMENT_MODULE(FTextureEditorModule, TextureEditor);
#undef LOCTEXT_NAMESPACE