37 b.use_custom_socket_order();
38 b.allow_any_socket_order();
39 b.add_default_layout();
42 b.add_input(type,
"List"_ustr).structure_type(StructureType::List).hide_value();
43 b.add_output(type,
"List"_ustr)
45 .structure_type(StructureType::List)
46 .align_with_previous();
51 .structure_type(StructureType::Dynamic)
52 .description(
"Whether each element should participate in sorting");
56 .structure_type(StructureType::Dynamic)
57 .description(
"Elements with the same Group ID are sorted together");
61 .structure_type(StructureType::Dynamic)
62 .description(
"A field or list of values that will determine the sorted order");
101 const T &default_value,
109 if (
list &&
list->size() == list_size) {
129 const int list_size =
list->size();
130 if (list_size <= 1) {
144 if (selection_variant.is_context_dependent_field()) {
147 else if (selection_variant.is_list()) {
149 std::make_shared<SampleIndexFunction>(selection_variant.extract<
GListPtr>()),
150 {fn::IndexFieldInput::get_field()});
167 list_size, selection, group_id, weights);
176 if (std::get_if<GList::SingleData>(&list_data)) {
181 if (
const auto *array_data = std::get_if<GList::ArrayData>(&list_data)) {
183 const GSpan src_span(type, array_data->data, list_size);
214 params.
set_output(
"List"_ustr, std::move(sorted_list));
#define NODE_CLASS_CONVERTER
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
void to_static_type(Fn &&fn) const
MutableSpan< T > typed() const
static VArray from_single(T value, const int64_t size)
bool is_context_dependent_field() const
void set_selection(Field< bool > selection)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_selection_as_mask() const
static FieldOperationPtr from(std::shared_ptr< const mf::MultiFunction > fn, Vector< GField > inputs)
static ArrayData ForConstructed(const CPPType &type, int64_t size)
GMutableSpan span_for_write(const CPPType &type, int64_t size)
std::variant< ArrayData, SingleData > DataVariant
static GListPtr create(const CPPType &type, DataVariant data, const int64_t size)
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
const bNodeTree & node_tree() const
const bNodeSocket & other_socket() const
eNodeSocketInOut in_out() const
T extract_input(const UString identifier)
void set_default_remaining_outputs()
void set_output(const UString identifier, T &&value)
void update_and_connect_available_socket(bNode &new_node, UString socket_name)
bNode & add_node(UString idname)
void operator()(LinkSearchOpParams ¶ms)
eNodeSocketDatatype socket_type
void gather(const GVArray &src, const IndexMask &indices, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
void node_register_type(bNodeType &ntype)
bNodeSocketType * node_socket_type_find_static(int type, int subtype=0)
std::optional< Array< int > > sort_indices_by_weights(int domain_size, const IndexMask &mask, const VArray< int > &group_id, const VArray< float > &weight)
QuaternionBase< float > Quaternion
static void node_rna(StructRNA *srna)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void get_varray_or_evaluate(const int list_size, bke::SocketValueVariant &value, ResourceScope &scope, fn::FieldEvaluator &field_evaluator, const T &default_value, VArray< T > &r_varray)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
ImplicitSharingPtr< Closure > ClosurePtr
const EnumPropertyItem * enum_items_filter(const EnumPropertyItem *original_item_array, FunctionRef< bool(const EnumPropertyItem &item)> fn)
ImplicitSharingPtr< Bundle > BundlePtr
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< int16_t, 2 > short2
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
const EnumPropertyItem rna_enum_node_socket_data_type_items[]
VecBase< float, 3 > float3
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
ColorSceneLinearByteEncoded4b< eAlpha::Premultiplied > ColorGeometry4b
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
bke::bNodeTreeType * typeinfo
bool(*) valid_socket_type(bNodeTreeType *ntreetype, bNodeSocketType *socket_type)
bool(*) validate_link(eNodeSocketDatatype from, eNodeSocketDatatype to)
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)