diff options
author | Hans Goudey <h.goudey@me.com> | 2021-01-15 20:04:32 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-15 20:04:32 +0300 |
commit | 0b0e45252b11bbc1c0d96a3e04a4087d02f765e3 (patch) | |
tree | 63e8f90c56eed01c1d8c818af02c9984859575a0 /source/blender/blenkernel/BKE_geometry_set.hh | |
parent | 3732508c64ad51c77a6fb83a2444af104d95cfd9 (diff) |
Geometry Nodes: Use a default value in the point scale node
This commit adds the ability to provide a default value to
`attribute_try_get_for_output` and uses it for the `Point Scale` node,
which is important because the node uses multiplication.
The idea is to keep "name-specific" functionality in nodes rather than in
the attribute API, otherwise the complexity will be hard to keep track of.
So this fix doesn't apply to the Attribute Vector Math node, but hopfully
that is okay since that's now a lower level node for this purpose anyway.
Differential Revision: https://developer.blender.org/D10115
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_geometry_set.hh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index 57fad6bcdf6..391bd243edf 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -242,7 +242,8 @@ class GeometryComponent { /** * If an attribute with the given params exist, it is returned. - * If no attribute with the given name exists, it is created and returned. + * If no attribute with the given name exists, create it and + * fill it with the default value if it is provided. * If an attribute with the given name but different domain or type exists, a temporary attribute * is created that has to be saved after the output has been computed. This avoids deleting * another attribute, before a computation is finished. @@ -251,7 +252,8 @@ class GeometryComponent { */ OutputAttributePtr attribute_try_get_for_output(const blender::StringRef attribute_name, const AttributeDomain domain, - const CustomDataType data_type); + const CustomDataType data_type, + const void *default_value = nullptr); }; template<typename T> |