Announcement

Collapse
No announcement yet.

[Tutorial] Intro to Editor Customization with Plugins

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Tutorial] Intro to Editor Customization with Plugins

    Greetings!

    This is a tutorial I put together when I finally figured how to extend the editor's UI and add new functionalities. In this example, I simply add a button to the toolbar and let it display a log message. This tutorial should serve as a foundation for those who want to add new stuff to the editor via plugins.

    You can watch a quick video demonstration here:



    You can download the complete source code and go through the tutorial I wrote to help you understand what's going on in the source code:

    Download Link

    If you have any questions, feel free to ask!
    Last edited by LordNyte; 04-15-2014, 08:22 AM.
    Hamad Al-Hasan
    Gameplay Programmer / Technical Artist
    Portfolio: www.alhasanstudio.com

    #2
    Hey guys, just letting you know that I forgot to include a bug solution within the engine that I found while I was figuring stuff up. I updated the tutorial link above. Please make sure you read the last section "Important Notes" so you know what to do.
    Hamad Al-Hasan
    Gameplay Programmer / Technical Artist
    Portfolio: www.alhasanstudio.com

    Comment


      #3
      Nice tutorial, seenooh!!! *Handsup*

      Comment


        #4


        Btw guys, according to Epic, the bug I've mentioned is fixed but will be available as of 4.2.0. The solution will be a bit different than what I've done.

        More details: https://answers.unrealengine.com/que...onstructo.html

        In any case, you can simply comment out line 53 in HamadsPlugin.cpp, as it is not an important step.
        Hamad Al-Hasan
        Gameplay Programmer / Technical Artist
        Portfolio: www.alhasanstudio.com

        Comment


          #5
          I was trying your code and TCommands seem to be obsolete as well as UICOMMAND definition.

          https://docs.unrealengine.com/latest...nds/index.html

          Is it possible? Do you know another way to bind a command to a button for example? Any workaround?

          Thank you in advance.
          Last edited by eduilnero; 06-26-2014, 04:03 AM.

          Comment


            #6
            Great tutorial thanks!

            Comment


              #7
              Howdy seenooh,

              Great work on your tutorial about editor customization. Would you mind posting this on our wiki page? This would ensure that other users wanting to learn about Editor Customization with plugins could follow your tutorials. Here is link to the wiki: https://wiki.unrealengine.com/Category:Community_Videos. Nevertheless, great work and I can't wait to give this a shot when I get some down time.

              Thanks and have a great day!

              Comment


                #8
                Hi again. I was mistaken. But I still had the problem when compiling your example, which is really great and helped me a lot, for new version 4.2.1. But finally I did it so I would like to help others with same problem too.

                HamadsPlugin.h

                Code:
                #pragma once
                 
                #include "ModuleManager.h" 
                #include "LevelEditor.h"
                #include "LevelEditorActions.h"
                #include "SharedPointer.h"
                #include "FHamadsPluginCommands.h"
                #include "Internationalization.h"
                #include "Slate.h"
                #include "MultiBoxExtender.h"
                #include "HamadsPluginPrivatePCH.h"
                
                #define LOCTEXT_NAMESPACE "HamadsPlugin"
                
                DEFINE_LOG_CATEGORY(MyPlugin);
                
                class HamadsPluginModule : public IModuleInterface
                {
                public:
                
                	/** IModuleInterface implementation */
                	virtual void StartupModule() OVERRIDE;
                	virtual void ShutdownModule() OVERRIDE;
                
                	void MyButton_Clicked();
                	
                
                private: 
                	void AddToolbarExtension(FToolBarBuilder &);
                
                	TSharedPtr<FUICommandList> MyPluginCommands;
                	TSharedPtr<FExtensibilityManager> MyExtensionManager;
                	TSharedPtr<const FExtensionBase> ToolbarExtension;
                	TSharedPtr<FExtender> ToolbarExtender;
                };
                HamadsPluginPrivatePCH.h

                Code:
                // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
                #pragma once
                
                #include "CoreUObject.h"
                #include "ModuleManager.h"
                #include "Engine.h"
                #include "UnrealEd.h"
                #include "Slate.h"
                
                DECLARE_LOG_CATEGORY_EXTERN(MyPlugin, Log, All);
                HamadsPlugin.Build.cs

                Code:
                using System.IO;
                 
                public class HamadsPlugin : ModuleRules
                {
                    public HamadsPlugin(TargetInfo Target)
                    {
                        PrivateIncludePaths.AddRange(new string[] { "HamadsPlugin/Private" });
                        PublicIncludePaths.AddRange(new string[] { "HamadsPlugin/Public" });
                
                        PublicDependencyModuleNames.AddRange(new string[] { "Engine", "Core", "LevelEditor", "Slate", "EditorStyle" });
                        PrivateDependencyModuleNames.AddRange(
                                new string[]
                				{
                                    "Slate", 
                                    "SlateCore",
                                    "EditorStyle",
                					"Projects",
                					"UnrealEd"
                				}
                                );
                    }
                }
                FHamadsPluginCommands.h
                Code:
                #include "Slate.h"
                
                class FHamadsPluginCommands : public TCommands<FHamadsPluginCommands>
                {
                public:
                
                	FHamadsPluginCommands()
                		: TCommands<FHamadsPluginCommands>(TEXT("HamadsPlugin"), NSLOCTEXT("Contexts", "HamadsPlugin", "Hamads Plugin"), NAME_None, FEditorStyle::GetStyleSetName())
                	{	}
                
                	virtual void RegisterCommands() OVERRIDE;
                
                	TSharedPtr< FUICommandInfo > MyButton;
                };
                Last edited by eduilnero; 06-27-2014, 06:44 AM.

                Comment


                  #9
                  Maybe it's just me but that part doesnt seems to work with the 4.5
                  Code:
                  TSharedPtr<const FExtensionBase> ToolbarExtension;
                  If anyone have a solution it's would be great

                  Comment


                    #10
                    After a lot of fixing I got Hamood's to work on 4.7.0

                    Comment


                      #11
                      I have another example derrived initially from Hamad's plugin. It corrects some errors, and more important, shows how to make a dockable tab plugin in the editor.

                      https://forums.unrealengine.com/show...d-Unreal-4-7-0

                      Comment


                        #12
                        The download link is not working anymore LordNyte

                        Comment

                        Working...
                        X