23 b.use_custom_socket_order();
24 b.allow_any_socket_order();
27 .
description(
"Grease Pencil to change the color of");
29 .propagate_all_geometry()
30 .align_with_previous();
34 .evaluated_geometry_field();
40 .evaluated_geometry_field()
46 .evaluated_geometry_field();
70 for (
const int layer_index :
grease_pencil->layers().index_range()) {
82 if (!attributes.
contains(opacity_attr)) {
90 {color_attr, opacity_attr},
93 {color_field, opacity_field});
127 params.
set_output(
"Grease Pencil"_ustr, std::move(geometry_set));
135 ntype.
ui_name =
"Set Grease Pencil Color";
136 ntype.
ui_description =
"Set color and opacity attributes on Grease Pencil geometry";
Low-level operations for curves.
Low-level operations for grease pencil.
#define NODE_CLASS_GEOMETRY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
bool contains(StringRef name) const
bool add(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
bke::CurvesGeometry & strokes_for_write()
T extract_input(const UString identifier)
T get_input(const UString identifier) const
void set_output(const UString identifier, T &&value)
bool try_capture_fields_on_geometry(MutableAttributeAccessor attributes, const fn::FieldContext &field_context, Span< StringRef > names, AttrDomain domain, const fn::Field< bool > &selection, Span< fn::GField > fields)
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_declare(NodeDeclarationBuilder &b)
static void node_init(bNodeTree *, bNode *node)
static void node_geo_exec(GeoNodeExecParams params)
static void set_grease_pencil_color(GeometrySet &geometry_set, const AttrDomain domain, const StringRef color_attr, const StringRef opacity_attr, const Field< bool > &selection, const Field< ColorGeometry4f > &color_field, const Field< float > &opacity_field)
NodeGeometryGreasePencilStrokeType
@ GEO_NODE_GREASE_PENCIL_STROKE
@ GEO_NODE_GREASE_PENCIL_FILL
@ GEO_NODE_GREASE_PENCIL_BOTH
const EnumPropertyItem rna_enum_node_grease_pencil_stroke_type_items[]
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
static constexpr int _180
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
void(*) initfunc(bNodeTree *ntree, bNode *node)
NodeDeclareFunction declare