17 b.add_output<
decl::Bool>(
"Selection").field_source_reference_all();
30 for (
int current_vert = start_vert; !vert_selection[current_vert];
31 current_vert = next_indices[current_vert])
36 vert_selection[current_vert] =
true;
42 for (const int i : range) {
43 const int2 edge = edges[i];
44 if (!(vert_selection[edge[0]] && vert_selection[edge[1]])) {
47 if (edge[0] == next_indices[edge[1]] || edge[1] == next_indices[edge[0]]) {
48 r_edge_selection[i] = true;
61 : bke::MeshFieldInput(
CPPType::get<bool>(),
"Edge Selection"),
62 start_vertices_(start_verts),
63 next_vertex_(next_vertex)
65 category_ = Category::Generated;
69 const AttrDomain domain,
74 evaluator.add(next_vertex_);
75 evaluator.add(start_vertices_);
78 const IndexMask start_verts = evaluator.get_evaluated_as_mask(1);
79 if (start_verts.is_empty()) {
106 return other_field->start_vertices_ == start_vertices_ &&
107 other_field->next_vertex_ == next_vertex_;
114 return AttrDomain::Edge;
123 std::make_shared<PathToEdgeSelectionFieldInput>(start_verts, next_vertex)};
124 params.set_output(
"Selection", std::move(selection_field));
132 ntype.
ui_name =
"Edge Paths to Selection";
133 ntype.
ui_description =
"Output a selection of edges by following paths across mesh edges";
#define GEO_NODE_EDGE_PATHS_TO_SELECTION
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr bool contains(int64_t value) const
constexpr IndexRange index_range() const
virtual void for_each_field_input_recursive(FunctionRef< void(const FieldInput &)> fn) const
const FieldNode & node() const
void foreach_index(Fn &&fn) const
void node_type_size(bNodeType &ntype, int width, int minwidth, int maxwidth)
void node_register_type(bNodeType &ntype)
static void node_register()
static void edge_paths_to_selection(const Mesh &src_mesh, const IndexMask &start_selection, const Span< int > next_indices, MutableSpan< bool > r_edge_selection)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
uint64_t get_default_hash(const T &v, const Args &...args)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
unsigned __int64 uint64_t
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare