TheDuckCow / godot-road-generator

A godot plugin for creating 3D highways and streets.
MIT License
313 stars 16 forks source link

Create tool to connect RoadPoints and RoadContainers #117

Closed TheDuckCow closed 7 months ago

TheDuckCow commented 11 months ago

Need to decide the exact details, but at the highest level this solves the problem of being able to connect RoadPoints in the currently open scene to RoadPoints of editor-inaccessible nested scenes, necessary for prefab pieces or for intersections.

A couple ways we could make this:

Option A

Shortcut keys, where if you have a RoadPoint, RoadNetwork, or RoadIntersection selected and you hold a particular modifier key like control, it engages in a connection mode.

Option B

Similar to the built in curve editor, this would be a connection tool mode that is separate from the "add roadpoint" tool. When it is active, a connection is made with two clicks:

  1. As your mouse moves around, eligible selection points (including children RoadPoints of nested scenes) are made visible as you hover near.
    • It should change color or invert itself when you mouse is close enough to trigger the selection if you were to click
  2. Select your first element
  3. This element is highlighted with some immediate geometry around it
  4. Now select any other new element, whereby a dotted animated line will appear while you are performing the placement. Pressing escape cancels the selection of everything
  5. On click, the connection is made. When making this connection, it will always slot your connection on the side of the roadpoint that is nearest to the cursor (and we should ensure the indicator implies this).
TheDuckCow commented 9 months ago

Thinking about this further, as we have an initial toolbar with select, add, and delete modes:

The current thought is to make the "Add tool" also be the connection tool for convenience:

I like the idea of using control+click as a means to result in a selection whilst in the add tool mode, as that's similar to blender as a shortcut (though in Blender's case, control + [default mouse to select] click is just a way to select an object based on an origin without doing zdepth checking. Plus, if we're sticking with blender conventions as a rationale, control+click in an object edit mode is a shortcut to create new points/geometry, so that is a nice parallel to adding a RoadPoint even if you are in Select mode.

What to do if Delete mode is on? Likely nothing modified.

TheDuckCow commented 8 months ago

Only part that remains still on this ticket is making the connections between two different RoadContainers. Leaving this open in the meantime, though the connection tool is in a good spot otherwise.

TheDuckCow commented 8 months ago

Per my comment here, we have just a handful of scenarios to support for connections between RoadContainers, and then we'll be able to call v0.4.0 ready to go.

TheDuckCow commented 7 months ago

Considering this closed at this time - more improvements can be made with future issues.