From d47175d6fd3064bb73224efb21defcc103c4573f Mon Sep 17 00:00:00 2001 From: YimingWu Date: Mon, 7 Jul 2025 13:59:23 +0200 Subject: [PATCH] Fix #141448: Geometry Nodes: UI panel property name trimming logic Fix Previously in 95259228d9394477d1dda6d56e37b79bd55905de, property names within geometry nodes panels are trimmed to make it less verbose if the property name contains the parent panel's name as prefix, this didn't take into account where property name can be the same as panel name, in which case there will be an empty property name which is undesired. So we should not trim the name in this case. Pull Request: https://projects.blender.org/blender/blender/pulls/141500 --- source/blender/nodes/intern/geometry_nodes_caller_ui.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/nodes/intern/geometry_nodes_caller_ui.cc b/source/blender/nodes/intern/geometry_nodes_caller_ui.cc index 0c399b568fd..85be3326ec3 100644 --- a/source/blender/nodes/intern/geometry_nodes_caller_ui.cc +++ b/source/blender/nodes/intern/geometry_nodes_caller_ui.cc @@ -512,9 +512,11 @@ static void draw_property_for_socket(DrawGroupInputsContext &ctx, if (parent_name.has_value()) { const StringRefNull prefix_to_remove = *parent_name; int pos = name.find(prefix_to_remove); - if (pos == 0) { + if (pos == 0 && name != prefix_to_remove) { /* Needs to trim remainig space characters if any. Use the `trim()` from `StringRefNull` - * because std::string doesn't have a built-in `trim()` yet. */ + * because std::string doesn't have a built-in `trim()` yet. If the property name is the + * same as parent panel's name then keep the name, otherwise the name would be an empty + * string which messes up the UI. */ name = StringRefNull(name.substr(prefix_to_remove.size())).trim(); } }