Fix: Geometry Nodes: empty expanded menu entries in modifier

Work around an issue with expanded menus that exists for a long time
already. I briefly tried fixing it, but does not seem straight forward unfortunately
without breaking stuff.

Also see the comment in `ui_item_enum_expand_exec`.
This commit is contained in:
Jacques Lucke
2025-05-14 14:04:11 +02:00
parent 2bc284975b
commit fdfd1de9a8

View File

@@ -2386,7 +2386,13 @@ static void draw_property_for_socket(DrawGroupInputsContext &ctx,
}
case SOCK_MENU: {
if (socket.flag & NODE_INTERFACE_SOCKET_MENU_EXPANDED) {
row->prop(ctx.md_ptr, rna_path, UI_ITEM_R_EXPAND, name, ICON_NONE);
/* Use a single space when the name is empty to work around a bug with expanded enums. Also
* see #ui_item_enum_expand_exec. */
row->prop(ctx.md_ptr,
rna_path,
UI_ITEM_R_EXPAND,
StringRef(name).is_empty() ? " " : name,
ICON_NONE);
}
else {
row->prop(ctx.md_ptr, rna_path, UI_ITEM_NONE, name, ICON_NONE);