Page MenuHome

Geometry Nodes: Remove reference to anonymous attributes in socket inspection.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Oct 26 2021, 1:50 PM.

Details

Summary

This changes the socket inspection for fields according to T91881.

This could be made a bit smarter in the future when node groups are involved. We could e.g. show the names of node group outputs instead of the names of nodes inside the node group. That's a bit out of scope for now unfortunately.

Diff Detail

Repository
rB Blender
Branch
field-tooltips-update (branched from master)
Build Status
Buildable 18234
Build 18234: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Oct 26 2021, 1:50 PM
Jacques Lucke (JacquesLucke) created this revision.
  • sort by length instead of alphabetically

The results look good to me, and the implementation seems fine. I mentioned another option inline though, that might help to separate the UI code a bit, curious what you think about that.

source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc
572

Another option would probably be storing a reference to the node and calculating the name when building the inspection strings from the fields.
That's just a bit more general, and may be useful for other things, like adding a node warning message from the field input's get_varray_for_context.
It also means that the UI code and actual logic are a little less mixed.

What do you think about that?

source/blender/nodes/intern/node_geometry_exec.cc
188

Did you think about using the label here, if it's set?

source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc
572

I'm not generally opposed to storing a pointer to the node, but I'd rather only do this when we actually need this. Then we can answer questions like "Do we need the bNode or DNode?" better. Don't think this is a design question I want to get into for this patch.

Hans Goudey (HooglyBoogly) added inline comments.
source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc
572

Okay, fair enough.

This revision is now accepted and ready to land.Oct 26 2021, 2:43 PM
source/blender/nodes/intern/node_geometry_exec.cc
188

Oops, looks like this if statement is empty to me.

Right now it seems to be using the node name, while I think we should use its Label when the label exists.

Other than that +1

Nevermind, I tested an early version of the patch. Patch is good to go.