Blender Git Commit Log

Git Commits -> Revision dec6a55

Revision dec6a55 by Hans Goudey (pygpu_extensions)
February 12, 2021, 21:54 (GMT)
Geometry Nodes: Allow attribute nodes to use different domains

Currently every attribute node assumes that the attribute exists on the
"points" domain, so it generally isn't possible to work with attributes
on other domains like edges, polygons, and corners.

This commit adds a heuristic to each attribute node to determine the
correct domain for the result attribute. In general, it works like this:
- If the output attribute already exists, use that domain.
- Otherwise, use the highest priority domain of the input attributes.
- If none of the inputs are attributes, use the default domain (points).

For the implementation I abstracted the check a bit, but in each
node has a slightly different situation, so we end up with slightly
different `get_result_domain` functions in each node. I think this makes
sense, it keeps the code flexible and more easily understandable.

Note that we might eventually want to expose a domain drop-down to some
of the nodes. But that will be a separate discussion; this commit focuses
on making a more useful choice automatically.

Differential Revision: https://developer.blender.org/D10389

Commit Details:

Full Hash: dec6a557dbbef5e74d23ecddc2eba9232923ad55
Parent Commit: d9fdd82
Committed By: Germano Cavalcante
Lines Changed: +310, -46

16 Modified Paths:

/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc (+22, -5) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_combine_xyz.cc (+15, -2) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc (+16, -5) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc (+19, -3) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc (+25, -4) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc (+16, -8) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc (+4, -1) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc (+18, -3) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_sample_texture.cc (+26, -4) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_separate_xyz.cc (+34, -7) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc (+25, -2) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc (+3, -2) (Diff)
/source/blender/nodes/geometry/node_geometry_util.cc (+46, -0) (Diff)
/source/blender/nodes/geometry/node_geometry_util.hh (+1, -0) (Diff)
/source/blender/nodes/intern/node_geometry_exec.cc (+36, -0) (Diff)
/source/blender/nodes/NOD_geometry_exec.hh (+4, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021