Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | default: | ||||
| break; | break; | ||||
| } | } | ||||
| WeakAnonymousAttributeID anonymous_id{"Attribute Capture"}; | WeakAnonymousAttributeID anonymous_id{"Attribute Capture"}; | ||||
| const CPPType &type = field.cpp_type(); | const CPPType &type = field.cpp_type(); | ||||
| static const Array<GeometryComponentType> types = { | static const Array<GeometryComponentType> types = { | ||||
| GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}; | GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}; | ||||
| geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) { | |||||
| for (const GeometryComponentType type : types) { | for (const GeometryComponentType type : types) { | ||||
| if (geometry_set.has(type)) { | if (geometry_set.has(type)) { | ||||
| GeometryComponent &component = geometry_set.get_component_for_write(type); | GeometryComponent &component = geometry_set.get_component_for_write(type); | ||||
| try_capture_field_on_geometry(component, anonymous_id.get(), domain, field); | try_capture_field_on_geometry(component, anonymous_id.get(), domain, field); | ||||
| } | } | ||||
| } | } | ||||
| }); | |||||
| GField output_field{ | GField output_field{ | ||||
| std::make_shared<bke::AnonymousAttributeFieldInput>(std::move(anonymous_id), type)}; | std::make_shared<bke::AnonymousAttributeFieldInput>(std::move(anonymous_id), type)}; | ||||
| switch (data_type) { | switch (data_type) { | ||||
| case CD_PROP_FLOAT: { | case CD_PROP_FLOAT: { | ||||
| params.set_output("Attribute_001", Field<float>(output_field)); | params.set_output("Attribute_001", Field<float>(output_field)); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||