Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoadPoint gizmo handles not cleared when RoadNetwork is selected #57

Closed
bdog2112 opened this issue Feb 22, 2023 · 4 comments · Fixed by #59
Closed

RoadPoint gizmo handles not cleared when RoadNetwork is selected #57

bdog2112 opened this issue Feb 22, 2023 · 4 comments · Fixed by #59
Assignees
Labels
bug Something isn't working

Comments

@bdog2112
Copy link
Collaborator

bdog2112 commented Feb 22, 2023

In some scenarios, a selected RoadPoint's gizmo handles are not cleared when a different object is selected.

Steps to recreate problem:

  • select single RoadPoint and observe that handles and lane widget are shown
  • select RoadNetwork and observe that lane widget is hidden. But, gizmo handles are still shown.

Need to re-evaluate how selection/deselection is processed. There has been plenty of discussion about Godot selection quirks.

  • Godot only displays handles on the primary selection
  • There's no way to lookup the primary selection
  • In the Scene dock, Godot treats the top-most selected item as the primary selection
  • When multiple items are selected, Godot sorts them one way in the Scene dock. But, a completely different way in get_selected_nodes(). This means one cannot rely on the 1st item in get_selected_nodes() to be the primary selection.
  • If two items are selected in the Scene dock and the primary selection is ctrl-clicked, then it will not be highlighted. Thus, it won't show up in get_selected_nodes(). But, it will still remain the primary selection as indicated by its white border rectangle.
    Primary Selection Is Not Selected
  • Scene dock triggers selection_changed on button down
  • 3D view triggers selection_changed on button up

Consider the above limitations when developing a solution for this bug.

@bdog2112
Copy link
Collaborator Author

bdog2112 commented Mar 1, 2023

plugin._on_selection_changed() handles various tasks when the user makes a new selection. This includes, potentially, iterating the list of RoadPoint children in the "RoadNetwork.points" node and updating the visibility of their handles.

Pull Request #58 mentioned that it would be better if we didn't explicitly search for the "points" node since there may be more than one.

We currently track the last selected RoadPoint. Perhaps, we should simply track the last list of selected items. This would provide a complete list of previous selections to iterate without the need to search for points or traverse all the nodes in the scene.

@TheDuckCow
Copy link
Owner

AS discussed, there's a chance that Godot 4 may work "differently". Though likely we will need to do this differently anyways, we will hedge our bets and wait until our godot 4 migration in case there is a simpler procedure/approach.

@TheDuckCow
Copy link
Owner

Calling out this similar sounding bug fixed in yesterday's 3.5.2 release of Godot, not sure if this would actually affect our situation though

@bdog2112
Copy link
Collaborator Author

bdog2112 commented Mar 7, 2023 via email

@bdog2112 bdog2112 linked a pull request Mar 10, 2023 that will close this issue
@TheDuckCow TheDuckCow added the bug Something isn't working label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants