Page MenuHome

Geometry Nodes: Update the 'Set Position' node with offset input
ClosedPublic

Authored by Johnny Matthews (guitargeek) on Oct 7 2021, 6:27 AM.

Details

Summary

When marked true, this boolean field input will cause the inputted position to be added to the existing position rather than replacing it.

T91845

Diff Detail

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

Event Timeline

Johnny Matthews (guitargeek) requested review of this revision.Oct 7 2021, 6:27 AM
Johnny Matthews (guitargeek) created this revision.
Johnny Matthews (guitargeek) retitled this revision from Geometry Nodes: Update the 'Set Position' node with offset input. When marked truem this boolean field input will cause the inputted position to be added to the existing position rather than replacing it. to Geometry Nodes: Update the 'Set Position' node with offset input.Oct 7 2021, 6:33 AM
Johnny Matthews (guitargeek) edited the summary of this revision. (Show Details)
Johnny Matthews (guitargeek) edited the summary of this revision. (Show Details)
Hans Goudey (HooglyBoogly) requested changes to this revision.Oct 11 2021, 11:36 PM
Hans Goudey (HooglyBoogly) added inline comments.
source/blender/nodes/geometry/nodes/node_geo_set_position.cc
51

Since the offsets is usually probably just a single true or false value, it's probably best to use a virtual array here:
VArray<bool> = position_evaluator.get_evaluated<bool>(1);

Same probably goes for position, but mostly because creating a temporary array involves an extra copy here when we don't really need it.

In the future we could have different code paths depending on whether the offset input is a single value or not, maybe it's worth noting that in a comment.

This revision now requires changes to proceed.Oct 11 2021, 11:36 PM
  • Merge branch 'master' into setpos
  • Use VArray
  • Merge branch 'master' into setpos
  • Change Position input to varray as well

Thanks Johnny, looking simpler now! We can always optimize in more complex ways in the future.

This revision is now accepted and ready to land.Oct 14 2021, 6:07 AM