Hi guys,
I’m currently working on a plugin that contains an runtime and an editor module. The editor module houses some slate UI components and an Component Visualizer.
However, upon StartupModule GUnrealEd is nullptr, thus I am unable to register my Component Visualizer. The slate UI and other functionality of the editor module are working correctly.
I’m initializing everything as described in the Wiki (A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums) with the only difference being that the code is located in an plugin.
The LoadPhase of the editor module is set to “PostEngineInit”.
void FSimulationCoreEditorModule::StartupModule()
{
RegisterComponentVisualizer(UTrackSegmentComponent::StaticClass()->GetFName(), MakeShareable(new FTrackSegmentComponentVisualizer));
...
}
void FSimulationCoreEditorModule::RegisterComponentVisualizer(FName ComponentClassName, TSharedPtr<FComponentVisualizer> Visualizer)
{
if (GUnrealEd != NULL)
{
GUnrealEd->RegisterComponentVisualizer(ComponentClassName, Visualizer);
}
RegisteredComponentClassNames.Add(ComponentClassName);
if (Visualizer.IsValid())
{
Visualizer->OnRegister();
}
}
The code does not jump to the GUnrealEd->RegisterComponentVisualizer(…) since GUnrealEd is NULL when the module is started.
This is the setup of the editor module:
{
“Name”: “SimulationCoreEditor”,
“Type”: “Editor”,
"LoadingPhase ": “PostEngineInit”,
“AdditionalDependencies”: [
“SimulationCore”,
“Engine”,
“PhysXVehicles”,
“RenderCore”,
“Landscape”,
“Slate”,
“UnrealEd”
]
}
Has anyone experienced anything like that? Does anyone know whats missing?
Cheers,
Bernhard