What is the proper method for extending the Editor Engine?
I have successfully extended the editor engine to our own version which compiles and works fine in the editor.
But I am having issues getting it to compile for the standalone build (development or debug).
Whats the intended work flow for extending the editor engine (and editor classes in general) for standalone builds. I imagine the idea is to not include them, but how do I stop my class from being automatically picked up in that case?
I tried to use the WITH_EDITOR define, but it seems I have to keep some part of the class definition there and that requires knowing what UUnrealEdEngine is.
Here is the class definition:
I also have the "UnrealEd" module in my PublicDependencyModuleNames
Has anyone succesfully include an extension to the editor engine and got the non editor build compiling?
You're going to want to make a new module to build your editor specific code, so that it's separate from your game code. Unfortunately we don't seem to have an example/sample which does this, however I'll try and walk you through it as best I can.
If you go to the Source folder for your project, you'll notice you have two .Target.cs files; in my case I'm going to pretend your project is called "MyCodeProject" (replace as appropriate), so you'd see:
If you open up these files, you'll notice that they both output a single module from SetupBinaries, what we're going to do is add an extra module called "MyCodeProjectEditor" to contain your editor code.
Open MyCodeProject.Target.cs and in SetupBinaries add the following:
Open MyCodeProjectEditor.Target.cs and in SetupBinaries add the following:
Now, inside your Source folder, create a new folder called "MyCodeProjectEditor", and copy the following files from the "MyCodeProject" folder, into "MyCodeProjectEditor" folder:
Rename these files in the "MyCodeProjectEditor" folder so you see:
Open MyCodeProjectEditor.Build.cs and rename the class from "MyCodeProject" to "MyCodeProjectEditor".
Open MyCodeProjectEditor.cpp, and fix the include name, and then change the macro which implements the module to be:
Finally you need to update your .uproject file so that it knows about your new module, so open that up in some form of competent text editor (eg, Notepad++), and adjust the "Modules" section so that it contains your new editor module; when you're finished, it would look something like this:
If you re-generate your projects and build, you should hopefully now have a separate editor module. You'll be able to use this module to contain your editor specific code (move the editor dependencies into the MyCodeProjectEditor.Build.cs file, and move the editor specific code into that module folder).
You'll probably also want to add "MyCodeProject" to the PublicDependencyModuleNames in your MyCodeProjectEditor.Build.cs file, as this will allow your editor module access to your game code.
Follow this question
Once you sign in you will be able to subscribe for any updates here