Hey there,
I’m currently working on an EditorMode to spawn and modify “Vectors” in the Viewport.
The way this works is with EditorUI Buttons that spawn a “StreetVertex” Actor and also connect them to each other.
Currently it looks something like this:
https://puu.sh/tuIC4/0b28da034d.png
These “StreetVertex” Actors are saved in a so called “StreetActor” that is representing a Street.
A Street goes from Junction (Green) to Endpoint (Red) or any constellation of it. The image above shows 3 Streets.
So at this point we have 10 StreetVertex Actors and 3 StreetActors in the scene.
Now this works all quite well, but it seems highly wasteful to use an Actor for the StreetVertex which is basically just a Vector after all.
Why did I still choose an Actor for this?
Because I don’t know how to properly modify a simple Vector and also not to just spawn one.
I could use these 3D Widget Vector things, but that also sounds wrong.
Now another problem I ran into is: I don’t want the user to modify these StreetVertices outside of my custom EditorMode.
Means as soon as I go out of this mode, they should be hidden. That’s not really possible with Actors. Even if I set the to invisiblem outside of the Editor mode, they would still be visible in the outliner.
What did I think about for the solution?
I tried looking into the GeometryMode, as this is hiding and showing the Vertices etc. and also making it possible to selected and modify them.
They simply extended the FVector into their own Class and let the EditorMode forward selection to it. Then some other quirks that result in being able to modify them.
These Custom Vectors are part of the Geometry Cubes, so this could be similar to my StreetActors.
Now the question is: Is there a better way to make positions in the viewport editable and visible only in your custom EditorMode or should I go for copying the way it was solved for the GeometryMode?