Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc
| Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | |||||
| static bool component_is_available(const GeometrySet &geometry, | static bool component_is_available(const GeometrySet &geometry, | ||||
| const GeometryComponentType type, | const GeometryComponentType type, | ||||
| const eAttrDomain domain) | const eAttrDomain domain) | ||||
| { | { | ||||
| if (!geometry.has(type)) { | if (!geometry.has(type)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| const GeometryComponent &component = *geometry.get_component_for_read(type); | const GeometryComponent &component = *geometry.get_component_for_read(type); | ||||
| if (component.is_empty()) { | |||||
| return false; | |||||
| } | |||||
| return component.attribute_domain_size(domain) != 0; | return component.attribute_domain_size(domain) != 0; | ||||
| } | } | ||||
| static const GeometryComponent *find_source_component(const GeometrySet &geometry, | static const GeometryComponent *find_source_component(const GeometrySet &geometry, | ||||
| const eAttrDomain domain) | const eAttrDomain domain) | ||||
| { | { | ||||
| /* Choose the other component based on a consistent order, rather than some more complicated | /* Choose the other component based on a consistent order, rather than some more complicated | ||||
| * heuristic. This is the same order visible in the spreadsheet and used in the ray-cast node. */ | * heuristic. This is the same order visible in the spreadsheet and used in the ray-cast node. */ | ||||
| ▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines | |||||