17 b.use_custom_socket_order();
18 b.allow_any_socket_order();
20 .supported_type({GeometryComponent::Type::Mesh, GeometryComponent::Type::GreasePencil})
21 .description(
"Geometry to replace materials on");
22 b.add_output<
decl::Geometry>(
"Geometry").propagate_all().align_with_previous();
32 if (materials[
i] == src_material) {
33 materials[
i] = dst_material;
46 if (
Mesh *mesh = geometry_set.get_mesh_for_write()) {
49 if (
GreasePencil *grease_pencil = geometry_set.get_grease_pencil_for_write()) {
50 replace_materials({grease_pencil->material_array, grease_pencil->material_array_num},
56 params.set_output(
"Geometry", std::move(geometry_set));
64 ntype.
ui_name =
"Replace Material";
Low-level operations for grease pencil.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_REPLACE_MATERIAL
#define BLT_I18NCONTEXT_ID_MATERIAL
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr IndexRange index_range() const
void node_register_type(bNodeType &ntype)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
static void node_register()
static void node_geo_exec(GeoNodeExecParams params)
static void replace_materials(MutableSpan< Material * > materials, Material *src_material, Material *dst_material)
static void node_declare(NodeDeclarationBuilder &b)
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
NodeDeclareFunction declare