28 b.use_custom_socket_order();
29 b.allow_any_socket_order();
30 b.add_default_layout();
36 .description(
"Curves to change the handles on");
37 b.add_output<
decl::Geometry>(
"Curve"_ustr).propagate_all_geometry().align_with_previous();
41 .evaluated_geometry_field();
52 .evaluated_geometry_field();
119 evaluator.
add(position_field);
120 evaluator.
add(offset_field);
130 curves.handle_types_right_for_write();
132 curves.handle_types_left_for_write();
134 curves.handle_positions_right_for_write();
136 curves.handle_positions_right_for_write() :
137 curves.handle_positions_left_for_write();
144 selection.slice(range).foreach_index_optimized<int>([&](const int i) {
145 if (update_handle_types_for_movement(handle_types[i], handle_types_other[i])) {
151 std::logical_or<>());
153 selection.foreach_segment(
155 for (
const int i : segment) {
159 new_positions[i] + new_offsets[i],
161 handle_positions_other[i]);
167 curves.tag_topology_changed();
169 curves.calculate_bezier_auto_handles();
170 curves.tag_positions_changed();
183 std::atomic<bool> has_curves =
false;
184 std::atomic<bool> has_bezier =
false;
191 if (!attributes.
contains(
"handle_left") || !attributes.
contains(
"handle_right")) {
200 if (has_curves && !has_bezier) {
204 params.
set_output(
"Curve"_ustr, std::move(geometry_set));
212 "Whether to update left and right handles",
224 ntype.
ui_name =
"Set Handle Positions";
225 ntype.
ui_description =
"Set the positions for the handles of Bézier curves";
233 "NodeGeometrySetCurveHandlePositions",
Low-level operations for curves.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_SET_CURVE_HANDLES
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
bool contains(StringRef name) const
void set_selection(Field< bool > selection)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_selection_as_mask() const
const GVArray & get_evaluated(const int field_index) const
IndexRange index_range() const
void error_message_add(const NodeWarningType type, StringRef message) const
T extract_input(const UString identifier)
const bNode & node() const
void set_output(const UString identifier, T &&value)
#define storage(slot, qualifiers)
void set_handle_position(const float3 &position, HandleType type, HandleType type_other, const float3 &new_handle, float3 &handle, float3 &handle_other)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
constexpr ParallelGrainSize grain_size(int grain_size)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
static void node_init(bNodeTree *, bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void node_geo_exec(GeoNodeExecParams params)
static bool update_handle_types_for_movement(int8_t &type, int8_t &other)
static void set_position_in_component(Curves &curves_id, const GeometryNodeCurveHandleMode mode, const Field< bool > &selection_field, const Field< float3 > &position_field, const Field< float3 > &offset_field)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_rna(StructRNA *srna)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
Value parallel_reduce(IndexRange range, int64_t grain_size, const Value &identity, const Function &function, const Reduction &reduction)
BMesh const char void * data
@ NODE_DEFAULT_INPUT_HANDLE_RIGHT_FIELD
@ NODE_DEFAULT_INPUT_HANDLE_LEFT_FIELD
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
VecBase< float, 3 > float3
const EnumPropertyItem rna_enum_node_geometry_curve_handle_side_items[]
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
GeometryNodeCurveHandleMode
@ GEO_NODE_CURVE_HANDLE_LEFT
Curves * get_curves_for_write()
static constexpr int _160
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)