Custom Landscape importer

I’m attempting to create a custom landscape importer as per the documentation page (Creating Custom Landscape Importers In Unreal Engine | Unreal Engine 5.2 Documentation), I have generated a plugin according to that documentation (Plugins in Unreal Engine | Unreal Engine 5.2 Documentation) and it seems to work fine.

The problem is that when StartupModule is called, the LandscapeEditor module is not loaded and attempting to call FModuleManager::LoadModule to get it causes a segfault. Attempting to load a module that does not exist just returns an error, and attempting to load the LandscapeEditor module from the game code itself causes the same segfault. I have tried changing the module type, the loading phase, adding it as both a static and dynamic dependency and done a clean rebuild of the project between every step, but no luck.

Does anyone know how it’s supposed to be set up, or have any suggestions for alternative ways of importing custom data files as landscape heightmaps?

Hi,

The crash you’re seeing is likely happening because the Landscape Editor module’s StartupModule attempts to access GEditor, which won’t be initialized at the default plugin loading time. You should be able to fix this by setting your plugin’s loading phase to PostEngineInit, which will be loaded after GEngine and the other engine globals are initialized. You’ll also want to be sure to set your plugin type to Editor, or you’ll run into problems with packaging when UBT tries to include your plugin with editor dependencies into the build.

If you’re still seeing a crash after setting the load phase to PostEngineInit, are you able to attach a debugger and catch where the crash is happening? That should give a hint as to what is causing the exception.

Best,

Cody

Yeah, that seems to work. Thanks!