20 b.use_custom_socket_order();
21 b.allow_any_socket_order();
22 b.add_input<
decl::Geometry>(
"Geometry").description(
"Points to modify the positions of");
23 b.add_output<
decl::Geometry>(
"Geometry").propagate_all().align_with_previous();
31 static const auto fn = mf::build::SI2_SO<float3, float3, float3>(
34 mf::build::exec_presets::AllSpanOrSingle());
40 static const auto fn = mf::build::SI2_SO<float3, float3, float3>(
43 mf::build::exec_presets::AllSpanOrSingle());
69 attribute_names.
append(
"position");
70 fields.
append(position_field);
72 if (attributes.
contains(
"handle_right") && attributes.
contains(
"handle_left")) {
75 for (
const StringRef name : {
"handle_left",
"handle_right"}) {
92 for (
const int layer_index : grease_pencil.layers().index_range()) {
93 Drawing *drawing = grease_pencil.get_eval_drawing(grease_pencil.layer(layer_index));
125 [&](
const int i) { transforms[
i].location() =
result[
i]; });
171 ntype.
ui_name =
"Set Position";
Low-level operations for curves.
Low-level operations for grease pencil.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_SET_POSITION
@ NODE_DEFAULT_INPUT_POSITION_FIELD
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void append(const T &value)
bool contains(StringRef attribute_id) const
MutableAttributeAccessor attributes_for_write()
void calculate_bezier_auto_handles()
int instances_num() const
MutableSpan< float4x4 > transforms_for_write()
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
void tag_positions_changed()
void set_selection(Field< bool > selection)
IndexMask get_evaluated_selection_as_mask() const
int add_with_destination(GField field, GVMutableArray dst)
static std::shared_ptr< FieldOperation > from(std::shared_ptr< const mf::MultiFunction > function, Vector< GField > inputs={})
void foreach_index(Fn &&fn) const
void node_register_type(bNodeType &ntype)
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)
bool try_capture_fields_on_geometry(MutableAttributeAccessor attributes, const fn::FieldContext &field_context, Span< StringRef > attribute_ids, AttrDomain domain, const fn::Field< bool > &selection, Span< fn::GField > fields)
static void set_position_in_grease_pencil(GreasePencil &grease_pencil, const Field< bool > &selection_field, const Field< float3 > &position_field)
static void node_geo_exec(GeoNodeExecParams params)
static const auto & get_add_fn()
static void node_declare(NodeDeclarationBuilder &b)
static void set_curves_position(bke::CurvesGeometry &curves, const fn::FieldContext &field_context, const Field< bool > &selection_field, const Field< float3 > &position_field)
static void node_register()
static void set_instances_position(bke::Instances &instances, const Field< bool > &selection_field, const Field< float3 > &position_field)
static const auto & get_sub_fn()
static void set_points_position(bke::MutableAttributeAccessor attributes, const fn::FieldContext &field_context, const Field< bool > &selection_field, const Field< float3 > &position_field)
VecBase< float, 3 > float3
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