21 b.add_output<
decl::Bool>(
"Selection").field_source_reference_all();
34 for (
int current_vert = start_vert; !vert_selection[current_vert];
35 current_vert = next_indices[current_vert])
40 vert_selection[current_vert] =
true;
46 for (const int i : range) {
47 const int2 edge = edges[i];
48 if (!(vert_selection[edge[0]] && vert_selection[edge[1]])) {
51 if (edge[0] == next_indices[edge[1]] || edge[1] == next_indices[edge[0]]) {
52 r_edge_selection[i] = true;
65 : bke::MeshFieldInput(
CPPType::get<bool>(),
"Edge Selection"),
66 start_vertices_(start_verts),
67 next_vertex_(next_vertex)
69 category_ = Category::Generated;
73 const AttrDomain domain,
78 evaluator.
add(next_vertex_);
79 evaluator.add(start_vertices_);
82 const IndexMask start_verts = evaluator.get_evaluated_as_mask(1);
83 if (start_verts.is_empty()) {
90 return mesh.attributes().adapt_domain<
bool>(
110 return other_field->start_vertices_ == start_vertices_ &&
111 other_field->next_vertex_ == next_vertex_;
118 return AttrDomain::Edge;
127 std::make_shared<PathToEdgeSelectionFieldInput>(start_verts, next_vertex)};
128 params.set_output(
"Selection", std::move(selection_field));
136 &ntype, GEO_NODE_EDGE_PATHS_TO_SELECTION,
"Edge Paths to Selection",
NODE_CLASS_INPUT);
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr bool contains(int64_t value) const
int add(GField field, GVArray *varray_ptr)
virtual void for_each_field_input_recursive(FunctionRef< void(const FieldInput &)> fn) const
const FieldNode & node() const
void foreach_index(Fn &&fn) const
local_group_size(16, 16) .push_constant(Type b
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)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
GPU_SHADER_INTERFACE_INFO(overlay_edit_curve_handle_iface, "vert").flat(Type pos vertex_in(1, Type::UINT, "data") .vertex_out(overlay_edit_curve_handle_iface) .geometry_layout(PrimitiveIn Frequency::GEOMETRY storage_buf(1, Qualifier::READ, "uint", "data[]", Frequency::GEOMETRY) .push_constant(Type Frequency::GEOMETRY selection[]
unsigned __int64 uint64_t
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare