32 material_indices.
append(i);
36 for (const int i : range) {
37 const int face_index = mask[i];
38 r_selection[i] = material_indices.contains(mesh.mpoly[face_index].mat_nr);
50 category_ = Category::Generated;
62 if (
mesh ==
nullptr) {
74 return mesh_component.
attributes()->adapt_domain<
bool>(
89 return material_ == other_material_selection->material_;
99 params.set_output(
"Selection", std::move(material_field));
@ GEO_COMPONENT_TYPE_MESH
General operations, lookup, etc. for materials.
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
#define GEO_NODE_MATERIAL_SELECTION
static uint8 component(Color32 c, uint i)
const Mesh * get_for_read() const
std::optional< blender::bke::AttributeAccessor > attributes() const final
constexpr int64_t size() const
void append(const T &value)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static void node_geo_exec(GeoNodeExecParams params)
static void select_mesh_by_material(const Mesh &mesh, const Material *material, const IndexMask mask, const MutableSpan< bool > r_selection)
static void node_declare(NodeDeclarationBuilder &b)
void parallel_for(IndexRange range, int64_t grain_size, const Function &function)
uint64_t get_default_hash(const T &v)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_geo_material_selection()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
unsigned __int64 uint64_t
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare