27 {0,
nullptr, 0,
nullptr,
nullptr},
35 "The handle can be moved anywhere, and doesn't influence the point's other handle"},
40 "The location is automatically calculated to be smooth"},
45 "The location is calculated to point to the next/previous control point"},
50 "The location is constrained to point in the opposite direction as the other handle"},
51 {0,
nullptr, 0,
nullptr,
nullptr},
59 "Calculate normals with the smallest twist around the curve tangent across the whole curve"},
64 "Calculate normals perpendicular to the Z axis and the curve tangent. If a series of points "
65 "is vertical, the X axis is used."},
70 "Use the stored custom normal attribute as the final normals"},
71 {0,
nullptr, 0,
nullptr,
nullptr},
76# include <fmt/format.h>
94 return reinterpret_cast<Curves *
>(
ptr->owner_id);
97static int rna_Curves_curve_offset_data_length(
PointerRNA *
ptr)
108 curves->
geometry.wrap().offsets_for_write().data(),
122 *
ptr, &RNA_IntAttributeValue, &curves->
geometry.wrap().offsets_for_write()[index], *r_ptr);
128 return reinterpret_cast<float(*)[3]
>(curves.
geometry.wrap().positions_for_write().
data());
133 return reinterpret_cast<const float(*)[3]
>(curves.
geometry.wrap().positions().
data());
136static int rna_CurvePoint_index_get_const(
const PointerRNA *
ptr)
139 const float(*co)[3] =
static_cast<float(*)[3]
>(
ptr->data);
141 return int(co - positions);
149 curves->
geometry.wrap().offsets_for_write().data(),
169 *
ptr, &RNA_CurveSlice, &curves->
geometry.wrap().offsets_for_write()[index], *r_ptr);
186 &RNA_FloatVectorAttributeValue,
206 return rna_CurvePoint_index_get_const(
ptr);
209static void rna_CurvePoint_location_get(
PointerRNA *
ptr,
float value[3])
214static void rna_CurvePoint_location_set(
PointerRNA *
ptr,
const float value[3])
226 return radii[rna_CurvePoint_index_get_const(
ptr)];
229static void rna_CurvePoint_radius_set(
PointerRNA *
ptr,
float value)
239 radii.
varray.set(rna_CurvePoint_index_get_const(
ptr), value);
242static std::optional<std::string> rna_CurvePoint_path(
const PointerRNA *
ptr)
244 return fmt::format(
"points[{}]", rna_CurvePoint_index_get_const(
ptr));
258static int rna_CurveSlice_index_get_const(
const PointerRNA *
ptr)
266 return rna_CurveSlice_index_get_const(
ptr);
269static std::optional<std::string> rna_CurveSlice_path(
const PointerRNA *
ptr)
271 return fmt::format(
"curves[{}]", rna_CurveSlice_index_get_const(
ptr));
274static int rna_CurveSlice_first_point_index_get(
PointerRNA *
ptr)
276 const int *offset_ptr =
static_cast<int *
>(
ptr->data);
282 const int *offset_ptr =
static_cast<int *
>(
ptr->data);
283 const int offset = *offset_ptr;
284 return *(offset_ptr + 1) - offset;
290 const int offset = rna_CurveSlice_first_point_index_get(
ptr);
291 const int size = rna_CurveSlice_points_length_get(
ptr);
293 float(*co)[3] = positions + offset;
307 ID *
id =
ptr->owner_id;
317 ID *
id =
ptr->owner_id;
338 prop,
"rna_CurvePoint_location_get",
"rna_CurvePoint_location_set",
nullptr);
344 prop,
"rna_CurvePoint_radius_get",
"rna_CurvePoint_radius_set",
nullptr);
382 "rna_CurveSlice_points_begin",
383 "rna_iterator_array_next",
384 "rna_iterator_array_end",
385 "rna_iterator_array_get",
386 "rna_CurveSlice_points_length_get",
395 prop,
"First Point Index",
"The index of this curve's first control point");
422 "rna_Curves_curves_begin",
423 "rna_iterator_array_next",
424 "rna_iterator_array_end",
425 "rna_iterator_array_get",
426 "rna_Curves_curves_length",
427 "rna_Curves_curves_lookup_int",
437 "rna_Curves_position_data_begin",
438 "rna_iterator_array_next",
439 "rna_iterator_array_end",
440 "rna_iterator_array_get",
441 "rna_Curves_position_data_length",
442 "rna_Curves_points_lookup_int",
452 "rna_Curves_position_data_begin",
453 "rna_iterator_array_next",
454 "rna_iterator_array_end",
455 "rna_iterator_array_get",
456 "rna_Curves_position_data_length",
457 "rna_Curves_position_data_lookup_int",
467 "rna_Curves_curve_offset_data_begin",
468 "rna_iterator_array_next",
469 "rna_iterator_array_end",
470 "rna_iterator_array_get",
471 "rna_Curves_curve_offset_data_length",
472 "rna_Curves_curve_offset_data_lookup_int",
485 "rna_Curves_normals_begin",
486 "rna_iterator_array_next",
487 "rna_iterator_array_end",
488 "rna_iterator_array_get",
489 "rna_Curves_position_data_length",
494 prop,
"Normals",
"The curve normal value at each of the curve's control points");
510 "rna_IDMaterials_assign_int");
524 "The name of the attribute on the surface mesh used to define the "
525 "attachment of each curve");
553 prop,
"Use Sculpt Collision",
"Enable collision with the surface while sculpting");
562 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, eCustomDataType data_type, const void *default_value=nullptr) const
GAttributeWriter lookup_or_add_for_write(StringRef attribute_id, AttrDomain domain, eCustomDataType 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, int itemsize, int 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)