Page MenuHome

Geometry Nodes: Simplify using selection when evaluating field.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Dec 14 2021, 3:01 PM.

Details

Summary

We often had to use two FieldEvaluator instances to first evaluate the selection and then the remaining fields. Now both can be done with a single FieldEvaluator. This results in less boilerplate code in many cases.
Performance is not affected by this change. In a separate patch we could improve performance by reusing evaluated sub-fields that are used by the selection and the other fields.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Dec 14 2021, 3:01 PM
Jacques Lucke (JacquesLucke) created this revision.

Looks like a good change to me. Apart from the possible future sharing of intermediate values, less boilerplate code is nice.

source/blender/functions/FN_field.hh
342–343

Might be helpful to say something like "Only the elements selected by both this selection *and* the selection provided in the constructor are calculated."

This revision is now accepted and ready to land.Dec 14 2021, 3:16 PM