Page MenuHome

Geometry Node: Capture Attribute: Skip if attribute not needed
ClosedPublic

Authored by Iliya Katueshenock (Moder) on May 24 2022, 3:58 PM.

Details

Summary

Now, if the attribute is not needed (for example, a switch), the
node still executes the logic for calculating the attribute data T96109.
This patch should add the option:

  • If the geometry is not requested
  • If the attribute is not requested

Both of these options do not require calculations.

Diff Detail

Event Timeline

Iliya Katueshenock (Moder) requested review of this revision.May 24 2022, 3:58 PM
Iliya Katueshenock (Moder) planned changes to this revision.
Iliya Katueshenock (Moder) created this revision.

Upgrading to master status to fix unrelated changes

Upgrading to master, fixing unrelated changes

Iliya Katueshenock (Moder) edited the summary of this revision. (Show Details)

Now there is an error for the attribute, and also moved the type comparison to the function

Jacques Lucke (JacquesLucke) requested changes to this revision.May 24 2022, 4:38 PM
Jacques Lucke (JacquesLucke) added inline comments.
source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
129

Since you added this now, it should also be used for the other inputs and outputs. (define a input_identifier and output_identifier variable outside of the switch statements)

165

An info like The attribute output can not be used without the geometry output would probably be more useful.

171

This does not require an info message.

This revision now requires changes to proceed.May 24 2022, 4:38 PM
Iliya Katueshenock (Moder) marked 3 inline comments as done.

Fixes

source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
164

This has to be a std::string, otherwise it's a memory error, same below.
That's because a StringRef can only reference memory that's owned by someone else.

Iliya Katueshenock (Moder) marked an inline comment as done.

Correction of string memory ownership

This revision is now accepted and ready to land.May 25 2022, 1:54 PM

Note, the commit is currently attributed to someone else on phabricator, that's not the case in git though. Phabricator is a bit weird in that regard sometimes, happens every now and then... Sorry about that. Maybe it can be fixed, but hopefully we can move to another platform that doesn't have the same problem soonish.