godotengine / godot

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

MeshInstance3D popup menu shows options that apply only to 1 node when multiple nodes are selected #91637

Open KoBeWi opened 4 months ago

KoBeWi commented 4 months ago

Tested versions

4.3 7cdad333114e6765351ed0facb48db228ef29b7b

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

The Mesh menu when MeshInstance3D is selected: image It appears both when single instance is selected and when multiple instances are selected. However only the first option works with multiple instances, others will handle only the first selected node.

We should either make all options work with multiple nodes or disable/hide non-functional ones. After #91620 it's easy to discern when multiple nodes are being edited.

Steps to reproduce

  1. Create multiple MeshInstance3D nodes
  2. Select then
  3. On the top bar select Mesh -> Create Navigation Mesh
  4. Only one mesh is created

Minimal reproduction project (MRP)

N/A

jsjtxietian commented 4 months ago

We should either make all options work with multiple nodes

How can we achieve this, by making multiple MeshInstance3DEditor and each of them handle one mesh instance or by make the MeshInstance3DEditor can handle MultiNodeEdit ? Create collosion shape works because it explicitly call editor_selection->get_selected_node_list() and handles them itself.

KoBeWi commented 4 months ago

91620 already makes the editor handle MultiNodeEdit, so it's a matter of applying the selected option for each selected node. If there are options that can't handle multiple nodes (because they require setup for each node or something), they should be disabled.

jsjtxietian commented 4 months ago

For example, I think actions like Create Navigation Mesh, it can apply to multi mesh concurrently, but the current code doesn't seem to support this, mesh_editor->edit(mi); just update the current node , and then Create Navigation Mesh will only apply to the last edit one.

KoBeWi commented 4 months ago

Yeah the editor would need to be reworked to take a list of mesh instances instead of single one.