Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-12-17 16:43:31 +0300
committerHans Goudey <h.goudey@me.com>2020-12-17 16:43:31 +0300
commitc9f8f7915fd8f65d1c57cd971f8e8a31a662a912 (patch)
treee0e74b0abef02e56943d97eac1d6affa761d6626 /source/blender/nodes/NOD_geometry_exec.hh
parenta9edf2c869baf1b73d388796737c38a1eff06471 (diff)
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
Diffstat (limited to 'source/blender/nodes/NOD_geometry_exec.hh')
-rw-r--r--source/blender/nodes/NOD_geometry_exec.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh
index 445e1ed6af2..cac04e18fc7 100644
--- a/source/blender/nodes/NOD_geometry_exec.hh
+++ b/source/blender/nodes/NOD_geometry_exec.hh
@@ -34,6 +34,8 @@ using bke::Float3ReadAttribute;
using bke::Float3WriteAttribute;
using bke::FloatReadAttribute;
using bke::FloatWriteAttribute;
+using bke::Int32ReadAttribute;
+using bke::Int32WriteAttribute;
using bke::PersistentDataHandleMap;
using bke::PersistentObjectHandle;
using bke::ReadAttribute;