Page MenuHome

Nodes: Tooltip for Group Input properties
ClosedPublic

Authored by Fabian Schempp (fabian_schempp) on Apr 3 2021, 10:20 AM.

Details

Summary

With this patch, users can define custom tooltips for the exposed properties of their Geometry Nodes Groups.

Diff Detail

Repository
rB Blender
Branch
tooltips_for_modifier_nodes (branched from master)
Build Status
Buildable 13945
Build 13945: arc lint + arc unit

Event Timeline

Fabian Schempp (fabian_schempp) requested review of this revision.Apr 3 2021, 10:20 AM
Fabian Schempp (fabian_schempp) created this revision.

@Dalai Felinto (dfelinto) Should we call the property description instead of tooltip?

Ankit Meel (ankitm) added inline comments.
source/blender/modifiers/intern/MOD_nodes.cc
79

Better add ../interface to the CMakeLists.txt file of source/blender/modifiers and include using just the filename.

1318

but

@Dalai Felinto (dfelinto) Should we call the property description instead of tooltip?

Tooltip is correct since it is what we use for Custom Properties:

Hans Goudey (HooglyBoogly) requested changes to this revision.Apr 6 2021, 3:12 PM

The functionality is good but unfortunately it's quite a hacky solution-- mainly the process of changing buttons in the uiBlock directly in the set_tooltip function.
In other words, this sort of thing is what makes the interface code convoluted already, and we strive not to add more of it.

A proper solution would probably copy the description to the IDProperty when it gets created based on the socket in MOD_nodes.cc

source/blender/modifiers/intern/MOD_nodes.cc
79

It's quite important not to do this. The stuff in interface_intern should not be depended on by code outside of the interface directory. These boundaries exist for important reasons-- otherwise changing the UI code implementation becomes prohibitively hard, etc.

Generally intern headers should only be included inside their relevant directory.

This revision now requires changes to proceed.Apr 6 2021, 3:12 PM
  • Changes based on review by Hans Goudey

Yes, this is nicer! Quite close I think

source/blender/editors/space_node/node_buttons.c
159

Since this only has an effect in node modifier panels, I think it would be best to only display it for geometry node groups for now.

source/blender/makesrna/intern/rna_nodetree.c
9668

Isn't custom redundant here? I would call the RNA property "description", even if we refer to it by "Tooltip" in the UI, since it's more consistent.

9668–9671

I'd put this a bit lower. Maybe after identifier, just because it's relatively less important.

source/blender/modifiers/intern/MOD_nodes.cc
79

Now you can remove this ; )

Fabian Schempp (fabian_schempp) marked 4 inline comments as done.
  • Changes based on Review by Hans Goudey.

Looks good! The commit should mention that it doesn't display in the node editor at all, but that it's a long term goal to make that work.

source/blender/editors/space_node/node_buttons.c
160

Line length. I suggest shortening it a little with since it's only used in

This revision is now accepted and ready to land.Apr 13 2021, 4:03 PM