Page MenuHome

Geometry Nodes: Fields and anonymous attributes.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Sep 6 2021, 7:49 PM.

Details

Summary

This patch implements the initial core framework for fields and anonymous attributes as described on devtalk.
It was developed by Hans and me.

The two core components of this patch allow the following:

  • Building and evaluating fields at run-time (FN_fields.hh).
  • Creating and accessing anonymous attributes on geometry (BKE_anonymous_attribute.h).

For evaluating fields we use a new so called multi-function procedure (FN_multi_function_procedure.hh).
It allows composing multi-functions in arbitrary ways and supports efficient evaluation as is required by fields.
See FN_multi_function_procedure_test.cc for more details on how this evaluation mechanism can be used.

A new AttributeIDRef has been added which allows handling named and anonymous attributes in the same way in many places.

On the user level, the following has changed:

  • New Position node.
  • New Index node.
  • New Normal node.
  • New Set Position node.
  • New Attribute Capture node (same as Attribute Freeze in the prototype).
  • Socket inspection for fields is not yet working.

Diff Detail

Repository
rB Blender
Branch
temp-geometry-nodes-fields
Build Status
Buildable 16872
Build 16872: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Sep 6 2021, 7:49 PM
Jacques Lucke (JacquesLucke) created this revision.
  • fix exposed string socket
  • Cleanup: Add comment about reusing span for input and output
Hans Goudey (HooglyBoogly) updated this revision to Diff 41546.EditedSep 7 2021, 8:17 PM
  • Merge branch 'master' into temp-geometry-nodes-fields
  • Remove changes to the Point Translate node

Since we were recently talking about just duplicating every node with a string input and separating the updated versions, I've removed the changes to the point translate node.

I separated the code for the "Fields" point separate node into a paste so we can apply it after renaming all of the old nodes: P2371

  • Merge branch 'master' into temp-geometry-nodes-fields
  • A few picky changes to comments
  • Rename "dst_hints" to "dst_varrays", update comments
  • Add description for domain property

At this point I don't have any further improvements I would make to this patch, I think it's a really nice starting point and is ready to go to master.

For the records, it looks not not much review has gone on here, but we mostly did it by simply updating the branch or discussing on chat.
I think the patch is well commented and clear, so that process shouldn't be an issue.

This revision is now accepted and ready to land.Sep 8 2021, 5:01 PM

I have no remarks with the code here (nor did I check it). But I want to propose the following merge strategy:

  • Hide new nodes from UI.
  • Merge.
  • Implement the draw changes for diff. flows/sockets.
  • Implement warning propagation for old nodes.
  • Hide all old nodes that will be replaced/upgraded.
  • Bring in new nodes (so the menu will get considerably small).
  • Keep bringing more new nodes.

The hiding of the new nodes can happen using an experimental flag.

The rationale is that I think we should avoid having the old and the new system co-existing more than we have to. That would leave Blender in a unreleaseble state for too long. Developing only in a branch also has its downsides.

With this approach the worst case scenario is to release 3.0 with a sub-set of the nodes. Not ideal, but acceptable.

In theory we could flip the nodes visibility (show new ones instead of old ones) after all the new ones are ready. It depends on how long we will get this done. This is a decision we can have it later too, depending on how long the other targets (draw changes, warning system) take.

Finally, as you can see from my list, I think the experience of fields should be good from the get go. People should be able to tell them apart from the nodes they are used to. The legacy node(-tree)s should be blatantly visibly different than the new one. I think this approach will bring more clarity to the users and will allow more people to test it properly from day one.

  • hide new nodes behind feature flag