15 .
description(
"The selection of each element as a true or false value");
17 "The selection of each element as a floating point value");
24 static const bool value =
true;
28 static const float value = 1.0f;
42 static const bool value =
false;
46 static const float value = 0.0f;
59 case AttrDomain::Point:
60 return ".select_vert";
61 case AttrDomain::Edge:
62 return ".select_edge";
63 case AttrDomain::Face:
64 case AttrDomain::Corner:
65 return ".select_poly";
75 :
bke::GeometryFieldInput(
bke::attribute_type_to_cpp_type(data_type),
"Edit Selection")
86 switch (context.type()) {
87 case GeometryComponent::Type::Curve:
88 case GeometryComponent::Type::PointCloud:
89 case GeometryComponent::Type::GreasePencil:
91 ".selection", domain, data_type,
true_value(data_type));
92 case GeometryComponent::Type::Mesh:
104 :
bke::GeometryFieldInput(
bke::attribute_type_to_cpp_type(data_type),
"Sculpt Selection")
115 switch (context.type()) {
116 case GeometryComponent::Type::Curve:
117 case GeometryComponent::Type::PointCloud:
118 case GeometryComponent::Type::GreasePencil:
120 ".selection", domain, data_type,
true_value(data_type));
121 case GeometryComponent::Type::Mesh: {
129 mask.foreach_index_optimized<
int>(
130 GrainSize(4096), [&](
const int i) { selection[
i] = attribute[
i] < 1.0f; });
135 mask.foreach_index_optimized<
int>(
136 GrainSize(4096), [&](
const int i) { selection[
i] = 1.0f - attribute[
i]; });
153 switch (object_mode) {
158 return GField(std::make_shared<EditSelectionFieldInput>(data_type));
162 return GField(std::make_shared<SculptSelectionFieldInput>(data_type));
187 ntype.
ui_description =
"User selection of the edited geometry, for tool execution";
#define GEO_NODE_TOOL_SELECTION
#define BLI_assert_unreachable()
@ OB_MODE_PAINT_GREASE_PENCIL
@ OB_MODE_SCULPT_GREASE_PENCIL
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static GVArray from_single(const CPPType &type, int64_t size, const void *value)
constexpr bool is_empty() const
static VArray from_container(ContainerT container)
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
GAttributeReader lookup(const StringRef attribute_id) const
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void node_register_type(bNodeType &ntype)
AttrType cpp_type_to_attribute_type(const CPPType &type)
const CPPType & attribute_type_to_cpp_type(AttrType type)
GField make_constant_field(const CPPType &type, const void *value)
void search_link_ops_for_tool_node(GatherLinkSearchOpParams ¶ms)
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)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare