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>2021-10-13 19:26:23 +0300
committerHans Goudey <h.goudey@me.com>2021-10-13 19:26:23 +0300
commit96876305e18a9206a1d266b11e3a7d61c32be41f (patch)
tree3e9273635da4bd02fd6bbe43f129bf434f2f9758 /source/blender
parent78445ebd5fd99444741abee1406aa8d318b5a269 (diff)
Geometry Nodes: Make attribute capture work on instances
Previously the attribute capture node only worked on realized geometry, which was very confusing when other nodes worked on each individual instance. The realize instances node is the way to explicitly change between the two behaviors. Addresses T92155. Differential Revision: https://developer.blender.org/D12841
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
index 8cb7d81f432..7f12b816023 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
@@ -149,12 +149,14 @@ static void geo_node_attribute_capture_exec(GeoNodeExecParams params)
static const Array<GeometryComponentType> types = {
GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE};
- for (const GeometryComponentType type : types) {
- if (geometry_set.has(type)) {
- GeometryComponent &component = geometry_set.get_component_for_write(type);
- try_capture_field_on_geometry(component, anonymous_id.get(), domain, field);
+ geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
+ for (const GeometryComponentType type : types) {
+ if (geometry_set.has(type)) {
+ GeometryComponent &component = geometry_set.get_component_for_write(type);
+ try_capture_field_on_geometry(component, anonymous_id.get(), domain, field);
+ }
}
- }
+ });
GField output_field{
std::make_shared<bke::AnonymousAttributeFieldInput>(std::move(anonymous_id), type)};