Page MenuHome

Geometry Nodes: Output with the most complex attribute data type
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Jan 12 2021, 8:38 PM.

Details

Summary

In order to avoid losing information, it sometimes makes sense for the
output attribute type to depend on the types of the input attributes.

A function for this already exists, attribute_data_type_highest_complexity,
it just needs to be used in more places. The change for the attribute compare
node is just so the code there uses the same code style as in the attribute
mix node.

Ref T83793

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Jan 12 2021, 8:38 PM
Hans Goudey (HooglyBoogly) created this revision.
source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
142–146

I have an alternate version of this patch that just takes the names and the component for arguments and gives a result, but I actually prefer this version because it's more explicit.

Since there are only two examples of this sort of thing I'm not sure it's time for an abstraction yet anyway.

This revision is now accepted and ready to land.Jan 12 2021, 8:45 PM
source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
142–146

Could also just use CD_PROP_FLOAT here, but either way is fine for me.

source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
142–146

Yeah, the result would be the same since that situation is completely trivial. I think if this is to become the "canonical" way of dealing with this then bool is a bit more clear on the intent.