26 b.add_input<
decl::Geometry>(
"Curve").supported_type(GeometryComponent::Type::Curve);
29 .implicit_field_on_all([](
const bNode &node,
void *r_value) {
99 evaluator.
add(position_field);
100 evaluator.
add(offset_field);
120 for (
const int i : segment) {
123 for (
const int i : segment) {
127 new_positions[i] + new_offsets[i],
129 handle_positions_other[i]);
148 std::atomic<bool> has_curves =
false;
149 std::atomic<bool> has_bezier =
false;
156 if (!attributes.
contains(
"handle_left") || !attributes.
contains(
"handle_right")) {
165 if (has_curves && !has_bezier) {
166 params.error_message_add(NodeWarningType::Info,
TIP_(
"Input curves do not have Bézier type"));
169 params.set_output(
"Curve", std::move(geometry_set));
177 "Whether to update left and right handles",
194 "NodeGeometrySetCurveHandlePositions",
Low-level operations for curves.
#define GEO_NODE_SET_CURVE_HANDLES
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
GeometryNodeCurveHandleMode
@ GEO_NODE_CURVE_HANDLE_LEFT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
bool contains(const StringRef attribute_id) const
MutableSpan< int8_t > handle_types_right_for_write()
MutableSpan< float3 > handle_positions_left_for_write()
MutableSpan< float3 > handle_positions_right_for_write()
Span< float3 > positions() const
void tag_positions_changed()
AttributeAccessor attributes() const
void calculate_bezier_auto_handles()
MutableSpan< int8_t > handle_types_left_for_write()
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
local_group_size(16, 16) .push_constant(Type b
void set_handle_position(const float3 &position, HandleType type, HandleType type_other, const float3 &new_handle, float3 &handle, float3 &handle_other)
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
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 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 update_handle_types_for_movement(int8_t &type, int8_t &other)
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)
VecBase< float, 3 > float3
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
GPU_SHADER_INTERFACE_INFO(overlay_edit_curve_handle_iface, "vert").flat(Type pos vertex_in(1, Type::UINT, "data") .vertex_out(overlay_edit_curve_handle_iface) .geometry_layout(PrimitiveIn Frequency::GEOMETRY storage_buf(1, Qualifier::READ, "uint", "data[]", Frequency::GEOMETRY) .push_constant(Type Frequency::GEOMETRY selection[]
const EnumPropertyItem rna_enum_node_geometry_curve_handle_side_items[]
Curves * get_curves_for_write()
void modify_geometry_sets(ForeachSubGeometryCallback callback)
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare