Resources
- See zomg’s post for the base setup.
- Unleashing the Power of Editor Debug Visualization
About
For a editor VP solution see Custom show flag.
There is a struct called FComponentVisualizer that seems to be used to draw/debug whatever you want for a specific component class.
See FConstraintComponentVisualizer::DrawVisualization and FComponentVisualizersModule::StartupModule for an example.
About
GUnrealEdinStartupModuleAs I found here
GUnrealEdis null inStartupModuleif you are loading it to early. Load your module atPostEngineInitphase to correct that. Or use the following delegate:FCoreDelegates::OnPostEngineInit.AddRaw(this, &FMyModule::OnPostEngineInit);
More details about it (with an example on Unity box collider 6 faces maker) here
Component visualizer’s are used in UUnrealEdEngine::DrawComponentVisualizers, see also FSCSEditorViewportClient::Draw.
You can get a component visualizer from a component instance using UUnrealEdEngine::FindComponentVisualizer, for example:
TSharedPtr<FComponentVisualizer> Visualizer = GUnrealEd->FindComponentVisualizer(SplineActor->GetPatrolSplineComponent()->GetClass());
auto SplineVisualizer = StaticCastSharedPtr<FSplineComponentVisualizer>(Visualizer);