31 b.use_custom_socket_order();
32 b.allow_any_socket_order();
33 b.add_default_layout();
34 b.add_input<
decl::Geometry>(
"Geometry").description(
"Geometry to update the selection of");
36 if (
const bNode *node =
b.node_or_null()) {
39 b.add_input<
decl::Bool>(
"Selection").default_value(
true).field_on_all();
42 b.add_input<
decl::Float>(
"Selection").default_value(1.0f).field_on_all();
56 node->
custom1 = int16_t(AttrDomain::Point);
65 static auto clamp = mf::build::SI1_SO<float, float>(
66 "Clamp", [](
const float value) {
return std::clamp(value, 0.0f, 1.0f); });
73 static auto invert = mf::build::SI1_SO<bool, bool>(
"Invert Selection",
74 [](
const bool value) {
return !value; });
78 static auto invert = mf::build::SI1_SO<float, float>(
79 "Invert Selection", [](
const float value) {
return 1.0f - value; });
93 if (meta_data->domain != domain) {
108 "Selection control is not supported in this mode");
126 case AttrDomain::Point:
133 case AttrDomain::Edge:
140 case AttrDomain::Face:
155 std::make_shared<bke::EvaluateOnDomainInput>(selection, domain));
172 if (
ELEM(domain, AttrDomain::Point, AttrDomain::Curve)) {
179 if (domain == AttrDomain::Point) {
187 if (
ELEM(domain, AttrDomain::Point, AttrDomain::Curve)) {
207 int(AttrDomain::Point));
213 "Store true or false selection values in edit mode"},
218 "Store floating point selection values. For mesh geometry, stored inverted as the sculpt "
220 {0,
nullptr, 0,
nullptr,
nullptr},
235 ntype.
ui_name =
"Set Selection";
236 ntype.
ui_description =
"Set selection of the edited geometry, for tool execution";
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_TOOL_SET_SELECTION
@ OB_MODE_PAINT_GREASE_PENCIL
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
static const CPPType & get()
std::optional< AttributeMetaData > lookup_meta_data(StringRef attribute_id) const
GVArray try_convert(GVArray varray, const CPPType &to_type) const
bool remove(const StringRef attribute_id)
const CPPType & cpp_type() const
static std::shared_ptr< FieldOperation > from(std::shared_ptr< const mf::MultiFunction > function, Vector< GField > inputs={})
constexpr T clamp(T, U, U) RET
CCL_NAMESPACE_BEGIN ccl_device float invert(const float color, const float factor)
void mesh_select_vert_flush(Mesh &mesh)
const DataTypeConversions & get_implicit_type_conversions()
void node_register_type(bNodeType &ntype)
void mesh_select_edge_flush(Mesh &mesh)
bool try_capture_field_on_geometry(MutableAttributeAccessor attributes, const fn::FieldContext &field_context, const StringRef attribute_id, AttrDomain domain, const fn::Field< bool > &selection, const fn::GField &field)
void mesh_select_face_flush(Mesh &mesh)
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)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const EnumPropertyItem rna_enum_attribute_domain_point_edge_face_curve_items[]
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)