How do you iterate on an Editor Module?

TL;DR

How do I structure an Editor module to allow a developer to see changes (i.e. Slate code) without restarting UE4 after every compile?

Edit: Also, if this just isn’t possible, then that is equally good to know, so that I can move on and just deal with it :slight_smile:


Longer Description of What I’ve Tried

  • Editor Plugin: This Unreal training: [Extending the Editor With C++][1] …suggested placing the extensions in a plugin. However, I learned shortly after that plugins are not compatible with Hot Reload, so I went on a search for a better way.
  • Editor Module: ([Creating an Editor Module][2]) This setup also does not show my changes unless I restart the editor.

I’ve re-configured the header/source layout and structure a few different ways (based on other built-in plugins), but none of them produce this workflow:

  1. Editor is running
  2. Make a change to some Slate widget code, menu builder, or property customization in VS2017
  3. Compile (Success!)
  4. Swap to the editor and see those changes

I’ve also tried using the Modules window to manually unload/load/recompile the module. It fires the shutdown/startup methods where I would expect, but the changes to the actual UI don’t take effect without shutting down and re-opening the project. This seems wrong and a huge impediment to building a non-trivial extension (especially when you are unfamiliar with Slate layout details).

I’m hoping that it is something simple that I’m just overlooking. Thanks in advance!

[1]:
[2]: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

Hey, I am facing the exact same issue, it is extremely cumbersome to restart the editor every time.
Did you ever find a way around this?
I’m thinking about literally designing my object architecture around this so they somehow share object instances so can call stuff through lets say components and bindings the same way but that seems pretty insane :smiley:

Let me know if you got something figured out

Hot reload is only supported by game modules, atleast thatwhat UE4 expects, you can trick the system by announcing you module as Game module by overriding IsGameModule() in module class that return true

Adn also tell the module system that module actully supports hotreload

I didnt test it so i dont know if it will work, UE4 might have extra check to detect if you try to do this in moduke inside plugin and check if module is declered as editor module.

Also keep in mind HotReaload is hot swamping objects in memory, code that was made to support hot reload is prepared for this to happen… editor or slate is not, as it would need to have written dedicated support for it. So even if this work, you may expect crashes, unexpected behaviors or even asset corruptions (which even normal hot reload tend to cause with blueprint assets). I would not recommend this at all.

In the years since I asked this,I discovered this is unfortunately true, but forgot that I asked this question here! Hopefully your answer helps future googlers.

I’ve moved away from Hot Reload almost completely since it causes too many issues.

The answer below is correct, hot reload is not really possible for editor modules. Iterating on editor code is extremely tedious until you are comfortable with the layout syntax and APIs.

Thank you for your answer!
Indeed I have tried these little hacks using
IsGameModule()
{
return true;
}
SupportsDynamicReloading()
{
return true;
}

and nothing beside crashing happens :smiley: It instantly crashes when i click on a menu i made even with just changing delegates.
Ok so I guess this is not possible, but as you said, at least the search is over and I can make my piece with the workflow :slight_smile: