Blender Git Commit Log

Git Commits -> Revision c9f8f79

Revision c9f8f79 by Hans Goudey (master)
December 17, 2020, 13:43 (GMT)
Geometry Nodes: Make random attribute node stable

Currently, the random attribute node doesn't work well for most
workflows because for any change in the input data it outputs
completely different results.

This patch adds an implicit seed attribute input to the node, referred
to by "id". The attribute is hashed for each element using the CPPType
system's hash method, meaning the attribute can have any data type.
Supporting any data type is also important so any attribute can be
copied into the "id" attribute and used as a seed.

The "id" attribute is an example of a "reserved name" attribute,
meaning attributes with this name can be used implicitly by nodes like
the random attribute node. Although it makes it a bit more difficult
to dig deeper, using the name implicitly rather than exposing it as an
input should make the system more accessible and predictable.

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

Commit Details:

Full Hash: c9f8f7915fd8f65d1c57cd971f8e8a31a662a912
Parent Commit: a9edf2c
Lines Changed: +162, -45

7 Modified Paths:

/source/blender/blenkernel/BKE_attribute_access.hh (+2, -0) (Diff)
/source/blender/blenkernel/BKE_geometry_set.hh (+5, -0) (Diff)
/source/blender/blenkernel/intern/attribute_access.cc (+22, -0) (Diff)
/source/blender/blenlib/BLI_hash.h (+41, -17) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc (+60, -24) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc (+30, -4) (Diff)
/source/blender/nodes/NOD_geometry_exec.hh (+2, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021