29 {0,
nullptr, 0,
nullptr,
nullptr},
37 "The handle can be moved anywhere, and does not influence the point's other handle"},
42 "The location is automatically calculated to be smooth"},
47 "The location is calculated to point to the next/previous control point"},
52 "The location is constrained to point in the opposite direction as the other handle"},
53 {0,
nullptr, 0,
nullptr,
nullptr},
61 N_(
"Calculate normals with the smallest twist around the curve tangent across the whole "
67 N_(
"Calculate normals perpendicular to the Z axis and the curve tangent. If a series of "
68 "points is vertical, the X axis is used.")},
73 N_(
"Use the stored custom normal attribute as the final normals")},
74 {0,
nullptr, 0,
nullptr,
nullptr},
79# include <fmt/format.h>
97 return reinterpret_cast<Curves *
>(
ptr->owner_id);
100static int rna_Curves_curve_offset_data_length(
PointerRNA *
ptr)
111 curves->
geometry.wrap().offsets_for_write().data(),
125 *
ptr, &RNA_IntAttributeValue, &curves->
geometry.wrap().offsets_for_write()[index], *r_ptr);
131 return reinterpret_cast<float (*)[3]
>(curves.
geometry.wrap().positions_for_write().
data());
136 return reinterpret_cast<const float (*)[3]
>(curves.
geometry.wrap().positions().
data());
139static int rna_CurvePoint_index_get_const(
const PointerRNA *
ptr)
142 const float (*co)[3] =
static_cast<float (*)[3]
>(
ptr->data);
144 return int(co - positions);
152 curves->
geometry.wrap().offsets_for_write().data(),
172 *
ptr, &RNA_CurveSlice, &curves->
geometry.wrap().offsets_for_write()[index], *r_ptr);
189 &RNA_FloatVectorAttributeValue,
209 return rna_CurvePoint_index_get_const(
ptr);
212static void rna_CurvePoint_location_get(
PointerRNA *
ptr,
float value[3])
217static void rna_CurvePoint_location_set(
PointerRNA *
ptr,
const float value[3])
229 return radii[rna_CurvePoint_index_get_const(
ptr)];
232static void rna_CurvePoint_radius_set(
PointerRNA *
ptr,
float value)
242 radii.
varray.set(rna_CurvePoint_index_get_const(
ptr), value);
245static std::optional<std::string> rna_CurvePoint_path(
const PointerRNA *
ptr)
247 return fmt::format(
"points[{}]", rna_CurvePoint_index_get_const(
ptr));
261static int rna_CurveSlice_index_get_const(
const PointerRNA *
ptr)
269 return rna_CurveSlice_index_get_const(
ptr);
272static std::optional<std::string> rna_CurveSlice_path(
const PointerRNA *
ptr)
274 return fmt::format(
"curves[{}]", rna_CurveSlice_index_get_const(
ptr));
277static int rna_CurveSlice_first_point_index_get(
PointerRNA *
ptr)
279 const int *offset_ptr =
static_cast<int *
>(
ptr->data);
285 const int *offset_ptr =
static_cast<int *
>(
ptr->data);
286 const int offset = *offset_ptr;
287 return *(offset_ptr + 1) - offset;
293 const int offset = rna_CurveSlice_first_point_index_get(
ptr);
294 const int size = rna_CurveSlice_points_length_get(
ptr);
296 float (*co)[3] = positions + offset;
310 ID *
id =
ptr->owner_id;
320 ID *
id =
ptr->owner_id;
341 prop,
"rna_CurvePoint_location_get",
"rna_CurvePoint_location_set",
nullptr);
347 prop,
"rna_CurvePoint_radius_get",
"rna_CurvePoint_radius_set",
nullptr);
385 "rna_CurveSlice_points_begin",
386 "rna_iterator_array_next",
387 "rna_iterator_array_end",
388 "rna_iterator_array_get",
389 "rna_CurveSlice_points_length_get",
398 prop,
"First Point Index",
"The index of this curve's first control point");
425 "rna_Curves_curves_begin",
426 "rna_iterator_array_next",
427 "rna_iterator_array_end",
428 "rna_iterator_array_get",
429 "rna_Curves_curves_length",
430 "rna_Curves_curves_lookup_int",
440 "rna_Curves_position_data_begin",
441 "rna_iterator_array_next",
442 "rna_iterator_array_end",
443 "rna_iterator_array_get",
444 "rna_Curves_position_data_length",
445 "rna_Curves_points_lookup_int",
455 "rna_Curves_position_data_begin",
456 "rna_iterator_array_next",
457 "rna_iterator_array_end",
458 "rna_iterator_array_get",
459 "rna_Curves_position_data_length",
460 "rna_Curves_position_data_lookup_int",
470 "rna_Curves_curve_offset_data_begin",
471 "rna_iterator_array_next",
472 "rna_iterator_array_end",
473 "rna_iterator_array_get",
474 "rna_Curves_curve_offset_data_length",
475 "rna_Curves_curve_offset_data_lookup_int",
488 "rna_Curves_normals_begin",
489 "rna_iterator_array_next",
490 "rna_iterator_array_end",
491 "rna_iterator_array_get",
492 "rna_Curves_position_data_length",
497 prop,
"Normals",
"The curve normal value at each of the curve's control points");
513 "rna_IDMaterials_assign_int");
527 "The name of the attribute on the surface mesh used to define the "
528 "attachment of each curve");
556 prop,
"Use Sculpt Collision",
"Enable collision with the surface while sculpting");
565 prop,
"Collision distance",
"Distance to keep the curves away from the surface");
Generic geometry attributes built on CustomData.
Low-level operations for curves.
MINLINE void copy_v3_v3(float r[3], const float a[3])
void DEG_id_tag_update(ID *id, unsigned int flags)
@ NORMAL_MODE_MINIMUM_TWIST
@ CV_SCULPT_COLLISION_ENABLED
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
GAttributeWriter lookup_or_add_for_write(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
Vector< Span< float3 > > get_curves_positions(const bke::CurvesGeometry &curves)
float(* point_normals_array_create(const Curves *curves_id))[3]
Vector< MutableSpan< float3 > > get_curves_positions_for_write(bke::CurvesGeometry &curves)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
void rna_pointer_create_with_ancestors(const PointerRNA &parent, StructRNA *type, void *data, PointerRNA &r_ptr)
void rna_def_animdata_common(StructRNA *srna)
const EnumPropertyItem rna_enum_attribute_curves_domain_items[]
void rna_def_attributes_common(StructRNA *srna, const AttributeOwnerType type)
const EnumPropertyItem rna_enum_curve_normal_mode_items[]
static void rna_def_curves_point(BlenderRNA *brna)
void RNA_def_curves(BlenderRNA *brna)
static void rna_def_curves(BlenderRNA *brna)
const EnumPropertyItem rna_enum_curves_handle_type_items[]
static void rna_def_read_only_float_vector(BlenderRNA *brna)
static void rna_def_curves_curve(BlenderRNA *brna)
const EnumPropertyItem rna_enum_curves_type_items[]
void RNA_api_curves(StructRNA *srna)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
VMutableArray< T > varray
void WM_main_add_notifier(uint type, void *reference)