diff options
author | Fabian Schempp <fabianschempp@googlemail.com> | 2021-04-13 23:11:58 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2021-04-13 23:11:58 +0300 |
commit | 170293475c36b4c462bdad372a03533d2b948bf1 (patch) | |
tree | 117071b6a074568a9970b45463c7bdea60fabbf2 /source/blender/modifiers | |
parent | 86915d04ee3801a916d3b12cac5cc523c6c9149a (diff) |
Nodes: Tooltip for Group Input properties
With this patch, users can define custom tooltips for the exposed
properties of their Geometry Nodes Groups.
Currently this custom tooltips are only used in the modifier panel,
but its a long term goal to use it in the node editor.
Reviewer: Hans Goudey
Differential Revision: https://developer.blender.org/D10884
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 4fc940b3244..216a1c43d3e 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -703,6 +703,14 @@ static IDProperty *socket_add_property(IDProperty *settings_prop_group, IDP_AddToGroup(ui_container, prop_ui_group); } + /* Set property description (tooltip). */ + IDPropertyTemplate property_description_template; + property_description_template.string.str = socket.description; + property_description_template.string.len = BLI_strnlen(socket.description, MAX_NAME) + 1; + property_description_template.string.subtype = IDP_STRING_SUB_UTF8; + IDProperty *description = IDP_New(IDP_STRING, &property_description_template, "description"); + IDP_AddToGroup(prop_ui_group, description); + /* Create the properties for the socket's UI settings. */ if (property_type.create_min_ui_prop != nullptr) { IDP_AddToGroup(prop_ui_group, property_type.create_min_ui_prop(socket, "min")); |