godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.35k stars 21.06k forks source link

MeshLibrary choices "Add Item" and "Remove selected item" work incorrectly #74388

Open cassandrus opened 1 year ago

cassandrus commented 1 year ago

Godot version

4.0.stable

System information

Windows 10

Issue description

Two issues:

image

Steps to reproduce

Create new empty mesh library, use "Add Item" and "Remove selected item" buttons, nothing else

Minimal reproduction project

N/A

smix8 commented 1 year ago

Cause some Editor change broke the edited property path report for the Inspector on side-panels.

InspectorDock::get_inspector_singleton()->get_selected_path() used by the MeshLibrary to know which item to remove now seem to always returns an empty String.

akien-mga commented 1 year ago

Possibly related to #46435 and #73150.

akien-mga commented 1 year ago

The UX is pretty terrible indeed. Tested in 4.1 beta 3.

This should be changed to use Add/Remove buttons in the Inspector directly similarly to Array/Dictionary.

elvisish commented 1 year ago

The UX is pretty terrible indeed. Tested in 4.1 beta 3.

  • Add Item works, but you need to refresh to actually see the items added in the palette. It does add the items properly to the Inspector.
  • Remove Item works, but it's a contextual menu for the Inspector (but very weirdly placed in the viewport toolbar). You need to select an item in the Inspector by clicking on its "Name" property, and then Remove Item works fine. Likewise for the palette it needs a refresh to propagate changes.

This should be changed to use Add/Remove buttons in the Inspector directly similarly to Array/Dictionary.

I tried this but it just doesn't work at all? I still have to manually edit the meshlibrary file and remove the node from the gridmap scene for this to work.

https://github.com/godotengine/godot/assets/16231628/27f7fad1-b80d-441b-a299-0051c71668f7

EDIT: uhhh, OBS didn't capture the menu for some weird reason, I'm clicking on this: image

EDIT 2: oh wow, you have to literally click on the Name and select it and it works? image

EDIT 3: aaaand destroys the cell IDs, so it's still useless cause it means all of the existing gridmap cells get completely replaced by the wrong cells (something that manually editing the file doesn't cause) image

Maybe adding an option of manually setting the MeshItem ID would be a good bandaid for this problem? That way, while using Remove Item will destroy the cell IDs and completely break the map cells, at least manually being able to renumber the mesh items would allow you to repair existing gridmaps.

diegopau commented 1 month ago

Related: #83272