35 b.use_custom_socket_order();
36 b.allow_any_socket_order();
37 b.add_default_layout();
38 b.add_input<
decl::Geometry>(
"Geometry"_ustr).description(
"Geometry to update the selection of");
42 case SelectionType::Boolean:
43 b.add_input<
decl::Bool>(
"Selection"_ustr).default_value(
true).evaluated_geometry_field();
45 case SelectionType::Float:
46 b.add_input<
decl::Float>(
"Selection"_ustr).default_value(1.0f).evaluated_geometry_field();
69 static auto clamp = mf::build::SI1_SO<float, float>(
70 "Clamp", [](
const float value) {
return std::clamp(value, 0.0f, 1.0f); });
82 "float - float"_ustr);
95 if (
const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(name)) {
96 if (meta_data->domain != domain) {
111 "Selection control is not supported in this mode");
129 case AttrDomain::Point:
136 case AttrDomain::Edge:
143 case AttrDomain::Face:
160 std::move(clamped_and_inverted));
174 if (
ELEM(domain, AttrDomain::Point, AttrDomain::Curve)) {
181 if (domain == AttrDomain::Point) {
189 if (
ELEM(domain, AttrDomain::Point, AttrDomain::Curve)) {
209 int(AttrDomain::Point));
211 {int(SelectionType::Boolean),
215 "Store true or false selection values in edit mode"},
216 {int(SelectionType::Float),
220 "Store floating point selection values. For mesh geometry, stored inverted as the sculpt "
222 {0,
nullptr, 0,
nullptr,
nullptr},
230 int(SelectionType::Boolean));
237 ntype.
ui_name =
"Set Selection";
238 ntype.
ui_description =
"Set selection of the edited geometry, for tool execution";
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_TOOL_SET_SELECTION
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
std::optional< AttributeMetaData > lookup_meta_data(StringRef name) const
GVArray try_convert(GVArray varray, const CPPType &to_type) const
bool remove(const StringRef name)
const CPPType & cpp_type() const
static FieldOperationPtr from(std::shared_ptr< const mf::MultiFunction > fn, Vector< GField > inputs)
static GField from_input(Args &&...args)
void error_message_add(const NodeWarningType type, StringRef message) const
T extract_input(const UString identifier)
GeoNodesUserData * user_data() const
const bNode & node() const
void set_output(const UString identifier, T &&value)
constexpr T clamp(T, U, U) RET
float2x2 invert(float2x2 mat)
void mesh_select_vert_flush(Mesh &mesh)
bool try_capture_field_on_geometry(MutableAttributeAccessor attributes, const fn::FieldContext &field_context, const StringRef name, AttrDomain domain, const fn::Field< bool > &selection, const fn::GField &field)
const DataTypeConversions & get_implicit_type_conversions()
void node_register_type(bNodeType &ntype)
void mesh_select_edge_flush(Mesh &mesh)
void mesh_select_face_flush(Mesh &mesh)
const MultiFunction & lookup(UString id)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
void search_link_ops_for_tool_node(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)
bool check_tool_context_and_error(GeoNodeExecParams ¶ms)
@ OB_MODE_PAINT_GREASE_PENCIL
const EnumPropertyItem rna_enum_attribute_domain_point_edge_face_curve_items[]
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
GeoNodesOperatorData * operator_data
const GeoNodesCallData * call_data
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)