31 {0,
nullptr, 0,
nullptr,
nullptr},
39 "The handle can be moved anywhere, and does not influence the point's other handle"},
44 "The location is automatically calculated to be smooth"},
49 "The location is calculated to point to the next/previous control point"},
54 "The location is constrained to point in the opposite direction as the other handle"},
55 {0,
nullptr, 0,
nullptr,
nullptr},
63 N_(
"Calculate normals with the smallest twist around the curve tangent across the whole "
69 N_(
"Calculate normals perpendicular to the Z axis and the curve tangent. If a series of "
70 "points is vertical, the X axis is used.")},
75 N_(
"Use the stored custom normal attribute as the final normals")},
76 {0,
nullptr, 0,
nullptr,
nullptr},
83# include <fmt/format.h>
103 return reinterpret_cast<Curves *
>(ptr->owner_id);
106static int rna_Curves_curve_offset_data_length(
PointerRNA *ptr)
109 return curves->geometry.curve_num + 1;
117 curves->geometry.wrap().offsets_for_write().data(),
119 curves->geometry.curve_num + 1,
127 if (index < 0 || index >=
curves->geometry.curve_num + 1) {
131 *ptr, RNA_IntAttributeValue, &
curves->geometry.wrap().offsets_for_write()[
index], *r_ptr);
137 return reinterpret_cast<float (*)[3]
>(
curves.geometry.wrap().positions_for_write().
data());
142 return reinterpret_cast<const float (*)[3]
>(
curves.geometry.wrap().positions().
data());
145static int rna_CurvePoint_index_get_const(
const PointerRNA *ptr)
148 const float (*co)[3] =
static_cast<float (*)[3]
>(ptr->data);
150 return int(co - positions);
158 curves->geometry.wrap().offsets_for_write().data(),
160 curves->geometry.curve_num,
165static int rna_Curves_curves_length(
PointerRNA *ptr)
168 return curves->geometry.curve_num;
174 if (index < 0 || index >=
curves->geometry.curve_num) {
178 *ptr, RNA_CurveSlice, &
curves->geometry.wrap().offsets_for_write()[
index], *r_ptr);
182static int rna_Curves_position_data_length(
PointerRNA *ptr)
185 return curves->geometry.point_num;
191 if (index < 0 || index >=
curves->geometry.point_num) {
195 RNA_FloatVectorAttributeValue,
208 curves->geometry.point_num,
213static int rna_CurvePoint_index_get(
PointerRNA *ptr)
215 return rna_CurvePoint_index_get_const(ptr);
218static void rna_CurvePoint_location_get(
PointerRNA *ptr,
float value[3])
220 copy_v3_v3(value,
static_cast<const float *
>(ptr->data));
223static void rna_CurvePoint_location_set(
PointerRNA *ptr,
const float value[3])
225 copy_v3_v3(
static_cast<float *
>(ptr->data), value);
228static float rna_CurvePoint_radius_get(
PointerRNA *ptr)
232 const VArray radii = *attributes.lookup_or_default<
float>(
234 return radii[rna_CurvePoint_index_get_const(ptr)];
237static void rna_CurvePoint_radius_set(
PointerRNA *ptr,
float value)
246 radii.
varray.set(rna_CurvePoint_index_get_const(ptr), value);
249static std::optional<std::string> rna_CurvePoint_path(
const PointerRNA *ptr)
251 return fmt::format(
"points[{}]", rna_CurvePoint_index_get_const(ptr));
257 if (index < 0 || index >=
curves->geometry.point_num) {
265static int rna_CurveSlice_index_get_const(
const PointerRNA *ptr)
268 return int(
static_cast<int *
>(ptr->data) -
curves->geometry.curve_offsets);
271static int rna_CurveSlice_index_get(
PointerRNA *ptr)
273 return rna_CurveSlice_index_get_const(ptr);
276static std::optional<std::string> rna_CurveSlice_path(
const PointerRNA *ptr)
278 return fmt::format(
"curves[{}]", rna_CurveSlice_index_get_const(ptr));
281static int rna_CurveSlice_first_point_index_get(
PointerRNA *ptr)
283 const int *offset_ptr =
static_cast<int *
>(ptr->data);
287static int rna_CurveSlice_points_length_get(
PointerRNA *ptr)
289 const int *offset_ptr =
static_cast<int *
>(ptr->data);
290 const int offset = *offset_ptr;
291 return *(offset_ptr + 1) - offset;
297 const int offset = rna_CurveSlice_first_point_index_get(ptr);
298 const int size = rna_CurveSlice_points_length_get(ptr);
300 float (*co)[3] = positions + offset;
314 ID *
id = ptr->owner_id;
324 ID *
id = ptr->owner_id;
349 prop,
"rna_CurvePoint_location_get",
"rna_CurvePoint_location_set",
nullptr);
355 prop,
"rna_CurvePoint_radius_get",
"rna_CurvePoint_radius_set",
nullptr);
393 "rna_CurveSlice_points_begin",
394 "rna_iterator_array_next",
395 "rna_iterator_array_end",
396 "rna_iterator_array_get",
397 "rna_CurveSlice_points_length_get",
406 prop,
"First Point Index",
"The index of this curve's first control point");
433 "rna_Curves_curves_begin",
434 "rna_iterator_array_next",
435 "rna_iterator_array_end",
436 "rna_iterator_array_get",
437 "rna_Curves_curves_length",
438 "rna_Curves_curves_lookup_int",
448 "rna_Curves_position_data_begin",
449 "rna_iterator_array_next",
450 "rna_iterator_array_end",
451 "rna_iterator_array_get",
452 "rna_Curves_position_data_length",
453 "rna_Curves_points_lookup_int",
463 "rna_Curves_position_data_begin",
464 "rna_iterator_array_next",
465 "rna_iterator_array_end",
466 "rna_iterator_array_get",
467 "rna_Curves_position_data_length",
468 "rna_Curves_position_data_lookup_int",
478 "rna_Curves_curve_offset_data_begin",
479 "rna_iterator_array_next",
480 "rna_iterator_array_end",
481 "rna_iterator_array_get",
482 "rna_Curves_curve_offset_data_length",
483 "rna_Curves_curve_offset_data_lookup_int",
496 "rna_Curves_normals_begin",
497 "rna_iterator_array_next",
498 "rna_iterator_array_end",
499 "rna_iterator_array_get",
500 "rna_Curves_position_data_length",
505 prop,
"Normals",
"The curve normal value at each of the curve's control points");
521 "rna_IDMaterials_assign_int");
535 "The name of the attribute on the surface mesh used to define the "
536 "attachment of each curve");
564 prop,
"Use Sculpt Collision",
"Enable collision with the surface while sculpting");
573 prop,
"Collision Distance",
"Distance to keep the curves away from the surface");
Generic geometry attributes built on CustomData.
Low-level operations for curves.
int size(const AssetLibraryReference *library_reference)
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 WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
const EnumPropertyItem rna_enum_attribute_curves_domain_items[]
const EnumPropertyItem rna_enum_curves_handle_type_items[]
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
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_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
static void rna_def_curves(BlenderRNA *brna)
const EnumPropertyItem rna_enum_curves_type_items[]
void rna_pointer_create_with_ancestors(const PointerRNA &parent, StructRNA *type, void *data, PointerRNA &r_ptr)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
void rna_def_animdata_common(StructRNA *srna)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
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_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void DEG_id_tag_update(ID *id, unsigned int flags)
BMesh const char void * data
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
static void rna_def_read_only_float_vector(BlenderRNA *brna)
void RNA_api_curves(StructRNA *srna)
void RNA_def_curves(BlenderRNA *brna)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
@ CV_SCULPT_COLLISION_ENABLED
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
static void rna_def_curves_point(BlenderRNA *brna)
@ NORMAL_MODE_MINIMUM_TWIST
const EnumPropertyItem rna_enum_curve_normal_mode_items[]
static void rna_def_curves_curve(BlenderRNA *brna)
void RNA_def_property_array(PropertyRNA *prop, int length)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
void rna_def_attributes_common(StructRNA *srna, const AttributeOwnerType type)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
VMutableArray< T > varray