I’m working on a plugin that alters splines in the editor, and I need to be able to adjust the points on the spline that the user has selected.
I have a ptr to the USplineComponent and can adjust all of the points, and now just need to know which ones the user has highlighted with multi-select to modify only those elements.
It seems that the FSplineComponentVisualizer has the functionality I need, but I can’t figure out a) if that’s really what I need, and b) how to get it compiled and access the visualizer that’s attached to the spline that’s being used.
You’re going to need to do that inside the component visualizer. The selected spline points aren’t “real” objects, they’re hit proxies which will be intercepting user input in the editor and interpreting that data to manipulate the spline’s array of spline points directly.
Give this a read for how they work:
I assume your plugin already has an editor module. What you’re going to need to do is create a new FSplineComponentVisualizer, unbind the default visualizer for the spline via GUnrealEd->UnregisterComponentVisualizer in your module’s startup code and then bind your new version with the additional functionality. You might also need to tweak your plugin load order to ensure that this happens after the normal binding, but I’d expect that to probably be okay by default.