Blender Git Loki

Git Commits -> Revision d7c2c88

Revision d7c2c88 by Hans Goudey (master)
February 12, 2021, 18:46 (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: d7c2c889a688067dab280fc137ad4c3c7ce4cb2b
Parent Commit: ba03f7f
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)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021