21 curves.tag_topology_changed();
27 curves.update_curve_types();
28 curves.tag_topology_changed();
34 curves.tag_positions_changed();
40 curves.tag_radii_changed();
46 curves.tag_normals_changed();
52 curves.tag_material_index_changed();
68 if (vertex_group_index < 0) {
77 const int vertex_group_index)
const
94 if (vertex_group_index < 0) {
115 if (
curves->deform_verts().is_empty()) {
136 const auto get_fn = [&]() {
163 return &
curves.curve_data;
167 return &
curves.curve_data;
169 [](
const void *owner) ->
int {
171 return curves.curves_num();
176 return &
curves.point_data;
180 return &
curves.point_data;
182 [](
const void *owner) ->
int {
184 return curves.points_num();
229 static auto handle_type_clamp = mf::build::SI1_SO<int8_t, int8_t>(
230 "Handle Type Validate",
234 mf::build::exec_presets::AllSpanOrSingle());
251 static float default_nurbs_weight = 1.0f;
259 &default_nurbs_weight);
261 static const auto nurbs_order_clamp = mf::build::SI1_SO<int8_t, int8_t>(
262 "NURBS Order Validate",
263 [](int8_t value) {
return std::max<int8_t>(value, 1); },
264 mf::build::exec_presets::AllSpanOrSingle());
265 static int nurbs_order_default = 4;
273 &nurbs_order_default);
275 static const auto normal_mode_clamp = mf::build::SI1_SO<int8_t, int8_t>(
276 "Normal Mode Validate",
280 mf::build::exec_presets::AllSpanOrSingle());
296 static const auto knots_mode_clamp = mf::build::SI1_SO<int8_t, int8_t>(
297 "Knots Mode Validate",
301 mf::build::exec_presets::AllSpanOrSingle());
310 static const auto curve_type_clamp = mf::build::SI1_SO<int8_t, int8_t>(
311 "Curve Type Validate",
315 mf::build::exec_presets::AllSpanOrSingle());
324 static const auto resolution_clamp = mf::build::SI1_SO<int, int>(
325 "Resolution Validate",
326 [](
int value) {
return std::max<int>(value, 1); },
327 mf::build::exec_presets::AllSpanOrSingle());
328 static int resolution_default = 12;
336 &resolution_default);
345 static const auto material_index_clamp = mf::build::SI1_SO<int, int>(
346 "Material Index Validate",
349 return std::clamp<int>(value, 0, std::numeric_limits<short>::max());
351 mf::build::exec_presets::AllSpanOrSingle());
381 {&vertex_groups, &curve_custom_data, &point_custom_data});
391 fn.domain_size = [](
const void *owner,
const AttrDomain domain) {
392 if (owner ==
nullptr) {
398 return curves.points_num();
400 return curves.curves_num();
405 fn.domain_supported = [](
const void * ,
const AttrDomain domain) {
408 fn.adapt_domain = [](
const void *owner,
412 if (owner ==
nullptr) {
416 return curves.adapt_domain(varray, from_domain, to_domain);
Low-level operations for curves.
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
@ NORMAL_MODE_MINIMUM_TWIST
@ NURBS_KNOT_MODE_ENDPOINT_BEZIER
Object is a sort of wrapper for general info.
constexpr bool is_empty() const
static VArray ForSingle(T value, const int64_t size)
bool foreach_attribute(const void *owner, FunctionRef< void(const AttributeIter &)> fn) const final
GAttributeReader try_get_for_read(const void *owner, const StringRef attribute_id) const final
void foreach_domain(const FunctionRef< void(AttrDomain)> callback) const final
GAttributeWriter try_get_for_write(void *owner, const StringRef attribute_id) const final
bool try_delete(void *owner, const StringRef name) const final
GAttributeReader get_for_vertex_group_index(const CurvesGeometry &curves, const Span< MDeformVert > dverts, const int vertex_group_index) const
void MEM_freeN(void *vmemh)
AttributeAccessorFunctions accessor_functions_for_providers()
static GeometryAttributeProviders create_attribute_providers_for_curve()
static void tag_component_curve_types_changed(void *owner)
static void tag_component_positions_changed(void *owner)
const AttributeAccessorFunctions & get_attribute_accessor_functions()
static void tag_component_topology_changed(void *owner)
static void tag_component_radii_changed(void *owner)
static AttributeAccessorFunctions get_curves_accessor_functions()
static void tag_component_material_index_changed(void *owner)
static void tag_component_normals_changed(void *owner)
void remove_defgroup_index(MutableSpan< MDeformVert > dverts, int defgroup_index)
VMutableArray< float > varray_for_mutable_deform_verts(MutableSpan< MDeformVert > dverts, int defgroup_index)
VArray< float > varray_for_deform_verts(Span< MDeformVert > dverts, int defgroup_index)