Open kromenak opened 2 months ago
Hi, I am using Godot 4.3 and windows 10 and I could not get this error
I haven't tried reproducing this on Windows - perhaps it is a Mac only issue?
I just tried testing this in both Godot 4.2.2 and Godot 4.3. The behavior is slightly different, but unfortunately the 4.3 behavior is worse:
The 4.3 error is slightly different, but I think that's just because another built-in item has been added to the Tools menu in 4.3.
scene/gui/popup_menu.cpp:2388 - Index p_idx = 4 is out of bounds (items.size() = 4).
Godot version
v4.2.2.stable.official [15073afe3]
godot-cpp version
4.2.2.stable
System information
Godot v4.2.2.stable - macOS 14.5.0 - Vulkan (Mobile) - integrated Apple M3 Max - Apple M3 Max (16 Threads)
Issue description
I am trying to write a helper tool from a C++ GDExtension.
When I use
add_tool_menu_item
to add an item to the tool menu, the item does appear in the Editor. However, clicking on it doesn't actually perform the associated action; instead, it shows this error:Interestingly, recompiling the GDExtension (and forcing the hot reload behavior) fixes the issue, and the menu item works. However, if you restart the editor, the error occurs again until the GDExtension is hot reloaded.
While the "hot reload" thing is a workaround, it isn't feasible for non-technical team members who don't have the tools or knowledge to recompile the extension (and the whole reason I'm adding a menu item is for those team members!).
One final note, I was able to work around this by using a GDScript editor plugin that calls into my C++ code (and assuming I bind the function so GDScript can call it):
I have only tested this on macOS so far. I tried to debug via the engine source code, but I wasn't able to identify the cause. Two things I did notice:
Steps to reproduce
Project > Tools > Custom Tool Menu Item
and click it.Minimal reproduction project
GodotProject.zip