If I add UnrealEd to this module’s PublicDependencyModuleNames, my project compiles fine with Development Editor or Debug Editor configuration, but failed to compile with Debug configuration. The first error that pops up points to
UNREALED_API int32 EditorInit( class IEngineLoop& EngineLoop );
in UnrealEd.h, saying
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Can’t the UnrealEd be included in the PublicDependencyModuleNames?
In fact, I would like to call editor specific functions at runtime, like GEditor->FindBrushBuilder(UCubeBuilder::StaticClass()), anyway to do it?
This compilation failure is due to UnrealEd being reliant on the editor itself. This means that if you want to include it in your project/module, you’ll need to specify that it is only meant to be included for in-editor processes, otherwise it’ll cause compilation errors when building for non-editor configurations. It’ll also prevent packaging from completing successfully.
As for your other question about exposing editor functions; Technically yes, it can be done. The only problem is that it would take a lot of editing of the source code to make a multitude of things available at runtime, which would most likely also heavily affect performance. It’s a chain reaction type of thing where you’ll need to expose one thing to expose another and that will repeat.
Matthew, thank you for your answer. Our team is actually working on drawing rooms at runtime according to realtime measured room data. We were thinking of using BSP to build the structure of the room and then convert to static meshes, all at runtime, which may involve functions like UEditorEngine::ConvertBrushesToStaticMesh, that is the reason we need to call editor functions.