Accessing GEditor in 4.15?

Hello, since the large monolithic headers don’t really work as intended anymore, what’s the best method of accessing GEditor? The code I was using was:

createdWidget = CreateWidget<UUserWidget>(GEditor->GetEditorWorldContext().World(), tempWidget);

which obviously worked fine when I could just include Engine.h; Now that isn’t the case, I don’t know how I can expose GEditor. I have tried follow the rabbit hole in the documentation but couldn’t locate the header that holds all of GEditor’s secrets.

Any help, even just pointing me in the right direction would be greatly appreciated!

Thanks,
Ryan

There is a DLL-exported declaration for GEditor in Source/Editor/UnrealEd/Public/Editor.h - try including that.

How do you include that? When I try it doenst want to comile…

Try using

#include "LevelEditor.h"
#include "Editor.h"

Works fine for me.

1 Like