Page Menu
Home
Search
Configure Global Search
Log In
Paste
P2673
LegacyCurve
Active
Public
Actions
Authored by
Jacques Lucke (JacquesLucke)
on Dec 18 2021, 1:14 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index 713ee8cac01..bfbb1877479 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -32,7 +32,7 @@ extern "C" {
struct BMEditMesh;
struct BezTriple;
-struct Curve;
+struct LegacyCurve;
struct Depsgraph;
struct GHash;
struct ListBase;
@@ -89,63 +89,67 @@ typedef struct CVKeyIndex {
/**
* Frees edit-curve entirely.
*/
-void BKE_curve_editfont_free(struct Curve *cu);
-void BKE_curve_init(struct Curve *cu, const short curve_type);
-struct Curve *BKE_curve_add(struct Main *bmain, const char *name, int type);
-short BKE_curve_type_get(const struct Curve *cu);
+void BKE_curve_editfont_free(struct LegacyCurve *cu);
+void BKE_curve_init(struct LegacyCurve *cu, const short curve_type);
+struct LegacyCurve *BKE_curve_add(struct Main *bmain, const char *name, int type);
+short BKE_curve_type_get(const struct LegacyCurve *cu);
void BKE_curve_type_test(struct Object *ob);
-void BKE_curve_dimension_update(struct Curve *cu);
+void BKE_curve_dimension_update(struct LegacyCurve *cu);
struct BoundBox *BKE_curve_boundbox_get(struct Object *ob);
-void BKE_curve_texspace_calc(struct Curve *cu);
-void BKE_curve_texspace_ensure(struct Curve *cu);
+void BKE_curve_texspace_calc(struct LegacyCurve *cu);
+void BKE_curve_texspace_ensure(struct LegacyCurve *cu);
/* Basic vertex data functions. */
-bool BKE_curve_minmax(struct Curve *cu, bool use_radius, float min[3], float max[3]);
-bool BKE_curve_center_median(struct Curve *cu, float cent[3]);
-bool BKE_curve_center_bounds(struct Curve *cu, float cent[3]);
-void BKE_curve_transform_ex(struct Curve *cu,
+bool BKE_curve_minmax(struct LegacyCurve *cu, bool use_radius, float min[3], float max[3]);
+bool BKE_curve_center_median(struct LegacyCurve *cu, float cent[3]);
+bool BKE_curve_center_bounds(struct LegacyCurve *cu, float cent[3]);
+void BKE_curve_transform_ex(struct LegacyCurve *cu,
const float mat[4][4],
const bool do_keys,
const bool do_props,
const float unit_scale);
-void BKE_curve_transform(struct Curve *cu,
+void BKE_curve_transform(struct LegacyCurve *cu,
const float mat[4][4],
const bool do_keys,
const bool do_props);
-void BKE_curve_translate(struct Curve *cu, const float offset[3], const bool do_keys);
-void BKE_curve_material_index_remove(struct Curve *cu, int index);
-bool BKE_curve_material_index_used(const struct Curve *cu, int index);
-void BKE_curve_material_index_clear(struct Curve *cu);
-bool BKE_curve_material_index_validate(struct Curve *cu);
-void BKE_curve_material_remap(struct Curve *cu, const unsigned int *remap, unsigned int remap_len);
+void BKE_curve_translate(struct LegacyCurve *cu, const float offset[3], const bool do_keys);
+void BKE_curve_material_index_remove(struct LegacyCurve *cu, int index);
+bool BKE_curve_material_index_used(const struct LegacyCurve *cu, int index);
+void BKE_curve_material_index_clear(struct LegacyCurve *cu);
+bool BKE_curve_material_index_validate(struct LegacyCurve *cu);
+void BKE_curve_material_remap(struct LegacyCurve *cu,
+ const unsigned int *remap,
+ unsigned int remap_len);
-void BKE_curve_smooth_flag_set(struct Curve *cu, const bool use_smooth);
+void BKE_curve_smooth_flag_set(struct LegacyCurve *cu, const bool use_smooth);
/**
* \return edit-nurbs or normal nurbs list.
*/
-ListBase *BKE_curve_nurbs_get(struct Curve *cu);
-const ListBase *BKE_curve_nurbs_get_for_read(const struct Curve *cu);
+ListBase *BKE_curve_nurbs_get(struct LegacyCurve *cu);
+const ListBase *BKE_curve_nurbs_get_for_read(const struct LegacyCurve *cu);
int BKE_curve_nurb_vert_index_get(const struct Nurb *nu, const void *vert);
-void BKE_curve_nurb_active_set(struct Curve *cu, const struct Nurb *nu);
-struct Nurb *BKE_curve_nurb_active_get(struct Curve *cu);
+void BKE_curve_nurb_active_set(struct LegacyCurve *cu, const struct Nurb *nu);
+struct Nurb *BKE_curve_nurb_active_get(struct LegacyCurve *cu);
/**
* Get active vert for curve.
*/
-void *BKE_curve_vert_active_get(struct Curve *cu);
+void *BKE_curve_vert_active_get(struct LegacyCurve *cu);
/**
* Set active nurb and active vert for curve.
*/
-void BKE_curve_nurb_vert_active_set(struct Curve *cu, const struct Nurb *nu, const void *vert);
+void BKE_curve_nurb_vert_active_set(struct LegacyCurve *cu,
+ const struct Nurb *nu,
+ const void *vert);
/**
* Get points to the active nurb and active vert for curve.
*/
-bool BKE_curve_nurb_vert_active_get(struct Curve *cu, struct Nurb **r_nu, void **r_vert);
-void BKE_curve_nurb_vert_active_validate(struct Curve *cu);
+bool BKE_curve_nurb_vert_active_get(struct LegacyCurve *cu, struct Nurb **r_nu, void **r_vert);
+void BKE_curve_nurb_vert_active_validate(struct LegacyCurve *cu);
float (*BKE_curve_nurbs_vert_coords_alloc(const struct ListBase *lb, int *r_vert_len))[3];
void BKE_curve_nurbs_vert_coords_get(const struct ListBase *lb,
@@ -168,16 +172,16 @@ void BKE_curve_nurbs_key_vert_tilts_apply(struct ListBase *lb, const float *key)
void BKE_curve_editNurb_keyIndex_delCV(struct GHash *keyindex, const void *cv);
void BKE_curve_editNurb_keyIndex_free(struct GHash **keyindex);
-void BKE_curve_editNurb_free(struct Curve *cu);
+void BKE_curve_editNurb_free(struct LegacyCurve *cu);
/**
* Get list of nurbs from edit-nurbs structure.
*/
-struct ListBase *BKE_curve_editNurbs_get(struct Curve *cu);
-const struct ListBase *BKE_curve_editNurbs_get_for_read(const struct Curve *cu);
+struct ListBase *BKE_curve_editNurbs_get(struct LegacyCurve *cu);
+const struct ListBase *BKE_curve_editNurbs_get_for_read(const struct LegacyCurve *cu);
void BKE_curve_bevelList_free(struct ListBase *bev);
void BKE_curve_bevelList_make(struct Object *ob, const struct ListBase *nurbs, bool for_render);
-ListBase BKE_curve_bevel_make(const struct Curve *curve);
+ListBase BKE_curve_bevel_make(const struct LegacyCurve *curve);
/**
* Forward differencing method for bezier curve.
@@ -190,7 +194,7 @@ void BKE_curve_forward_diff_bezier(
void BKE_curve_forward_diff_tangent_bezier(
float q0, float q1, float q2, float q3, float *p, int it, int stride);
-void BKE_curve_rect_from_textbox(const struct Curve *cu,
+void BKE_curve_rect_from_textbox(const struct LegacyCurve *cu,
const struct TextBox *tb,
struct rctf *r_rect);
@@ -378,18 +382,18 @@ void BKE_nurb_handles_test(struct Nurb *nu, const bool use_handles, const bool u
/* **** Depsgraph evaluation **** */
-void BKE_curve_eval_geometry(struct Depsgraph *depsgraph, struct Curve *curve);
+void BKE_curve_eval_geometry(struct Depsgraph *depsgraph, struct LegacyCurve *curve);
/* Draw Cache */
enum {
BKE_CURVE_BATCH_DIRTY_ALL = 0,
BKE_CURVE_BATCH_DIRTY_SELECT,
};
-void BKE_curve_batch_cache_dirty_tag(struct Curve *cu, int mode);
-void BKE_curve_batch_cache_free(struct Curve *cu);
+void BKE_curve_batch_cache_dirty_tag(struct LegacyCurve *cu, int mode);
+void BKE_curve_batch_cache_free(struct LegacyCurve *cu);
-extern void (*BKE_curve_batch_cache_dirty_tag_cb)(struct Curve *cu, int mode);
-extern void (*BKE_curve_batch_cache_free_cb)(struct Curve *cu);
+extern void (*BKE_curve_batch_cache_dirty_tag_cb)(struct LegacyCurve *cu, int mode);
+extern void (*BKE_curve_batch_cache_free_cb)(struct LegacyCurve *cu);
/* -------------------------------------------------------------------- */
/** \name Decimate Curve (curve_decimate.c)
@@ -458,9 +462,9 @@ void BKE_curve_deform_co(const struct Object *ob_curve,
* If apply_modifiers is true and the object is a curve one, then spline deform modifiers are
* applied on the control points of the splines.
*/
-struct Curve *BKE_curve_new_from_object(struct Object *object,
- struct Depsgraph *depsgraph,
- bool apply_modifiers);
+struct LegacyCurve *BKE_curve_new_from_object(struct Object *object,
+ struct Depsgraph *depsgraph,
+ bool apply_modifiers);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index 79f29e0954e..1cd4ca15444 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -39,7 +39,7 @@
#include "FN_field.hh"
struct Collection;
-struct Curve;
+struct LegacyCurve;
struct CurveEval;
struct Mesh;
struct Object;
@@ -632,7 +632,7 @@ class CurveComponent : public GeometryComponent {
* we use #CurveEval rather than #Curve here. It also allows us to mostly reuse the same
* batch cache implementation.
*/
- mutable Curve *curve_for_render_ = nullptr;
+ mutable LegacyCurve *curve_for_render_ = nullptr;
mutable std::mutex curve_for_render_mutex_;
public:
@@ -662,7 +662,7 @@ class CurveComponent : public GeometryComponent {
* Create empty curve data used for rendering the spline's wire edges.
* \note See comment on #curve_for_render_ for further explanation.
*/
- const Curve *get_curve_for_render() const;
+ const LegacyCurve *get_curve_for_render() const;
static constexpr inline GeometryComponentType static_type = GEO_COMPONENT_TYPE_CURVE;
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index de069d6236f..1e052f8ec13 100644
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@ -21,7 +21,7 @@
/** \file
* \ingroup bke
*/
-struct Curve;
+struct LegacyCurve;
struct ID;
struct Key;
struct KeyBlock;
@@ -129,9 +129,15 @@ void BKE_keyblock_curve_data_transform(const struct ListBase *nurb,
const float mat[4][4],
const void *src,
void *dst);
-void BKE_keyblock_update_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb);
-void BKE_keyblock_convert_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb);
-void BKE_keyblock_convert_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb);
+void BKE_keyblock_update_from_curve(struct LegacyCurve *cu,
+ struct KeyBlock *kb,
+ struct ListBase *nurb);
+void BKE_keyblock_convert_from_curve(struct LegacyCurve *cu,
+ struct KeyBlock *kb,
+ struct ListBase *nurb);
+void BKE_keyblock_convert_to_curve(struct KeyBlock *kb,
+ struct LegacyCurve *cu,
+ struct ListBase *nurb);
void BKE_keyblock_update_from_mesh(struct Mesh *me, struct KeyBlock *kb);
void BKE_keyblock_convert_from_mesh(struct Mesh *me, struct Key *key, struct KeyBlock *kb);
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 03565bd3bda..ceafbfbf4af 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -32,7 +32,7 @@ extern "C" {
struct Base;
struct BoundBox;
-struct Curve;
+struct LegacyCurve;
struct Depsgraph;
struct GeometrySet;
struct GpencilModifierData;
@@ -699,9 +699,9 @@ void BKE_object_to_mesh_clear(struct Object *object);
* If apply_modifiers is true and the object is a curve one, then spline deform modifiers are
* applied on the curve control points.
*/
-struct Curve *BKE_object_to_curve(struct Object *object,
- struct Depsgraph *depsgraph,
- bool apply_modifiers);
+struct LegacyCurve *BKE_object_to_curve(struct Object *object,
+ struct Depsgraph *depsgraph,
+ bool apply_modifiers);
void BKE_object_to_curve_clear(struct Object *object);
diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh
index ebdc4a0ca0b..a30f4234655 100644
--- a/source/blender/blenkernel/BKE_spline.hh
+++ b/source/blender/blenkernel/BKE_spline.hh
@@ -31,7 +31,7 @@
#include "BKE_attribute_access.hh"
#include "BKE_attribute_math.hh"
-struct Curve;
+struct LegacyCurve;
struct ListBase;
class Spline;
@@ -745,6 +745,6 @@ struct CurveEval {
void assert_valid_point_attributes() const;
};
-std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &curve,
+std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const LegacyCurve &curve,
const ListBase &nurbs_list);
-std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve);
+std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const LegacyCurve &dna_curve);
diff --git a/source/blender/blenkernel/BKE_vfont.h b/source/blender/blenkernel/BKE_vfont.h
index cd1b30b9358..bca3baada06 100644
--- a/source/blender/blenkernel/BKE_vfont.h
+++ b/source/blender/blenkernel/BKE_vfont.h
@@ -27,7 +27,7 @@ extern "C" {
#endif
struct CharInfo;
-struct Curve;
+struct LegacyCurve;
struct Main;
struct Object;
struct VFont;
@@ -76,7 +76,7 @@ struct VFont *BKE_vfont_load_exists_ex(struct Main *bmain, const char *filepath,
struct VFont *BKE_vfont_load_exists(struct Main *bmain, const char *filepath);
bool BKE_vfont_to_curve_ex(struct Object *ob,
- struct Curve *cu,
+ struct LegacyCurve *cu,
int mode,
struct ListBase *r_nubase,
const char32_t **r_text,
@@ -88,7 +88,7 @@ bool BKE_vfont_to_curve_nubase(struct Object *ob, int mode, struct ListBase *r_n
* \warning Expects to have access to evaluated data (i.e. passed object should be evaluated one).
*/
bool BKE_vfont_to_curve(struct Object *ob, int mode);
-void BKE_vfont_build_char(struct Curve *cu,
+void BKE_vfont_build_char(struct LegacyCurve *cu,
struct ListBase *nubase,
unsigned int character,
struct CharInfo *info,
diff --git a/source/blender/blenkernel/intern/anim_path.c b/source/blender/blenkernel/intern/anim_path.c
index 43af55e9b6b..1caad998375 100644
--- a/source/blender/blenkernel/intern/anim_path.c
+++ b/source/blender/blenkernel/intern/anim_path.c
@@ -241,7 +241,7 @@ bool BKE_where_on_path(const Object *ob,
if (ob == NULL || ob->type != OB_CURVE) {
return false;
}
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
if (ob->runtime.curve_cache == NULL) {
CLOG_WARN(&LOG, "No curve cache!");
return false;
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index d284c32b1df..8e21c3e4024 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -1509,7 +1509,7 @@ static void followpath_get_tarmat(struct Depsgraph *UNUSED(depsgraph),
bFollowPathConstraint *data = con->data;
if (VALID_CONS_TARGET(ct) && (ct->tar->type == OB_CURVE)) {
- Curve *cu = ct->tar->data;
+ LegacyCurve *cu = ct->tar->data;
float vec[4], dir[3], radius;
float curvetime;
diff --git a/source/blender/blenkernel/intern/curve.cc b/source/blender/blenkernel/intern/curve.cc
index dc2527f9b62..851d6d1a92f 100644
--- a/source/blender/blenkernel/intern/curve.cc
+++ b/source/blender/blenkernel/intern/curve.cc
@@ -74,17 +74,17 @@ static CLG_LogRef LOG = {"bke.curve"};
static void curve_init_data(ID *id)
{
- Curve *curve = (Curve *)id;
+ LegacyCurve *curve = (LegacyCurve *)id;
BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(curve, id));
- MEMCPY_STRUCT_AFTER(curve, DNA_struct_default_get(Curve), id);
+ MEMCPY_STRUCT_AFTER(curve, DNA_struct_default_get(LegacyCurve), id);
}
static void curve_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag)
{
- Curve *curve_dst = (Curve *)id_dst;
- const Curve *curve_src = (const Curve *)id_src;
+ LegacyCurve *curve_dst = (LegacyCurve *)id_dst;
+ const LegacyCurve *curve_src = (const LegacyCurve *)id_src;
BLI_listbase_clear(&curve_dst->nurb);
BKE_nurbList_duplicate(&(curve_dst->nurb), &(curve_src->nurb));
@@ -110,7 +110,7 @@ static void curve_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int
static void curve_free_data(ID *id)
{
- Curve *curve = (Curve *)id;
+ LegacyCurve *curve = (LegacyCurve *)id;
BKE_curve_batch_cache_free(curve);
@@ -129,7 +129,7 @@ static void curve_free_data(ID *id)
static void curve_foreach_id(ID *id, LibraryForeachIDData *data)
{
- Curve *curve = (Curve *)id;
+ LegacyCurve *curve = (LegacyCurve *)id;
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, curve->bevobj, IDWALK_CB_NOP);
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, curve->taperobj, IDWALK_CB_NOP);
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, curve->textoncurve, IDWALK_CB_NOP);
@@ -145,7 +145,7 @@ static void curve_foreach_id(ID *id, LibraryForeachIDData *data)
static void curve_blend_write(BlendWriter *writer, ID *id, const void *id_address)
{
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
/* Clean up, important in undo case to reduce false detection of changed datablocks. */
cu->editnurb = nullptr;
@@ -153,7 +153,7 @@ static void curve_blend_write(BlendWriter *writer, ID *id, const void *id_addres
cu->batch_cache = nullptr;
/* write LibData */
- BLO_write_id_struct(writer, Curve, id_address, &cu->id);
+ BLO_write_id_struct(writer, LegacyCurve, id_address, &cu->id);
BKE_id_blend_write(writer, &cu->id);
/* direct data */
@@ -205,7 +205,7 @@ static void switch_endian_knots(Nurb *nu)
static void curve_blend_read_data(BlendDataReader *reader, ID *id)
{
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
BLO_read_data_address(reader, &cu->adt);
BKE_animdata_blend_read_data(reader, cu->adt);
@@ -268,7 +268,7 @@ static void curve_blend_read_data(BlendDataReader *reader, ID *id)
static void curve_blend_read_lib(BlendLibReader *reader, ID *id)
{
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
for (int a = 0; a < cu->totcol; a++) {
BLO_read_id_address(reader, cu->id.lib, &cu->mat[a]);
}
@@ -287,7 +287,7 @@ static void curve_blend_read_lib(BlendLibReader *reader, ID *id)
static void curve_blend_read_expand(BlendExpander *expander, ID *id)
{
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
for (int a = 0; a < cu->totcol; a++) {
BLO_expand(expander, cu->mat[a]);
}
@@ -307,7 +307,7 @@ IDTypeInfo IDType_ID_CU = {
/* id_code */ ID_CU,
/* id_filter */ FILTER_ID_CU,
/* main_listbase_index */ INDEX_ID_CU,
- /* struct_size */ sizeof(Curve),
+ /* struct_size */ sizeof(LegacyCurve),
/* name */ "Curve",
/* name_plural */ "curves",
/* translation_context */ BLT_I18NCONTEXT_ID_CURVE,
@@ -333,7 +333,7 @@ IDTypeInfo IDType_ID_CU = {
/* lib_override_apply_post */ nullptr,
};
-void BKE_curve_editfont_free(Curve *cu)
+void BKE_curve_editfont_free(LegacyCurve *cu)
{
if (cu->editfont) {
EditFont *ef = cu->editfont;
@@ -375,7 +375,7 @@ void BKE_curve_editNurb_keyIndex_free(GHash **keyindex)
*keyindex = nullptr;
}
-void BKE_curve_editNurb_free(Curve *cu)
+void BKE_curve_editNurb_free(LegacyCurve *cu)
{
if (cu->editnurb) {
BKE_nurbList_free(&cu->editnurb->nurbs);
@@ -385,7 +385,7 @@ void BKE_curve_editNurb_free(Curve *cu)
}
}
-void BKE_curve_init(Curve *cu, const short curve_type)
+void BKE_curve_init(LegacyCurve *cu, const short curve_type)
{
curve_init_data(&cu->id);
@@ -411,19 +411,19 @@ void BKE_curve_init(Curve *cu, const short curve_type)
cu->bevel_profile = nullptr;
}
-Curve *BKE_curve_add(Main *bmain, const char *name, int type)
+LegacyCurve *BKE_curve_add(Main *bmain, const char *name, int type)
{
- Curve *cu;
+ LegacyCurve *cu;
/* We cannot use #BKE_id_new here as we need some custom initialization code. */
- cu = (Curve *)BKE_libblock_alloc(bmain, ID_CU, name, 0);
+ cu = (LegacyCurve *)BKE_libblock_alloc(bmain, ID_CU, name, 0);
BKE_curve_init(cu, type);
return cu;
}
-ListBase *BKE_curve_editNurbs_get(Curve *cu)
+ListBase *BKE_curve_editNurbs_get(LegacyCurve *cu)
{
if (cu->editnurb) {
return &cu->editnurb->nurbs;
@@ -432,7 +432,7 @@ ListBase *BKE_curve_editNurbs_get(Curve *cu)
return nullptr;
}
-const ListBase *BKE_curve_editNurbs_get_for_read(const Curve *cu)
+const ListBase *BKE_curve_editNurbs_get_for_read(const LegacyCurve *cu)
{
if (cu->editnurb) {
return &cu->editnurb->nurbs;
@@ -441,7 +441,7 @@ const ListBase *BKE_curve_editNurbs_get_for_read(const Curve *cu)
return nullptr;
}
-short BKE_curve_type_get(const Curve *cu)
+short BKE_curve_type_get(const LegacyCurve *cu)
{
int type = cu->type;
@@ -462,7 +462,7 @@ short BKE_curve_type_get(const Curve *cu)
return type;
}
-void BKE_curve_dimension_update(Curve *cu)
+void BKE_curve_dimension_update(LegacyCurve *cu)
{
ListBase *nurbs = BKE_curve_nurbs_get(cu);
bool is_2d = CU_IS_2D(cu);
@@ -481,10 +481,10 @@ void BKE_curve_dimension_update(Curve *cu)
void BKE_curve_type_test(Object *ob)
{
- ob->type = BKE_curve_type_get((Curve *)ob->data);
+ ob->type = BKE_curve_type_get((LegacyCurve *)ob->data);
if (ob->type == OB_CURVE) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
if (CU_IS_2D(cu)) {
BKE_curve_dimension_update(cu);
}
@@ -496,7 +496,7 @@ BoundBox *BKE_curve_boundbox_get(Object *ob)
/* This is Object-level data access,
* DO NOT touch to Mesh's bb, would be totally thread-unsafe. */
if (ob->runtime.bb == nullptr || ob->runtime.bb->flag & BOUNDBOX_DIRTY) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
float min[3], max[3];
INIT_MINMAX(min, max);
@@ -512,7 +512,7 @@ BoundBox *BKE_curve_boundbox_get(Object *ob)
return ob->runtime.bb;
}
-void BKE_curve_texspace_calc(Curve *cu)
+void BKE_curve_texspace_calc(LegacyCurve *cu)
{
if (cu->texflag & CU_AUTOSPACE) {
float min[3], max[3];
@@ -549,7 +549,7 @@ void BKE_curve_texspace_calc(Curve *cu)
}
}
-void BKE_curve_texspace_ensure(Curve *cu)
+void BKE_curve_texspace_ensure(LegacyCurve *cu)
{
if ((cu->texflag & CU_AUTOSPACE) && !(cu->texflag & CU_AUTOSPACE_EVALUATED)) {
BKE_curve_texspace_calc(cu);
@@ -2621,7 +2621,7 @@ void BKE_curve_bevelList_make(Object *ob, const ListBase *nurbs, const bool for_
*/
/* This function needs an object, because of `tflag` and `upflag`. */
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
BezTriple *bezt, *prevbezt;
BPoint *bp;
BevList *blnew;
@@ -4992,7 +4992,7 @@ bool BKE_nurb_type_convert(Nurb *nu,
return true;
}
-ListBase *BKE_curve_nurbs_get(Curve *cu)
+ListBase *BKE_curve_nurbs_get(LegacyCurve *cu)
{
if (cu->editnurb) {
return BKE_curve_editNurbs_get(cu);
@@ -5001,7 +5001,7 @@ ListBase *BKE_curve_nurbs_get(Curve *cu)
return &cu->nurb;
}
-const ListBase *BKE_curve_nurbs_get_for_read(const Curve *cu)
+const ListBase *BKE_curve_nurbs_get_for_read(const LegacyCurve *cu)
{
if (cu->editnurb) {
return BKE_curve_editNurbs_get_for_read(cu);
@@ -5010,7 +5010,7 @@ const ListBase *BKE_curve_nurbs_get_for_read(const Curve *cu)
return &cu->nurb;
}
-void BKE_curve_nurb_active_set(Curve *cu, const Nurb *nu)
+void BKE_curve_nurb_active_set(LegacyCurve *cu, const Nurb *nu)
{
if (nu == nullptr) {
cu->actnu = CU_ACT_NONE;
@@ -5022,13 +5022,13 @@ void BKE_curve_nurb_active_set(Curve *cu, const Nurb *nu)
}
}
-Nurb *BKE_curve_nurb_active_get(Curve *cu)
+Nurb *BKE_curve_nurb_active_get(LegacyCurve *cu)
{
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
return (Nurb *)BLI_findlink(nurbs, cu->actnu);
}
-void *BKE_curve_vert_active_get(Curve *cu)
+void *BKE_curve_vert_active_get(LegacyCurve *cu)
{
Nurb *nu = nullptr;
void *vert = nullptr;
@@ -5048,7 +5048,7 @@ int BKE_curve_nurb_vert_index_get(const Nurb *nu, const void *vert)
return (BPoint *)vert - nu->bp;
}
-void BKE_curve_nurb_vert_active_set(Curve *cu, const Nurb *nu, const void *vert)
+void BKE_curve_nurb_vert_active_set(LegacyCurve *cu, const Nurb *nu, const void *vert)
{
if (nu) {
BKE_curve_nurb_active_set(cu, nu);
@@ -5065,7 +5065,7 @@ void BKE_curve_nurb_vert_active_set(Curve *cu, const Nurb *nu, const void *vert)
}
}
-bool BKE_curve_nurb_vert_active_get(Curve *cu, Nurb **r_nu, void **r_vert)
+bool BKE_curve_nurb_vert_active_get(LegacyCurve *cu, Nurb **r_nu, void **r_vert)
{
Nurb *nu = nullptr;
void *vert = nullptr;
@@ -5092,7 +5092,7 @@ bool BKE_curve_nurb_vert_active_get(Curve *cu, Nurb **r_nu, void **r_vert)
return (*r_vert != nullptr);
}
-void BKE_curve_nurb_vert_active_validate(Curve *cu)
+void BKE_curve_nurb_vert_active_validate(LegacyCurve *cu)
{
Nurb *nu;
void *vert;
@@ -5117,7 +5117,7 @@ void BKE_curve_nurb_vert_active_validate(Curve *cu)
}
}
-bool BKE_curve_minmax(Curve *cu, bool use_radius, float min[3], float max[3])
+bool BKE_curve_minmax(LegacyCurve *cu, bool use_radius, float min[3], float max[3])
{
ListBase *nurb_lb = BKE_curve_nurbs_get(cu);
ListBase temp_nurb_lb = {nullptr, nullptr};
@@ -5142,7 +5142,7 @@ bool BKE_curve_minmax(Curve *cu, bool use_radius, float min[3], float max[3])
return result;
}
-bool BKE_curve_center_median(Curve *cu, float cent[3])
+bool BKE_curve_center_median(LegacyCurve *cu, float cent[3])
{
ListBase *nurb_lb = BKE_curve_nurbs_get(cu);
int total = 0;
@@ -5179,7 +5179,7 @@ bool BKE_curve_center_median(Curve *cu, float cent[3])
return (total != 0);
}
-bool BKE_curve_center_bounds(Curve *cu, float cent[3])
+bool BKE_curve_center_bounds(LegacyCurve *cu, float cent[3])
{
float min[3], max[3];
INIT_MINMAX(min, max);
@@ -5191,7 +5191,7 @@ bool BKE_curve_center_bounds(Curve *cu, float cent[3])
return false;
}
-void BKE_curve_transform_ex(Curve *cu,
+void BKE_curve_transform_ex(LegacyCurve *cu,
const float mat[4][4],
const bool do_keys,
const bool do_props,
@@ -5263,13 +5263,16 @@ void BKE_curve_transform_ex(Curve *cu,
}
}
-void BKE_curve_transform(Curve *cu, const float mat[4][4], const bool do_keys, const bool do_props)
+void BKE_curve_transform(LegacyCurve *cu,
+ const float mat[4][4],
+ const bool do_keys,
+ const bool do_props)
{
float unit_scale = mat4_to_scale(mat);
BKE_curve_transform_ex(cu, mat, do_keys, do_props, unit_scale);
}
-void BKE_curve_translate(Curve *cu, const float offset[3], const bool do_keys)
+void BKE_curve_translate(LegacyCurve *cu, const float offset[3], const bool do_keys)
{
ListBase *nurb_lb = BKE_curve_nurbs_get(cu);
@@ -5315,7 +5318,7 @@ void BKE_curve_translate(Curve *cu, const float offset[3], const bool do_keys)
}
}
-void BKE_curve_material_index_remove(Curve *cu, int index)
+void BKE_curve_material_index_remove(LegacyCurve *cu, int index)
{
const int curvetype = BKE_curve_type_get(cu);
@@ -5336,7 +5339,7 @@ void BKE_curve_material_index_remove(Curve *cu, int index)
}
}
-bool BKE_curve_material_index_used(const Curve *cu, int index)
+bool BKE_curve_material_index_used(const LegacyCurve *cu, int index)
{
const int curvetype = BKE_curve_type_get(cu);
@@ -5359,7 +5362,7 @@ bool BKE_curve_material_index_used(const Curve *cu, int index)
return false;
}
-void BKE_curve_material_index_clear(Curve *cu)
+void BKE_curve_material_index_clear(LegacyCurve *cu)
{
const int curvetype = BKE_curve_type_get(cu);
@@ -5376,7 +5379,7 @@ void BKE_curve_material_index_clear(Curve *cu)
}
}
-bool BKE_curve_material_index_validate(Curve *cu)
+bool BKE_curve_material_index_validate(LegacyCurve *cu)
{
const int curvetype = BKE_curve_type_get(cu);
bool is_valid = true;
@@ -5409,7 +5412,7 @@ bool BKE_curve_material_index_validate(Curve *cu)
return false;
}
-void BKE_curve_material_remap(Curve *cu, const unsigned int *remap, unsigned int remap_len)
+void BKE_curve_material_remap(LegacyCurve *cu, const unsigned int *remap, unsigned int remap_len)
{
const int curvetype = BKE_curve_type_get(cu);
const short remap_len_short = (short)remap_len;
@@ -5456,7 +5459,7 @@ void BKE_curve_material_remap(Curve *cu, const unsigned int *remap, unsigned int
#undef MAT_NR_REMAP
}
-void BKE_curve_smooth_flag_set(Curve *cu, const bool use_smooth)
+void BKE_curve_smooth_flag_set(LegacyCurve *cu, const bool use_smooth)
{
if (use_smooth) {
LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
@@ -5470,7 +5473,7 @@ void BKE_curve_smooth_flag_set(Curve *cu, const bool use_smooth)
}
}
-void BKE_curve_rect_from_textbox(const struct Curve *cu,
+void BKE_curve_rect_from_textbox(const struct LegacyCurve *cu,
const struct TextBox *tb,
struct rctf *r_rect)
{
@@ -5522,12 +5525,12 @@ void BKE_curve_correct_bezpart(const float v1[2], float v2[2], float v3[2], cons
/* **** Depsgraph evaluation **** */
-void BKE_curve_eval_geometry(Depsgraph *depsgraph, Curve *curve)
+void BKE_curve_eval_geometry(Depsgraph *depsgraph, LegacyCurve *curve)
{
DEG_debug_print_eval(depsgraph, __func__, curve->id.name, curve);
BKE_curve_texspace_calc(curve);
if (DEG_is_active(depsgraph)) {
- Curve *curve_orig = (Curve *)DEG_get_original_id(&curve->id);
+ LegacyCurve *curve_orig = (LegacyCurve *)DEG_get_original_id(&curve->id);
if (curve->texflag & CU_AUTOSPACE_EVALUATED) {
curve_orig->texflag |= CU_AUTOSPACE_EVALUATED;
copy_v3_v3(curve_orig->loc, curve->loc);
@@ -5537,16 +5540,16 @@ void BKE_curve_eval_geometry(Depsgraph *depsgraph, Curve *curve)
}
/* Draw Engine */
-void (*BKE_curve_batch_cache_dirty_tag_cb)(Curve *cu, int mode) = nullptr;
-void (*BKE_curve_batch_cache_free_cb)(Curve *cu) = nullptr;
+void (*BKE_curve_batch_cache_dirty_tag_cb)(LegacyCurve *cu, int mode) = nullptr;
+void (*BKE_curve_batch_cache_free_cb)(LegacyCurve *cu) = nullptr;
-void BKE_curve_batch_cache_dirty_tag(Curve *cu, int mode)
+void BKE_curve_batch_cache_dirty_tag(LegacyCurve *cu, int mode)
{
if (cu->batch_cache) {
BKE_curve_batch_cache_dirty_tag_cb(cu, mode);
}
}
-void BKE_curve_batch_cache_free(Curve *cu)
+void BKE_curve_batch_cache_free(LegacyCurve *cu)
{
if (cu->batch_cache) {
BKE_curve_batch_cache_free_cb(cu);
diff --git a/source/blender/blenkernel/intern/curve_bevel.c b/source/blender/blenkernel/intern/curve_bevel.c
index 18e4ab3ade1..80319187403 100644
--- a/source/blender/blenkernel/intern/curve_bevel.c
+++ b/source/blender/blenkernel/intern/curve_bevel.c
@@ -44,7 +44,7 @@ typedef enum CurveBevelFillType {
FULL,
} CurveBevelFillType;
-static CurveBevelFillType curve_bevel_get_fill_type(const Curve *curve)
+static CurveBevelFillType curve_bevel_get_fill_type(const LegacyCurve *curve)
{
if (!(curve->flag & (CU_FRONT | CU_BACK))) {
return FULL;
@@ -56,7 +56,7 @@ static CurveBevelFillType curve_bevel_get_fill_type(const Curve *curve)
return (curve->flag & CU_FRONT) ? FRONT : BACK;
}
-static void bevel_quarter_fill(const Curve *curve,
+static void bevel_quarter_fill(const LegacyCurve *curve,
float *quarter_coords_x,
float *quarter_coords_y)
{
@@ -85,7 +85,7 @@ static void bevel_quarter_fill(const Curve *curve,
}
}
-static void curve_bevel_make_extrude_and_fill(const Curve *cu,
+static void curve_bevel_make_extrude_and_fill(const LegacyCurve *cu,
ListBase *disp,
const bool use_extrude,
const CurveBevelFillType fill_type)
@@ -195,7 +195,7 @@ static void curve_bevel_make_extrude_and_fill(const Curve *cu,
}
}
-static void curve_bevel_make_full_circle(const Curve *cu, ListBase *disp)
+static void curve_bevel_make_full_circle(const LegacyCurve *cu, ListBase *disp)
{
const int nr = 4 + 2 * cu->bevresol;
@@ -220,7 +220,7 @@ static void curve_bevel_make_full_circle(const Curve *cu, ListBase *disp)
}
}
-static void curve_bevel_make_only_extrude(const Curve *cu, ListBase *disp)
+static void curve_bevel_make_only_extrude(const LegacyCurve *cu, ListBase *disp)
{
DispList *dl = MEM_callocN(sizeof(DispList), __func__);
dl->verts = MEM_malloc_arrayN(2, sizeof(float[3]), __func__);
@@ -237,7 +237,7 @@ static void curve_bevel_make_only_extrude(const Curve *cu, ListBase *disp)
fp[5] = cu->extrude;
}
-static void curve_bevel_make_from_object(const Curve *cu, ListBase *disp)
+static void curve_bevel_make_from_object(const LegacyCurve *cu, ListBase *disp)
{
if (cu->bevobj == NULL) {
return;
@@ -246,7 +246,7 @@ static void curve_bevel_make_from_object(const Curve *cu, ListBase *disp)
return;
}
- Curve *bevcu = cu->bevobj->data;
+ LegacyCurve *bevcu = cu->bevobj->data;
if (bevcu->extrude == 0.0f && bevcu->bevel_radius == 0.0f) {
ListBase bevdisp = {NULL, NULL};
float facx = cu->bevobj->scale[0];
@@ -289,7 +289,7 @@ static void curve_bevel_make_from_object(const Curve *cu, ListBase *disp)
}
}
-ListBase BKE_curve_bevel_make(const Curve *curve)
+ListBase BKE_curve_bevel_make(const LegacyCurve *curve)
{
ListBase bevel_shape = {NULL, NULL};
diff --git a/source/blender/blenkernel/intern/curve_convert.c b/source/blender/blenkernel/intern/curve_convert.c
index 98a9cbc2bcf..9e160deaf43 100644
--- a/source/blender/blenkernel/intern/curve_convert.c
+++ b/source/blender/blenkernel/intern/curve_convert.c
@@ -33,10 +33,11 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
-static Curve *curve_from_font_object(Object *object, Depsgraph *depsgraph)
+static LegacyCurve *curve_from_font_object(Object *object, Depsgraph *depsgraph)
{
- Curve *curve = (Curve *)object->data;
- Curve *new_curve = (Curve *)BKE_id_copy_ex(NULL, &curve->id, NULL, LIB_ID_COPY_LOCALIZE);
+ LegacyCurve *curve = (LegacyCurve *)object->data;
+ LegacyCurve *new_curve = (LegacyCurve *)BKE_id_copy_ex(
+ NULL, &curve->id, NULL, LIB_ID_COPY_LOCALIZE);
Object *evaluated_object = DEG_get_evaluated_object(depsgraph, object);
BKE_vfont_to_curve_nubase(evaluated_object, FO_EDIT, &new_curve->nurb);
@@ -49,11 +50,14 @@ static Curve *curve_from_font_object(Object *object, Depsgraph *depsgraph)
return new_curve;
}
-static Curve *curve_from_curve_object(Object *object, Depsgraph *depsgraph, bool apply_modifiers)
+static LegacyCurve *curve_from_curve_object(Object *object,
+ Depsgraph *depsgraph,
+ bool apply_modifiers)
{
Object *evaluated_object = DEG_get_evaluated_object(depsgraph, object);
- Curve *curve = (Curve *)evaluated_object->data;
- Curve *new_curve = (Curve *)BKE_id_copy_ex(NULL, &curve->id, NULL, LIB_ID_COPY_LOCALIZE);
+ LegacyCurve *curve = (LegacyCurve *)evaluated_object->data;
+ LegacyCurve *new_curve = (LegacyCurve *)BKE_id_copy_ex(
+ NULL, &curve->id, NULL, LIB_ID_COPY_LOCALIZE);
if (apply_modifiers) {
BKE_curve_calc_modifiers_pre(depsgraph,
@@ -67,7 +71,7 @@ static Curve *curve_from_curve_object(Object *object, Depsgraph *depsgraph, bool
return new_curve;
}
-Curve *BKE_curve_new_from_object(Object *object, Depsgraph *depsgraph, bool apply_modifiers)
+LegacyCurve *BKE_curve_new_from_object(Object *object, Depsgraph *depsgraph, bool apply_modifiers)
{
if (!ELEM(object->type, OB_FONT, OB_CURVE)) {
return NULL;
diff --git a/source/blender/blenkernel/intern/curve_deform.c b/source/blender/blenkernel/intern/curve_deform.c
index d754f8cc27d..e7d92b3a028 100644
--- a/source/blender/blenkernel/intern/curve_deform.c
+++ b/source/blender/blenkernel/intern/curve_deform.c
@@ -77,7 +77,7 @@ static void init_curve_deform(const Object *ob_curve, const Object *ob_target, C
static bool calc_curve_deform(
const Object *ob_curve, float co[3], const short axis, const CurveDeform *cd, float r_quat[4])
{
- Curve *cu = ob_curve->data;
+ LegacyCurve *cu = ob_curve->data;
float fac, loc[4], dir[3], new_quat[4], radius;
short index;
const bool is_neg_axis = (axis > 2);
@@ -219,7 +219,7 @@ static void curve_deform_coords_impl(const Object *ob_curve,
const short defaxis,
BMEditMesh *em_target)
{
- Curve *cu;
+ LegacyCurve *cu;
int a;
CurveDeform cd;
const bool is_neg_axis = (defaxis > 2);
diff --git a/source/blender/blenkernel/intern/curve_eval.cc b/source/blender/blenkernel/intern/curve_eval.cc
index 38f736e6907..0613d6fe15e 100644
--- a/source/blender/blenkernel/intern/curve_eval.cc
+++ b/source/blender/blenkernel/intern/curve_eval.cc
@@ -300,7 +300,7 @@ static SplinePtr spline_from_dna_poly(const Nurb &nurb)
return spline;
}
-std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve,
+std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const LegacyCurve &dna_curve,
const ListBase &nurbs_list)
{
Vector<const Nurb *> nurbs(nurbs_list);
@@ -339,7 +339,7 @@ std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve,
return curve;
}
-std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve)
+std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const LegacyCurve &dna_curve)
{
return curve_eval_from_dna_curve(dna_curve, *BKE_curve_nurbs_get_for_read(&dna_curve));
}
diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc
index edf043de63f..93f8908230d 100644
--- a/source/blender/blenkernel/intern/displist.cc
+++ b/source/blender/blenkernel/intern/displist.cc
@@ -265,7 +265,7 @@ bool BKE_displist_surfindex_get(
# pragma intel optimization_level 1
#endif
-static void curve_to_displist(const Curve *cu,
+static void curve_to_displist(const LegacyCurve *cu,
const ListBase *nubase,
const bool for_render,
ListBase *r_dispbase)
@@ -521,7 +521,7 @@ void BKE_displist_fill(const ListBase *dispbase,
/* do not free polys, needed for wireframe display */
}
-static void bevels_to_filledpoly(const Curve *cu, ListBase *dispbase)
+static void bevels_to_filledpoly(const LegacyCurve *cu, ListBase *dispbase)
{
ListBase front = {nullptr, nullptr};
ListBase back = {nullptr, nullptr};
@@ -581,7 +581,7 @@ static void bevels_to_filledpoly(const Curve *cu, ListBase *dispbase)
BKE_displist_fill(dispbase, dispbase, z_up, false);
}
-static void curve_to_filledpoly(const Curve *cu, ListBase *dispbase)
+static void curve_to_filledpoly(const LegacyCurve *cu, ListBase *dispbase)
{
if (!CU_DO_2DFILL(cu)) {
return;
@@ -722,7 +722,7 @@ void BKE_curve_calc_modifiers_pre(Depsgraph *depsgraph,
ListBase *target_nurb,
const bool for_render)
{
- const Curve *cu = (const Curve *)ob->data;
+ const LegacyCurve *cu = (const LegacyCurve *)ob->data;
BKE_modifiers_clear_errors(ob);
@@ -803,7 +803,7 @@ void BKE_curve_calc_modifiers_pre(Depsgraph *depsgraph,
* \return True if the deformed curve control point data should be implicitly
* converted directly to a mesh, or false if it can be left as curve data via #CurveEval.
*/
-static bool do_curve_implicit_mesh_conversion(const Curve *curve,
+static bool do_curve_implicit_mesh_conversion(const LegacyCurve *curve,
ModifierData *first_modifier,
const Scene *scene,
const ModifierMode required_mode)
@@ -849,7 +849,7 @@ static GeometrySet curve_calc_modifiers_post(Depsgraph *depsgraph,
const ListBase *dispbase,
const bool for_render)
{
- const Curve *cu = (const Curve *)ob->data;
+ const LegacyCurve *cu = (const LegacyCurve *)ob->data;
const bool editmode = (!for_render && (cu->editnurb || cu->editfont));
const bool use_cache = !for_render;
@@ -972,7 +972,7 @@ static void evaluate_surface_object(Depsgraph *depsgraph,
Mesh **r_final)
{
BLI_assert(ob->type == OB_SURF);
- const Curve *cu = (const Curve *)ob->data;
+ const LegacyCurve *cu = (const LegacyCurve *)ob->data;
ListBase *deformed_nurbs = &ob->runtime.curve_cache->deformed_nurbs;
@@ -1056,7 +1056,7 @@ static void evaluate_surface_object(Depsgraph *depsgraph,
*r_final = mesh_component.release();
}
-static void rotateBevelPiece(const Curve *cu,
+static void rotateBevelPiece(const LegacyCurve *cu,
const BevPoint *bevp,
const BevPoint *nbevp,
const DispList *dlb,
@@ -1194,7 +1194,7 @@ static void calc_bevfac_mapping_default(
*r_lastblend = 1.0f;
}
-static void calc_bevfac_mapping(const Curve *cu,
+static void calc_bevfac_mapping(const LegacyCurve *cu,
const BevList *bl,
const Nurb *nu,
int *r_start,
@@ -1280,7 +1280,7 @@ static GeometrySet evaluate_curve_type_object(Depsgraph *depsgraph,
ListBase *r_dispbase)
{
BLI_assert(ELEM(ob->type, OB_CURVE, OB_FONT));
- const Curve *cu = (const Curve *)ob->data;
+ const LegacyCurve *cu = (const LegacyCurve *)ob->data;
ListBase *deformed_nurbs = &ob->runtime.curve_cache->deformed_nurbs;
@@ -1490,7 +1490,7 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
const bool for_render)
{
BLI_assert(ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT));
- Curve &cow_curve = *(Curve *)ob->data;
+ LegacyCurve &cow_curve = *(LegacyCurve *)ob->data;
BKE_object_free_derived_caches(ob);
cow_curve.curve_eval = nullptr;
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 8229228976c..790f5a15d09 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -159,7 +159,7 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef
}
if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type == OB_CURVE) {
- Curve *cu = eff->ob->data;
+ LegacyCurve *cu = eff->ob->data;
if (cu->flag & CU_PATH) {
if (eff->ob->runtime.curve_cache == NULL ||
eff->ob->runtime.curve_cache->anim_path_accum_length == NULL) {
diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc
index 1e24b29038d..d7d84d6a3be 100644
--- a/source/blender/blenkernel/intern/geometry_component_curve.cc
+++ b/source/blender/blenkernel/intern/geometry_component_curve.cc
@@ -127,7 +127,7 @@ void CurveComponent::ensure_owns_direct_data()
}
}
-const Curve *CurveComponent::get_curve_for_render() const
+const LegacyCurve *CurveComponent::get_curve_for_render() const
{
if (curve_ == nullptr) {
return nullptr;
@@ -140,7 +140,7 @@ const Curve *CurveComponent::get_curve_for_render() const
return curve_for_render_;
}
- curve_for_render_ = (Curve *)BKE_id_new_nomain(ID_CU, nullptr);
+ curve_for_render_ = (LegacyCurve *)BKE_id_new_nomain(ID_CU, nullptr);
curve_for_render_->curve_eval = curve_;
return curve_for_render_;
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index d633678b873..e3a44ad27d9 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -232,7 +232,7 @@ static Collection *gpencil_get_parent_collection(Scene *scene, Object *ob)
static int gpencil_get_stroke_material_fromcurve(
Main *bmain, Object *ob_gp, Object *ob_cu, bool *do_stroke, bool *do_fill)
{
- Curve *cu = (Curve *)ob_cu->data;
+ LegacyCurve *cu = (LegacyCurve *)ob_cu->data;
Material *mat_gp = NULL;
Material *mat_curve_stroke = NULL;
@@ -489,7 +489,7 @@ void BKE_gpencil_convert_curve(Main *bmain,
return;
}
- Curve *cu = (Curve *)ob_cu->data;
+ LegacyCurve *cu = (LegacyCurve *)ob_cu->data;
bGPdata *gpd = (bGPdata *)ob_gp->data;
bGPDlayer *gpl = NULL;
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index d87331fd65c..fefbcce74c7 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1644,7 +1644,7 @@ static void icu_to_fcurves(ID *id,
*/
if ((id) && (icu->blocktype == GS(id->name)) &&
(fcu->rna_path && STREQ(fcu->rna_path, "eval_time"))) {
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
dst->vec[0][1] *= cu->pathlen;
dst->vec[1][1] *= cu->pathlen;
@@ -2411,7 +2411,7 @@ void do_versions_ipos_to_animato(Main *bmain)
/* curves */
for (id = bmain->curves.first; id; id = id->next) {
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
if (G.debug & G_DEBUG) {
printf("\tconverting curve %s\n", id->name + 2);
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index ff199794ab3..0cdb90aa916 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -831,7 +831,7 @@ static void cp_key(const int start,
}
}
-static void cp_cu_key(Curve *cu,
+static void cp_cu_key(LegacyCurve *cu,
Key *key,
KeyBlock *actkb,
KeyBlock *kb,
@@ -1420,7 +1420,7 @@ static void do_mesh_key(Object *ob, Key *key, char *out, const int tot)
}
static void do_cu_key(
- Curve *cu, Key *key, KeyBlock *actkb, KeyBlock **k, float *t, char *out, const int tot)
+ LegacyCurve *cu, Key *key, KeyBlock *actkb, KeyBlock **k, float *t, char *out, const int tot)
{
Nurb *nu;
int a, step;
@@ -1440,7 +1440,7 @@ static void do_cu_key(
}
}
-static void do_rel_cu_key(Curve *cu, Key *key, KeyBlock *actkb, char *out, const int tot)
+static void do_rel_cu_key(LegacyCurve *cu, Key *key, KeyBlock *actkb, char *out, const int tot)
{
Nurb *nu;
int a, step;
@@ -1462,7 +1462,7 @@ static void do_rel_cu_key(Curve *cu, Key *key, KeyBlock *actkb, char *out, const
static void do_curve_key(Object *ob, Key *key, char *out, const int tot)
{
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
KeyBlock *k[4], *actkb = BKE_keyblock_from_object(ob);
float t[4];
int flag = 0;
@@ -1541,7 +1541,7 @@ float *BKE_key_evaluate_object_ex(Object *ob, int *r_totelem, float *arr, size_t
size = tot * sizeof(float[KEYELEM_FLOAT_LEN_COORD]);
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
tot = BKE_keyblock_curve_element_count(&cu->nurb);
size = tot * sizeof(float[KEYELEM_ELEM_SIZE_CURVE]);
@@ -1746,7 +1746,7 @@ Key **BKE_key_from_id_p(ID *id)
return &me->key;
}
case ID_CU: {
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
if (cu->vfont == NULL) {
return &cu->key;
}
@@ -2024,7 +2024,7 @@ int BKE_keyblock_curve_element_count(const ListBase *nurb)
return tot;
}
-void BKE_keyblock_update_from_curve(Curve *UNUSED(cu), KeyBlock *kb, ListBase *nurb)
+void BKE_keyblock_update_from_curve(LegacyCurve *UNUSED(cu), KeyBlock *kb, ListBase *nurb)
{
Nurb *nu;
BezTriple *bezt;
@@ -2094,7 +2094,7 @@ void BKE_keyblock_curve_data_transform(const ListBase *nurb,
}
}
-void BKE_keyblock_convert_from_curve(Curve *cu, KeyBlock *kb, ListBase *nurb)
+void BKE_keyblock_convert_from_curve(LegacyCurve *cu, KeyBlock *kb, ListBase *nurb)
{
int tot;
@@ -2112,7 +2112,7 @@ void BKE_keyblock_convert_from_curve(Curve *cu, KeyBlock *kb, ListBase *nurb)
BKE_keyblock_update_from_curve(cu, kb, nurb);
}
-void BKE_keyblock_convert_to_curve(KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb)
+void BKE_keyblock_convert_to_curve(KeyBlock *kb, LegacyCurve *UNUSED(cu), ListBase *nurb)
{
Nurb *nu;
BezTriple *bezt;
@@ -2279,7 +2279,7 @@ void BKE_keyblock_update_from_vertcos(Object *ob, KeyBlock *kb, const float (*ve
BLI_assert((lt->pntsu * lt->pntsv * lt->pntsw) == kb->totelem);
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
BLI_assert(BKE_keyblock_curve_element_count(&cu->nurb) == kb->totelem);
}
else if (ob->type == OB_MESH) {
@@ -2303,7 +2303,7 @@ void BKE_keyblock_update_from_vertcos(Object *ob, KeyBlock *kb, const float (*ve
}
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
Nurb *nu;
BezTriple *bezt;
BPoint *bp;
@@ -2345,7 +2345,7 @@ void BKE_keyblock_convert_from_vertcos(Object *ob, KeyBlock *kb, const float (*v
elemsize = lt->key->elemsize;
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
elemsize = cu->key->elemsize;
tot = BKE_keyblock_curve_element_count(&cu->nurb);
}
@@ -2376,7 +2376,7 @@ float (*BKE_keyblock_convert_to_vertcos(Object *ob, KeyBlock *kb))[3]
tot = lt->pntsu * lt->pntsv * lt->pntsw;
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
tot = BKE_nurbList_verts_count(&cu->nurb);
}
@@ -2393,7 +2393,7 @@ float (*BKE_keyblock_convert_to_vertcos(Object *ob, KeyBlock *kb))[3]
}
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
Nurb *nu;
BezTriple *bezt;
BPoint *bp;
@@ -2432,7 +2432,7 @@ void BKE_keyblock_update_from_offset(Object *ob, KeyBlock *kb, const float (*ofs
}
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
Nurb *nu;
BezTriple *bezt;
BPoint *bp;
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index d6035887790..f6f13d747e7 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -330,7 +330,7 @@ Material ***BKE_object_material_array_p(Object *ob)
return &(me->mat);
}
if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
return &(cu->mat);
}
if (ob->type == OB_MBALL) {
@@ -363,7 +363,7 @@ short *BKE_object_material_len_p(Object *ob)
return &(me->totcol);
}
if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
return &(cu->totcol);
}
if (ob->type == OB_MBALL) {
@@ -398,7 +398,7 @@ Material ***BKE_id_material_array_p(ID *id)
case ID_ME:
return &(((Mesh *)id)->mat);
case ID_CU:
- return &(((Curve *)id)->mat);
+ return &(((LegacyCurve *)id)->mat);
case ID_MB:
return &(((MetaBall *)id)->mat);
case ID_GD:
@@ -424,7 +424,7 @@ short *BKE_id_material_len_p(ID *id)
case ID_ME:
return &(((Mesh *)id)->totcol);
case ID_CU:
- return &(((Curve *)id)->totcol);
+ return &(((LegacyCurve *)id)->totcol);
case ID_MB:
return &(((MetaBall *)id)->totcol);
case ID_GD:
@@ -451,7 +451,7 @@ static void material_data_index_remove_id(ID *id, short index)
BKE_mesh_material_index_remove((Mesh *)id, index);
break;
case ID_CU:
- BKE_curve_material_index_remove((Curve *)id, index);
+ BKE_curve_material_index_remove((LegacyCurve *)id, index);
break;
case ID_MB:
case ID_HA:
@@ -485,7 +485,7 @@ bool BKE_object_material_slot_used(Object *object, short actcol)
case ID_ME:
return BKE_mesh_material_index_used((Mesh *)ob_data, actcol - 1);
case ID_CU:
- return BKE_curve_material_index_used((Curve *)ob_data, actcol - 1);
+ return BKE_curve_material_index_used((LegacyCurve *)ob_data, actcol - 1);
case ID_MB:
/* Meta-elements don't support materials at the moment. */
return false;
@@ -506,7 +506,7 @@ static void material_data_index_clear_id(ID *id)
BKE_mesh_material_index_clear((Mesh *)id);
break;
case ID_CU:
- BKE_curve_material_index_clear((Curve *)id);
+ BKE_curve_material_index_clear((LegacyCurve *)id);
break;
case ID_MB:
case ID_HA:
diff --git a/source/blender/blenkernel/intern/mesh_convert.cc b/source/blender/blenkernel/intern/mesh_convert.cc
index e8054884f26..c0ef2da9b76 100644
--- a/source/blender/blenkernel/intern/mesh_convert.cc
+++ b/source/blender/blenkernel/intern/mesh_convert.cc
@@ -220,7 +220,7 @@ static void make_edges_mdata_extend(
/* Initialize mverts, medges and, faces for converting nurbs to mesh and derived mesh */
/* use specified dispbase */
-static int mesh_nurbs_displist_to_mdata(const Curve *cu,
+static int mesh_nurbs_displist_to_mdata(const LegacyCurve *cu,
const ListBase *dispbase,
MVert **r_allvert,
int *r_totvert,
@@ -497,7 +497,7 @@ static int mesh_nurbs_displist_to_mdata(const Curve *cu,
* differently for curve and mesh, since curves use control points and handles to calculate the
* bounding box, and mesh uses the tessellated curve.
*/
-static void mesh_copy_texture_space_from_curve_type(const Curve *cu, Mesh *me)
+static void mesh_copy_texture_space_from_curve_type(const LegacyCurve *cu, Mesh *me)
{
me->texflag = cu->texflag & ~CU_AUTOSPACE;
copy_v3_v3(me->loc, cu->loc);
@@ -507,7 +507,7 @@ static void mesh_copy_texture_space_from_curve_type(const Curve *cu, Mesh *me)
Mesh *BKE_mesh_new_nomain_from_curve_displist(const Object *ob, const ListBase *dispbase)
{
- const Curve *cu = (const Curve *)ob->data;
+ const LegacyCurve *cu = (const LegacyCurve *)ob->data;
Mesh *mesh;
MVert *allvert;
MEdge *alledge;
@@ -758,7 +758,7 @@ void BKE_mesh_to_curve(Main *bmain, Depsgraph *depsgraph, Scene *UNUSED(scene),
BKE_mesh_to_curve_nurblist(me_eval, &nurblist, 1);
if (nurblist.first) {
- Curve *cu = BKE_curve_add(bmain, ob->id.name + 2, OB_CURVE);
+ LegacyCurve *cu = BKE_curve_add(bmain, ob->id.name + 2, OB_CURVE);
cu->flag |= CU_3D;
cu->nurb = nurblist;
@@ -871,7 +871,7 @@ void BKE_pointcloud_to_mesh(Main *bmain, Depsgraph *depsgraph, Scene *UNUSED(sce
/* Create a temporary object to be used for nurbs-to-mesh conversion. */
static Object *object_for_curve_to_mesh_create(const Object *object)
{
- const Curve *curve = (const Curve *)object->data;
+ const LegacyCurve *curve = (const LegacyCurve *)object->data;
/* Create a temporary object which can be evaluated and modified by generic
* curve evaluation (hence the #LIB_ID_COPY_SET_COPIED_ON_WRITE flag). */
@@ -887,7 +887,7 @@ static Object *object_for_curve_to_mesh_create(const Object *object)
(const ID *)object->data,
nullptr,
LIB_ID_COPY_LOCALIZE | LIB_ID_COPY_SET_COPIED_ON_WRITE);
- Curve *temp_curve = (Curve *)temp_object->data;
+ LegacyCurve *temp_curve = (LegacyCurve *)temp_object->data;
/* Make sure texture space is calculated for a copy of curve, it will be used for the final
* result. */
@@ -907,7 +907,7 @@ static Object *object_for_curve_to_mesh_create(const Object *object)
static void curve_to_mesh_eval_ensure(Object &object)
{
BLI_assert(GS(static_cast<ID *>(object.data)->name) == ID_CU);
- Curve &curve = *static_cast<Curve *>(object.data);
+ LegacyCurve &curve = *static_cast<LegacyCurve *>(object.data);
/* Clear all modifiers for the bevel object.
*
* This is because they can not be reliably evaluated for an original object (at least because
diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc
index 7fec91ed65a..4790469f1f0 100644
--- a/source/blender/blenkernel/intern/object.cc
+++ b/source/blender/blenkernel/intern/object.cc
@@ -1966,14 +1966,14 @@ bool BKE_object_is_in_editmode(const Object *ob)
case OB_ARMATURE:
return ((bArmature *)ob->data)->edbo != nullptr;
case OB_FONT:
- return ((Curve *)ob->data)->editfont != nullptr;
+ return ((LegacyCurve *)ob->data)->editfont != nullptr;
case OB_MBALL:
return ((MetaBall *)ob->data)->editelems != nullptr;
case OB_LATTICE:
return ((Lattice *)ob->data)->editlatt != nullptr;
case OB_SURF:
case OB_CURVE:
- return ((Curve *)ob->data)->editnurb != nullptr;
+ return ((LegacyCurve *)ob->data)->editnurb != nullptr;
case OB_GPENCIL:
/* Grease Pencil object has no edit mode data. */
return GPENCIL_EDIT_MODE((bGPdata *)ob->data);
@@ -1995,8 +1995,8 @@ bool BKE_object_data_is_in_editmode(const ID *id)
case ID_ME:
return ((const Mesh *)id)->edit_mesh != nullptr;
case ID_CU:
- return ((((const Curve *)id)->editnurb != nullptr) ||
- (((const Curve *)id)->editfont != nullptr));
+ return ((((const LegacyCurve *)id)->editnurb != nullptr) ||
+ (((const LegacyCurve *)id)->editfont != nullptr));
case ID_MB:
return ((const MetaBall *)id)->editelems != nullptr;
case ID_LT:
@@ -2021,14 +2021,14 @@ char *BKE_object_data_editmode_flush_ptr_get(struct ID *id)
break;
}
case ID_CU: {
- if (((Curve *)id)->vfont != nullptr) {
- EditFont *ef = ((Curve *)id)->editfont;
+ if (((LegacyCurve *)id)->vfont != nullptr) {
+ EditFont *ef = ((LegacyCurve *)id)->editfont;
if (ef != nullptr) {
return &ef->needs_flush_to_id;
}
}
else {
- EditNurb *editnurb = ((Curve *)id)->editnurb;
+ EditNurb *editnurb = ((LegacyCurve *)id)->editnurb;
if (editnurb) {
return &editnurb->needs_flush_to_id;
}
@@ -2277,7 +2277,7 @@ int BKE_object_obdata_to_type(const ID *id)
case ID_ME:
return OB_MESH;
case ID_CU:
- return BKE_curve_type_get((const Curve *)id);
+ return BKE_curve_type_get((const LegacyCurve *)id);
case ID_MB:
return OB_MBALL;
case ID_LA:
@@ -3049,7 +3049,7 @@ void BKE_object_obdata_size_init(struct Object *ob, const float size)
break;
}
case OB_FONT: {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
cu->fsize *= size;
break;
}
@@ -3312,7 +3312,7 @@ void BKE_object_matrix_local_get(struct Object *ob, float r_mat[4][4])
*/
static bool ob_parcurve(Object *ob, Object *par, float r_mat[4][4])
{
- Curve *cu = (Curve *)par->data;
+ LegacyCurve *cu = (LegacyCurve *)par->data;
float vec[4], dir[3], quat[4], radius, ctime;
/* NOTE: Curve cache is supposed to be evaluated here already, however there
@@ -3487,7 +3487,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
nurb = &par->runtime.curve_cache->deformed_nurbs;
}
else {
- Curve *cu = (Curve *)par->data;
+ LegacyCurve *cu = (LegacyCurve *)par->data;
nurb = BKE_curve_nurbs_get(cu);
}
@@ -3551,7 +3551,7 @@ void BKE_object_get_parent_matrix(Object *ob, Object *par, float r_parentmat[4][
case PAROBJECT: {
bool ok = false;
if (par->type == OB_CURVE) {
- if ((((Curve *)par->data)->flag & CU_PATH) && (ob_parcurve(ob, par, tmat))) {
+ if ((((LegacyCurve *)par->data)->flag & CU_PATH) && (ob_parcurve(ob, par, tmat))) {
ok = true;
}
}
@@ -4464,7 +4464,7 @@ bool BKE_object_obdata_texspace_get(Object *ob, char **r_texflag, float **r_loc,
break;
}
case ID_CU: {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
BKE_curve_texspace_ensure(cu);
if (r_texflag) {
*r_texflag = &cu->texflag;
@@ -4735,7 +4735,7 @@ static KeyBlock *insert_lattkey(Main *bmain, Object *ob, const char *name, const
/** Curve */
static KeyBlock *insert_curvekey(Main *bmain, Object *ob, const char *name, const bool from_mix)
{
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
Key *key = cu->key;
KeyBlock *kb;
ListBase *lb = BKE_curve_nurbs_get(cu);
@@ -4865,7 +4865,7 @@ bool BKE_object_shapekey_remove(Main *bmain, Object *ob, KeyBlock *kb)
case OB_CURVE:
case OB_SURF:
BKE_keyblock_convert_to_curve(
- key->refkey, (Curve *)ob->data, BKE_curve_nurbs_get((Curve *)ob->data));
+ key->refkey, (LegacyCurve *)ob->data, BKE_curve_nurbs_get((LegacyCurve *)ob->data));
break;
case OB_LATTICE:
BKE_keyblock_convert_to_lattice(key->refkey, (Lattice *)ob->data);
@@ -5078,7 +5078,7 @@ int BKE_object_is_deform_modified(Scene *scene, Object *ob)
}
if (ob->type == OB_CURVE) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
if (cu->taperobj != nullptr && object_deforms_in_time(cu->taperobj)) {
flag |= eModifierMode_Realtime | eModifierMode_Render;
}
@@ -5388,7 +5388,7 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot)
case OB_CURVE:
case OB_SURF: {
/* TODO: take deformation into account */
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
unsigned int i, a;
Nurb *nu;
@@ -5693,7 +5693,7 @@ bool BKE_object_modifier_update_subframe(Depsgraph *depsgraph,
/* for curve following objects, parented curve has to be updated too */
if (ob->type == OB_CURVE) {
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
BKE_animsys_evaluate_animdata(
&cu->id, cu->adt, &anim_eval_context, ADT_RECALC_ANIM, flush_to_original);
}
@@ -5742,11 +5742,11 @@ void BKE_object_to_mesh_clear(Object *object)
object->runtime.object_as_temp_mesh = nullptr;
}
-Curve *BKE_object_to_curve(Object *object, Depsgraph *depsgraph, bool apply_modifiers)
+LegacyCurve *BKE_object_to_curve(Object *object, Depsgraph *depsgraph, bool apply_modifiers)
{
BKE_object_to_curve_clear(object);
- Curve *curve = BKE_curve_new_from_object(object, depsgraph, apply_modifiers);
+ LegacyCurve *curve = BKE_curve_new_from_object(object, depsgraph, apply_modifiers);
object->runtime.object_as_temp_curve = curve;
return curve;
}
diff --git a/source/blender/blenkernel/intern/object_dupli.cc b/source/blender/blenkernel/intern/object_dupli.cc
index 9f998b746a2..a8350052653 100644
--- a/source/blender/blenkernel/intern/object_dupli.cc
+++ b/source/blender/blenkernel/intern/object_dupli.cc
@@ -692,7 +692,7 @@ static void make_duplis_font(const DupliContext *ctx)
Object *par = ctx->object;
GHash *family_gh;
Object *ob;
- Curve *cu;
+ LegacyCurve *cu;
struct CharTrans *ct, *chartransdata = nullptr;
float vec[3], obmat[4][4], pmat[4][4], fsize, xof, yof;
int text_len, a;
@@ -709,14 +709,20 @@ static void make_duplis_font(const DupliContext *ctx)
/* In `par` the family name is stored, use this to find the other objects. */
- BKE_vfont_to_curve_ex(
- par, (Curve *)par->data, FO_DUPLI, nullptr, &text, &text_len, &text_free, &chartransdata);
+ BKE_vfont_to_curve_ex(par,
+ (LegacyCurve *)par->data,
+ FO_DUPLI,
+ nullptr,
+ &text,
+ &text_len,
+ &text_free,
+ &chartransdata);
if (text == nullptr || chartransdata == nullptr) {
return;
}
- cu = (Curve *)par->data;
+ cu = (LegacyCurve *)par->data;
fsize = cu->fsize;
xof = cu->xof;
yof = cu->yof;
@@ -871,7 +877,7 @@ static void make_duplis_geometry_set_impl(const DupliContext *ctx,
if (!ELEM(ctx->object->type, OB_CURVE, OB_FONT) || geometry_set_is_instance) {
const CurveComponent *curve_component = geometry_set.get_component_for_read<CurveComponent>();
if (curve_component != nullptr) {
- const Curve *curve = curve_component->get_curve_for_render();
+ const LegacyCurve *curve = curve_component->get_curve_for_render();
if (curve != nullptr) {
DupliObject *dupli = make_dupli(ctx, ctx->object, parent_transform, component_index++);
dupli->ob_data = (ID *)curve;
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index 4c0d0303c1f..b6d54e3e591 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -357,7 +357,8 @@ void BKE_object_data_batch_cache_dirty_tag(ID *object_data)
BKE_LATTICE_BATCH_DIRTY_ALL);
break;
case ID_CU:
- BKE_curve_batch_cache_dirty_tag((struct Curve *)object_data, BKE_CURVE_BATCH_DIRTY_ALL);
+ BKE_curve_batch_cache_dirty_tag((struct LegacyCurve *)object_data,
+ BKE_CURVE_BATCH_DIRTY_ALL);
break;
case ID_MB:
BKE_mball_batch_cache_dirty_tag((struct MetaBall *)object_data, BKE_MBALL_BATCH_DIRTY_ALL);
@@ -421,7 +422,7 @@ void BKE_object_data_select_update(Depsgraph *depsgraph, ID *object_data)
BKE_mesh_batch_cache_dirty_tag((Mesh *)object_data, BKE_MESH_BATCH_DIRTY_SELECT);
break;
case ID_CU:
- BKE_curve_batch_cache_dirty_tag((Curve *)object_data, BKE_CURVE_BATCH_DIRTY_SELECT);
+ BKE_curve_batch_cache_dirty_tag((LegacyCurve *)object_data, BKE_CURVE_BATCH_DIRTY_SELECT);
break;
case ID_LT:
BKE_lattice_batch_cache_dirty_tag((struct Lattice *)object_data,
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 674f264feb7..d4ecbcae247 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2388,7 +2388,7 @@ int do_guides(Depsgraph *depsgraph,
NULL;
EffectorCache *eff;
PartDeflect *pd;
- Curve *cu;
+ LegacyCurve *cu;
GuideEffectorData *data;
float effect[3] = {0.0f, 0.0f, 0.0f}, veffect[3] = {0.0f, 0.0f, 0.0f};
@@ -2416,7 +2416,7 @@ int do_guides(Depsgraph *depsgraph,
continue;
}
- cu = (Curve *)eff->ob->data;
+ cu = (LegacyCurve *)eff->ob->data;
if (pd->flag & PFIELD_GUIDE_PATH_ADD) {
if (BKE_where_on_path(
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index b811c17a3bc..65894e76160 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -2970,7 +2970,7 @@ static void lattice_to_softbody(Object *ob)
/* makes totally fresh start situation */
static void curve_surf_to_softbody(Object *ob)
{
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
SoftBody *sb;
BodyPoint *bp;
BodySpring *bs;
diff --git a/source/blender/blenkernel/intern/vfont.c b/source/blender/blenkernel/intern/vfont.c
index 4a598288ee6..bfbdbf0971c 100644
--- a/source/blender/blenkernel/intern/vfont.c
+++ b/source/blender/blenkernel/intern/vfont.c
@@ -412,7 +412,7 @@ VFont *BKE_vfont_load_exists(struct Main *bmain, const char *filepath)
return BKE_vfont_load_exists_ex(bmain, filepath, NULL);
}
-static VFont *which_vfont(Curve *cu, CharInfo *info)
+static VFont *which_vfont(LegacyCurve *cu, CharInfo *info)
{
switch (info->flag & (CU_CHINFO_BOLD | CU_CHINFO_ITALIC)) {
case CU_CHINFO_BOLD:
@@ -444,7 +444,7 @@ static VChar *find_vfont_char(VFontData *vfd, unsigned int character)
return BLI_ghash_lookup(vfd->characters, POINTER_FROM_UINT(character));
}
-static void build_underline(Curve *cu,
+static void build_underline(LegacyCurve *cu,
ListBase *nubase,
const rctf *rect,
float yofs,
@@ -508,7 +508,7 @@ static void build_underline(Curve *cu,
mul_v2_fl(bp[3].vec, font_size);
}
-void BKE_vfont_build_char(Curve *cu,
+void BKE_vfont_build_char(LegacyCurve *cu,
ListBase *nubase,
unsigned int character,
CharInfo *info,
@@ -633,7 +633,7 @@ void BKE_vfont_build_char(Curve *cu,
int BKE_vfont_select_get(Object *ob, int *r_start, int *r_end)
{
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
EditFont *ef = cu->editfont;
int start, end, direction;
@@ -673,7 +673,7 @@ int BKE_vfont_select_get(Object *ob, int *r_start, int *r_end)
void BKE_vfont_select_clamp(Object *ob)
{
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
EditFont *ef = cu->editfont;
BLI_assert((ob->type == OB_FONT) && ef);
@@ -683,7 +683,7 @@ void BKE_vfont_select_clamp(Object *ob)
CLAMP_MAX(ef->selend, ef->len);
}
-static float char_width(Curve *cu, VChar *che, CharInfo *info)
+static float char_width(LegacyCurve *cu, VChar *che, CharInfo *info)
{
/* The character wasn't found, probably ascii = 0, then the width shall be 0 as well */
if (che == NULL) {
@@ -782,7 +782,7 @@ static float vfont_descent(const VFontData *vfd)
}
static bool vfont_to_curve(Object *ob,
- Curve *cu,
+ LegacyCurve *cu,
int mode,
VFontToCurveIter *iter_data,
ListBase *r_nubase,
@@ -1726,7 +1726,7 @@ finally:
#undef ASCENT
bool BKE_vfont_to_curve_ex(Object *ob,
- Curve *cu,
+ LegacyCurve *cu,
int mode,
ListBase *r_nubase,
const char32_t **r_text,
@@ -1762,7 +1762,7 @@ bool BKE_vfont_to_curve_nubase(Object *ob, int mode, ListBase *r_nubase)
bool BKE_vfont_to_curve(Object *ob, int mode)
{
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
return BKE_vfont_to_curve_ex(ob, ob->data, mode, &cu->nurb, NULL, NULL, NULL, NULL);
}
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index 54e673b51eb..5226870e98d 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -689,7 +689,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
Base *base;
Material *ma;
Camera *cam;
- Curve *cu;
+ LegacyCurve *cu;
Scene *sce;
Tex *tx;
ParticleSettings *part;
@@ -998,7 +998,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
Mesh *me;
Nurb *nu;
Lattice *lt;
- Curve *cu;
+ LegacyCurve *cu;
Key *key;
const float *data;
int a, tot;
@@ -1691,7 +1691,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
}
{
- Curve *cu;
+ LegacyCurve *cu;
for (cu = bmain->curves.first; cu; cu = cu->id.next) {
cu->smallcaps_scale = 0.75f;
}
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 8a22fd07c24..5ba9ce70561 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -1277,7 +1277,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (!MAIN_VERSION_ATLEAST(bmain, 263, 4)) {
Camera *cam;
- Curve *cu;
+ LegacyCurve *cu;
for (cam = bmain->cameras.first; cam; cam = cam->id.next) {
if (cam->flag & CAM_PANORAMA) {
@@ -1888,7 +1888,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
if (!MAIN_VERSION_ATLEAST(bmain, 265, 7)) {
- Curve *cu;
+ LegacyCurve *cu;
for (cu = bmain->curves.first; cu; cu = cu->id.next) {
if (cu->flag & (CU_FRONT | CU_BACK)) {
@@ -2532,7 +2532,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
if (!MAIN_VERSION_ATLEAST(bmain, 269, 8)) {
- Curve *cu;
+ LegacyCurve *cu;
for (cu = bmain->curves.first; cu; cu = cu->id.next) {
if (cu->str) {
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 4333bdb851c..ae3f73f56da 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1419,7 +1419,7 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
/* Update Curve object Shape Key data layout to include the Radius property */
if (!MAIN_VERSION_ATLEAST(bmain, 280, 23)) {
- for (Curve *cu = bmain->curves.first; cu; cu = cu->id.next) {
+ for (LegacyCurve *cu = bmain->curves.first; cu; cu = cu->id.next) {
if (!cu->key || cu->key->elemsize != sizeof(float[4])) {
continue;
}
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 888bd244007..2e1a343dc55 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -1196,7 +1196,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
/* Add custom profile and bevel mode to curve bevels. */
if (!DNA_struct_elem_find(fd->filesdna, "Curve", "char", "bevel_mode")) {
- LISTBASE_FOREACH (Curve *, curve, &bmain->curves) {
+ LISTBASE_FOREACH (LegacyCurve *, curve, &bmain->curves) {
if (curve->bevobj != NULL) {
curve->bevel_mode = CU_BEV_MODE_OBJECT;
}
@@ -1937,7 +1937,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
/* The CU_2D flag has been removed. */
- LISTBASE_FOREACH (Curve *, cu, &bmain->curves) {
+ LISTBASE_FOREACH (LegacyCurve *, cu, &bmain->curves) {
#define CU_2D (1 << 3)
ListBase *nurbs = BKE_curve_nurbs_get(cu);
bool is_2d = true;
@@ -2019,7 +2019,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
- LISTBASE_FOREACH (Curve *, cu, &bmain->curves) {
+ LISTBASE_FOREACH (LegacyCurve *, cu, &bmain->curves) {
/* Turn on clamping as this was implicit before. */
cu->flag |= CU_PATH_CLAMP;
}
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index 2fceb42262e..edc9380726c 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1373,7 +1373,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Object *obc = blo_do_versions_newlibadr(fd, lib, data->tar);
if (obc && obc->type == OB_CURVE) {
- Curve *cu = blo_do_versions_newlibadr(fd, lib, obc->data);
+ LegacyCurve *cu = blo_do_versions_newlibadr(fd, lib, obc->data);
if (cu) {
cu->flag |= CU_PATH;
}
@@ -1645,7 +1645,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Scene *sce;
bScreen *screen;
Object *ob;
- Curve *cu;
+ LegacyCurve *cu;
Material *ma;
Mesh *me;
Collection *collection;
@@ -2480,7 +2480,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
/* set the curve radius interpolation to 2.47 default - easy */
if (!MAIN_VERSION_ATLEAST(bmain, 247, 6)) {
- Curve *cu;
+ LegacyCurve *cu;
Nurb *nu;
for (cu = bmain->curves.first; cu; cu = cu->id.next) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 51582508b6f..84e5681ce4c 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -1538,12 +1538,12 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
- BKE_curve_eval_geometry(depsgraph, (Curve *)obdata_cow);
+ BKE_curve_eval_geometry(depsgraph, (LegacyCurve *)obdata_cow);
});
op_node->set_as_entry();
/* Make sure objects used for bevel.taper are in the graph.
* NOTE: This objects might be not linked to the scene. */
- Curve *cu = (Curve *)obdata;
+ LegacyCurve *cu = (LegacyCurve *)obdata;
if (cu->bevobj != nullptr) {
build_object(-1, cu->bevobj, DEG_ID_LINKED_INDIRECTLY, is_object_visible);
}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index b195b2d9e11..c7bc1096614 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -884,7 +884,7 @@ void DepsgraphRelationBuilder::build_object_data(Object *object)
/* TODO(sergey): Only for until we support granular
* update of curves. */
if (object->type == OB_FONT) {
- Curve *curve = (Curve *)object->data;
+ LegacyCurve *curve = (LegacyCurve *)object->data;
if (curve->textoncurve) {
ComponentKey geometry_key((ID *)object->data, NodeType::GEOMETRY);
ComponentKey transform_key(&object->id, NodeType::TRANSFORM);
@@ -1033,7 +1033,7 @@ void DepsgraphRelationBuilder::build_object_parent(Object *object)
add_relation(geom_key, object_transform_key, "Lattice Deform Parent Geom");
}
else if (object->parent->type == OB_CURVE) {
- Curve *cu = (Curve *)object->parent->data;
+ LegacyCurve *cu = (LegacyCurve *)object->parent->data;
if (cu->flag & CU_PATH) {
/* Follow Path. */
@@ -2247,7 +2247,7 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
case ID_MB:
break;
case ID_CU: {
- Curve *cu = (Curve *)obdata;
+ LegacyCurve *cu = (LegacyCurve *)obdata;
if (cu->bevobj != nullptr) {
ComponentKey bevob_geom_key(&cu->bevobj->id, NodeType::GEOMETRY);
add_relation(bevob_geom_key, obdata_geom_eval_key, "Curve Bevel Geometry");
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 2b0d0e6e780..87da1a53257 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -341,7 +341,7 @@ void deg_graph_id_tag_legacy_compat(
break;
}
case ID_CU: {
- Curve *curve = (Curve *)id;
+ LegacyCurve *curve = (LegacyCurve *)id;
if (curve->key != nullptr) {
ID *key_id = &curve->key->id;
if (key_id != nullptr) {
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index 116dba054fa..f215a8b9a80 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -111,7 +111,7 @@ namespace {
#ifdef NESTED_ID_NASTY_WORKAROUND
union NestedIDHackTempStorage {
- Curve curve;
+ LegacyCurve curve;
FreestyleLineStyle linestyle;
Light lamp;
Lattice lattice;
@@ -140,7 +140,7 @@ void nested_id_hack_discard_pointers(ID *id_cow)
SPECIAL_CASE(ID_WO, World, nodetree)
SPECIAL_CASE(ID_SIM, Simulation, nodetree)
- SPECIAL_CASE(ID_CU, Curve, key)
+ SPECIAL_CASE(ID_CU, LegacyCurve, key)
SPECIAL_CASE(ID_LT, Lattice, key)
SPECIAL_CASE(ID_ME, Mesh, key)
@@ -189,7 +189,7 @@ const ID *nested_id_hack_get_discarded_pointers(NestedIDHackTempStorage *storage
SPECIAL_CASE(ID_WO, World, nodetree, world)
SPECIAL_CASE(ID_SIM, Simulation, nodetree, simulation)
- SPECIAL_CASE(ID_CU, Curve, key, curve)
+ SPECIAL_CASE(ID_CU, LegacyCurve, key, curve)
SPECIAL_CASE(ID_LT, Lattice, key, lattice)
SPECIAL_CASE(ID_ME, Mesh, key, mesh)
@@ -229,7 +229,7 @@ void nested_id_hack_restore_pointers(const ID *old_id, ID *new_id)
SPECIAL_CASE(ID_WO, World, nodetree)
SPECIAL_CASE(ID_SIM, Simulation, nodetree)
- SPECIAL_CASE(ID_CU, Curve, key)
+ SPECIAL_CASE(ID_CU, LegacyCurve, key)
SPECIAL_CASE(ID_LT, Lattice, key)
SPECIAL_CASE(ID_ME, Mesh, key)
@@ -267,7 +267,7 @@ void ntree_hack_remap_pointers(const Depsgraph *depsgraph, ID *id_cow)
SPECIAL_CASE(ID_WO, World, nodetree, bNodeTree)
SPECIAL_CASE(ID_SIM, Simulation, nodetree, bNodeTree)
- SPECIAL_CASE(ID_CU, Curve, key, Key)
+ SPECIAL_CASE(ID_CU, LegacyCurve, key, Key)
SPECIAL_CASE(ID_LT, Lattice, key, Key)
SPECIAL_CASE(ID_ME, Mesh, key, Key)
@@ -547,8 +547,8 @@ void update_curve_edit_mode_pointers(const Depsgraph * /*depsgraph*/,
const ID *id_orig,
ID *id_cow)
{
- const Curve *curve_orig = (const Curve *)id_orig;
- Curve *curve_cow = (Curve *)id_cow;
+ const LegacyCurve *curve_orig = (const LegacyCurve *)id_orig;
+ LegacyCurve *curve_cow = (LegacyCurve *)id_cow;
curve_cow->editnurb = curve_orig->editnurb;
curve_cow->editfont = curve_orig->editfont;
}
@@ -926,7 +926,7 @@ void discard_armature_edit_mode_pointers(ID *id_cow)
void discard_curve_edit_mode_pointers(ID *id_cow)
{
- Curve *curve_cow = (Curve *)id_cow;
+ LegacyCurve *curve_cow = (LegacyCurve *)id_cow;
curve_cow->editnurb = nullptr;
curve_cow->editfont = nullptr;
}
diff --git a/source/blender/draw/engines/overlay/overlay_edit_curve.c b/source/blender/draw/engines/overlay/overlay_edit_curve.c
index 6d907646817..0acabf9dbc7 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_curve.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_curve.c
@@ -80,7 +80,7 @@ void OVERLAY_edit_curve_cache_populate(OVERLAY_Data *vedata, Object *ob)
bool draw_normals = (pd->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_NORMALS) != 0;
bool do_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0;
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
struct GPUBatch *geom;
geom = DRW_cache_curve_edge_wire_get(ob);
diff --git a/source/blender/draw/engines/overlay/overlay_edit_text.c b/source/blender/draw/engines/overlay/overlay_edit_text.c
index b899767acc4..b38e5fc2d56 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_text.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_text.c
@@ -89,7 +89,7 @@ static void v2_quad_corners_to_mat4(const float corners[4][2], float r_mat[4][4]
static void edit_text_cache_populate_select(OVERLAY_Data *vedata, Object *ob)
{
OVERLAY_PrivateData *pd = vedata->stl->pd;
- const Curve *cu = ob->data;
+ const LegacyCurve *cu = ob->data;
EditFont *ef = cu->editfont;
float final_mat[4][4], box[4][2];
struct GPUBatch *geom = DRW_cache_quad_get();
@@ -134,7 +134,7 @@ static void edit_text_cache_populate_select(OVERLAY_Data *vedata, Object *ob)
static void edit_text_cache_populate_cursor(OVERLAY_Data *vedata, Object *ob)
{
OVERLAY_PrivateData *pd = vedata->stl->pd;
- const Curve *cu = ob->data;
+ const LegacyCurve *cu = ob->data;
EditFont *edit_font = cu->editfont;
float(*cursor)[2] = edit_font->textcurs;
float mat[4][4];
@@ -149,7 +149,7 @@ static void edit_text_cache_populate_cursor(OVERLAY_Data *vedata, Object *ob)
static void edit_text_cache_populate_boxes(OVERLAY_Data *vedata, Object *ob)
{
OVERLAY_ExtraCallBuffers *cb = OVERLAY_extra_call_buffer_get(vedata, ob);
- const Curve *cu = ob->data;
+ const LegacyCurve *cu = ob->data;
for (int i = 0; i < cu->totbox; i++) {
TextBox *tb = &cu->tb[i];
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c
index a2362cd8850..74bcf7e44b5 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -472,7 +472,7 @@ static void OVERLAY_texture_space(OVERLAY_ExtraCallBuffers *cb, Object *ob, cons
BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, &texcosize);
break;
case ID_CU: {
- Curve *cu = (Curve *)ob_data;
+ LegacyCurve *cu = (LegacyCurve *)ob_data;
BKE_curve_texspace_ensure(cu);
texcoloc = cu->loc;
texcosize = cu->size;
@@ -514,7 +514,7 @@ static void OVERLAY_forcefield(OVERLAY_ExtraCallBuffers *cb, Object *ob, ViewLay
int theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL);
float *color = DRW_color_background_blend_get(theme_id);
PartDeflect *pd = ob->pd;
- Curve *cu = (ob->type == OB_CURVE) ? ob->data : NULL;
+ LegacyCurve *cu = (ob->type == OB_CURVE) ? ob->data : NULL;
union {
float mat[4][4];
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index 03fb3b92277..33847baa32b 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -2937,14 +2937,14 @@ GPUBatch *DRW_cache_mesh_surface_mesh_analysis_get(Object *ob)
GPUBatch *DRW_cache_curve_edge_wire_get(Object *ob)
{
BLI_assert(ob->type == OB_CURVE);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
return DRW_curve_batch_cache_get_wire_edge(cu);
}
GPUBatch *DRW_cache_curve_edge_normal_get(Object *ob)
{
BLI_assert(ob->type == OB_CURVE);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
return DRW_curve_batch_cache_get_normal_edge(cu);
}
@@ -2952,7 +2952,7 @@ GPUBatch *DRW_cache_curve_edge_overlay_get(Object *ob)
{
BLI_assert(ELEM(ob->type, OB_CURVE, OB_SURF));
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
return DRW_curve_batch_cache_get_edit_edges(cu);
}
@@ -2960,7 +2960,7 @@ GPUBatch *DRW_cache_curve_vert_overlay_get(Object *ob)
{
BLI_assert(ELEM(ob->type, OB_CURVE, OB_SURF));
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
return DRW_curve_batch_cache_get_edit_verts(cu);
}
@@ -3006,7 +3006,7 @@ GPUBatch **DRW_cache_mball_surface_shaded_get(Object *ob,
GPUBatch *DRW_cache_text_edge_wire_get(Object *ob)
{
BLI_assert(ob->type == OB_FONT);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
return DRW_curve_batch_cache_get_wire_edge(cu);
}
@@ -3020,7 +3020,7 @@ GPUBatch *DRW_cache_surf_surface_get(Object *ob)
{
BLI_assert(ob->type == OB_SURF);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
struct Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
if (mesh_eval != NULL) {
return DRW_mesh_batch_cache_get_surface(mesh_eval);
@@ -3033,7 +3033,7 @@ GPUBatch *DRW_cache_surf_edge_wire_get(Object *ob)
{
BLI_assert(ob->type == OB_SURF);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
struct Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
if (mesh_eval != NULL) {
return DRW_mesh_batch_cache_get_loose_edges(mesh_eval);
@@ -3046,7 +3046,7 @@ GPUBatch *DRW_cache_surf_face_wireframe_get(Object *ob)
{
BLI_assert(ob->type == OB_SURF);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
struct Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
if (mesh_eval != NULL) {
return DRW_mesh_batch_cache_get_wireframes_face(mesh_eval);
@@ -3058,7 +3058,7 @@ GPUBatch *DRW_cache_surf_face_wireframe_get(Object *ob)
GPUBatch *DRW_cache_surf_edge_detection_get(Object *ob, bool *r_is_manifold)
{
BLI_assert(ob->type == OB_SURF);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
struct Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
if (mesh_eval != NULL) {
return DRW_mesh_batch_cache_get_edge_detection(mesh_eval, r_is_manifold);
@@ -3071,7 +3071,7 @@ GPUBatch *DRW_cache_surf_loose_edges_get(Object *ob)
{
BLI_assert(ob->type == OB_SURF);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
struct Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
if (mesh_eval != NULL) {
return DRW_mesh_batch_cache_get_loose_edges(mesh_eval);
@@ -3088,7 +3088,7 @@ GPUBatch **DRW_cache_surf_surface_shaded_get(Object *ob,
{
BLI_assert(ob->type == OB_SURF);
- struct Curve *cu = ob->data;
+ struct LegacyCurve *cu = ob->data;
struct Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
if (mesh_eval != NULL) {
return DRW_mesh_batch_cache_get_surface_shaded(mesh_eval, gpumat_array, gpumat_array_len);
@@ -3389,13 +3389,13 @@ void drw_batch_cache_validate(Object *ob)
break;
case OB_CURVE:
case OB_FONT:
- DRW_curve_batch_cache_validate((Curve *)ob->data);
+ DRW_curve_batch_cache_validate((LegacyCurve *)ob->data);
break;
case OB_SURF:
if (mesh_eval != NULL) {
DRW_mesh_batch_cache_validate(mesh_eval);
}
- DRW_curve_batch_cache_validate((Curve *)ob->data);
+ DRW_curve_batch_cache_validate((LegacyCurve *)ob->data);
break;
case OB_MBALL:
DRW_mball_batch_cache_validate((MetaBall *)ob->data);
diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h
index 80b8c0506e7..de07032c9f9 100644
--- a/source/blender/draw/intern/draw_cache_impl.h
+++ b/source/blender/draw/intern/draw_cache_impl.h
@@ -32,7 +32,7 @@ struct PTCacheEdit;
struct ParticleSystem;
struct TaskGraph;
-struct Curve;
+struct LegacyCurve;
struct Hair;
struct Lattice;
struct Mesh;
@@ -55,9 +55,9 @@ void DRW_mball_batch_cache_dirty_tag(struct MetaBall *mb, int mode);
void DRW_mball_batch_cache_validate(struct MetaBall *mb);
void DRW_mball_batch_cache_free(struct MetaBall *mb);
-void DRW_curve_batch_cache_dirty_tag(struct Curve *cu, int mode);
-void DRW_curve_batch_cache_validate(struct Curve *cu);
-void DRW_curve_batch_cache_free(struct Curve *cu);
+void DRW_curve_batch_cache_dirty_tag(struct LegacyCurve *cu, int mode);
+void DRW_curve_batch_cache_validate(struct LegacyCurve *cu);
+void DRW_curve_batch_cache_free(struct LegacyCurve *cu);
void DRW_mesh_batch_cache_dirty_tag(struct Mesh *me, eMeshBatchDirtyMode mode);
void DRW_mesh_batch_cache_validate(struct Mesh *me);
@@ -115,19 +115,20 @@ void DRW_vertbuf_create_wiredata(struct GPUVertBuf *vbo, const int vert_len);
void DRW_curve_batch_cache_create_requested(struct Object *ob, const struct Scene *scene);
-int DRW_curve_material_count_get(struct Curve *cu);
+int DRW_curve_material_count_get(struct LegacyCurve *cu);
-struct GPUBatch *DRW_curve_batch_cache_get_wire_edge(struct Curve *cu);
-struct GPUBatch *DRW_curve_batch_cache_get_normal_edge(struct Curve *cu);
-struct GPUBatch *DRW_curve_batch_cache_get_edge_detection(struct Curve *cu, bool *r_is_manifold);
-struct GPUBatch *DRW_curve_batch_cache_get_edit_edges(struct Curve *cu);
-struct GPUBatch *DRW_curve_batch_cache_get_edit_verts(struct Curve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_wire_edge(struct LegacyCurve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_normal_edge(struct LegacyCurve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_edge_detection(struct LegacyCurve *cu,
+ bool *r_is_manifold);
+struct GPUBatch *DRW_curve_batch_cache_get_edit_edges(struct LegacyCurve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_edit_verts(struct LegacyCurve *cu);
-struct GPUBatch *DRW_curve_batch_cache_get_triangles_with_normals(struct Curve *cu);
-struct GPUBatch **DRW_curve_batch_cache_get_surface_shaded(struct Curve *cu,
+struct GPUBatch *DRW_curve_batch_cache_get_triangles_with_normals(struct LegacyCurve *cu);
+struct GPUBatch **DRW_curve_batch_cache_get_surface_shaded(struct LegacyCurve *cu,
struct GPUMaterial **gpumat_array,
uint gpumat_array_len);
-struct GPUBatch *DRW_curve_batch_cache_get_wireframes_face(struct Curve *cu);
+struct GPUBatch *DRW_curve_batch_cache_get_wireframes_face(struct LegacyCurve *cu);
/** \} */
@@ -318,7 +319,7 @@ struct GPUBatch *DRW_mesh_batch_cache_get_edit_mesh_analysis(struct Mesh *me);
* \{ */
struct GPUVertBuf *DRW_mesh_batch_cache_pos_vertbuf_get(struct Mesh *me);
-struct GPUVertBuf *DRW_curve_batch_cache_pos_vertbuf_get(struct Curve *cu);
+struct GPUVertBuf *DRW_curve_batch_cache_pos_vertbuf_get(struct LegacyCurve *cu);
struct GPUVertBuf *DRW_mball_batch_cache_pos_vertbuf_get(struct Object *ob);
int DRW_mesh_material_count_get(const struct Mesh *me);
diff --git a/source/blender/draw/intern/draw_cache_impl_curve.cc b/source/blender/draw/intern/draw_cache_impl_curve.cc
index 1108d40125b..02c53a7cfc0 100644
--- a/source/blender/draw/intern/draw_cache_impl_curve.cc
+++ b/source/blender/draw/intern/draw_cache_impl_curve.cc
@@ -79,7 +79,7 @@ enum {
* - Check if 'overlay.edges' can use single attribute per edge, not 2 (for selection drawing).
*/
-static void curve_batch_cache_clear(Curve *cu);
+static void curve_batch_cache_clear(LegacyCurve *cu);
/* ---------------------------------------------------------------------- */
/* Curve Interface, direct access to basic data. */
@@ -208,7 +208,7 @@ enum {
/*
* ob_curve_cache can be NULL
*/
-static CurveRenderData *curve_render_data_create(Curve *cu,
+static CurveRenderData *curve_render_data_create(LegacyCurve *cu,
CurveCache *ob_curve_cache,
const int types)
{
@@ -409,7 +409,7 @@ struct CurveBatchCache {
/* GPUBatch cache management. */
-static bool curve_batch_cache_valid(Curve *cu)
+static bool curve_batch_cache_valid(LegacyCurve *cu)
{
CurveBatchCache *cache = (CurveBatchCache *)cu->batch_cache;
@@ -438,7 +438,7 @@ static bool curve_batch_cache_valid(Curve *cu)
return true;
}
-static void curve_batch_cache_init(Curve *cu)
+static void curve_batch_cache_init(LegacyCurve *cu)
{
CurveBatchCache *cache = (CurveBatchCache *)cu->batch_cache;
@@ -473,7 +473,7 @@ static void curve_batch_cache_init(Curve *cu)
cache->is_dirty = false;
}
-void DRW_curve_batch_cache_validate(Curve *cu)
+void DRW_curve_batch_cache_validate(LegacyCurve *cu)
{
if (!curve_batch_cache_valid(cu)) {
curve_batch_cache_clear(cu);
@@ -481,12 +481,12 @@ void DRW_curve_batch_cache_validate(Curve *cu)
}
}
-static CurveBatchCache *curve_batch_cache_get(Curve *cu)
+static CurveBatchCache *curve_batch_cache_get(LegacyCurve *cu)
{
return (CurveBatchCache *)cu->batch_cache;
}
-void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode)
+void DRW_curve_batch_cache_dirty_tag(LegacyCurve *cu, int mode)
{
CurveBatchCache *cache = (CurveBatchCache *)cu->batch_cache;
if (cache == nullptr) {
@@ -507,7 +507,7 @@ void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode)
}
}
-static void curve_batch_cache_clear(Curve *cu)
+static void curve_batch_cache_clear(LegacyCurve *cu)
{
CurveBatchCache *cache = (CurveBatchCache *)cu->batch_cache;
if (!cache) {
@@ -541,7 +541,7 @@ static void curve_batch_cache_clear(Curve *cu)
cache->cd_used = 0;
}
-void DRW_curve_batch_cache_free(Curve *cu)
+void DRW_curve_batch_cache_free(LegacyCurve *cu)
{
curve_batch_cache_clear(cu);
MEM_SAFE_FREE(cu->batch_cache);
@@ -875,37 +875,37 @@ static void curve_create_edit_data_and_handles(CurveRenderData *rdata,
/** \name Public Object/Curve API
* \{ */
-GPUBatch *DRW_curve_batch_cache_get_wire_edge(Curve *cu)
+GPUBatch *DRW_curve_batch_cache_get_wire_edge(LegacyCurve *cu)
{
CurveBatchCache *cache = curve_batch_cache_get(cu);
return DRW_batch_request(&cache->batch.curves);
}
-GPUBatch *DRW_curve_batch_cache_get_normal_edge(Curve *cu)
+GPUBatch *DRW_curve_batch_cache_get_normal_edge(LegacyCurve *cu)
{
CurveBatchCache *cache = curve_batch_cache_get(cu);
return DRW_batch_request(&cache->batch.edit_normals);
}
-GPUBatch *DRW_curve_batch_cache_get_edit_edges(Curve *cu)
+GPUBatch *DRW_curve_batch_cache_get_edit_edges(LegacyCurve *cu)
{
CurveBatchCache *cache = curve_batch_cache_get(cu);
return DRW_batch_request(&cache->batch.edit_edges);
}
-GPUBatch *DRW_curve_batch_cache_get_edit_verts(Curve *cu)
+GPUBatch *DRW_curve_batch_cache_get_edit_verts(LegacyCurve *cu)
{
CurveBatchCache *cache = curve_batch_cache_get(cu);
return DRW_batch_request(&cache->batch.edit_verts);
}
-GPUBatch *DRW_curve_batch_cache_get_triangles_with_normals(struct Curve *cu)
+GPUBatch *DRW_curve_batch_cache_get_triangles_with_normals(struct LegacyCurve *cu)
{
CurveBatchCache *cache = curve_batch_cache_get(cu);
return DRW_batch_request(&cache->batch.surfaces);
}
-GPUBatch **DRW_curve_batch_cache_get_surface_shaded(struct Curve *cu,
+GPUBatch **DRW_curve_batch_cache_get_surface_shaded(struct LegacyCurve *cu,
struct GPUMaterial **gpumat_array,
uint gpumat_array_len)
{
@@ -921,7 +921,7 @@ GPUBatch **DRW_curve_batch_cache_get_surface_shaded(struct Curve *cu,
return cache->surf_per_mat;
}
-GPUVertBuf *DRW_curve_batch_cache_pos_vertbuf_get(struct Curve *cu)
+GPUVertBuf *DRW_curve_batch_cache_pos_vertbuf_get(struct LegacyCurve *cu)
{
CurveBatchCache *cache = curve_batch_cache_get(cu);
/* Request surface to trigger the vbo filling. Otherwise it may do nothing. */
@@ -931,13 +931,13 @@ GPUVertBuf *DRW_curve_batch_cache_pos_vertbuf_get(struct Curve *cu)
return cache->ordered.loop_pos_nor;
}
-GPUBatch *DRW_curve_batch_cache_get_wireframes_face(Curve *cu)
+GPUBatch *DRW_curve_batch_cache_get_wireframes_face(LegacyCurve *cu)
{
CurveBatchCache *cache = curve_batch_cache_get(cu);
return DRW_batch_request(&cache->batch.surfaces_edges);
}
-GPUBatch *DRW_curve_batch_cache_get_edge_detection(Curve *cu, bool *r_is_manifold)
+GPUBatch *DRW_curve_batch_cache_get_edge_detection(LegacyCurve *cu, bool *r_is_manifold)
{
CurveBatchCache *cache = curve_batch_cache_get(cu);
/* Even if is_manifold is not correct (not updated),
@@ -948,7 +948,7 @@ GPUBatch *DRW_curve_batch_cache_get_edge_detection(Curve *cu, bool *r_is_manifol
return DRW_batch_request(&cache->batch.edge_detection);
}
-int DRW_curve_material_count_get(Curve *cu)
+int DRW_curve_material_count_get(LegacyCurve *cu)
{
return max_ii(1, cu->totcol);
}
@@ -963,7 +963,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob, const struct Scene *scen
{
BLI_assert(ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT));
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
CurveBatchCache *cache = curve_batch_cache_get(cu);
/* Verify that all surface batches have needed attribute layers. */
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index e71a1298812..dda3a64da59 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -477,7 +477,7 @@ static void drw_call_calc_orco(Object *ob, float (*r_orcofacs)[4])
BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, &texcosize);
break;
case ID_CU: {
- Curve *cu = (Curve *)ob_data;
+ LegacyCurve *cu = (LegacyCurve *)ob_data;
BKE_curve_texspace_ensure(cu);
texcoloc = cu->loc;
texcosize = cu->size;
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 2eaa42ee578..70a9322145d 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -1898,7 +1898,7 @@ static bAnimChannelType ACF_DSCAM = {
/* TODO: just get this from RNA? */
static int acf_dscur_icon(bAnimListElem *ale)
{
- Curve *cu = (Curve *)ale->data;
+ LegacyCurve *cu = (LegacyCurve *)ale->data;
short obtype = BKE_curve_type_get(cu);
switch (obtype) {
@@ -1941,7 +1941,7 @@ static int acf_dscur_setting_flag(bAnimContext *UNUSED(ac),
/* get pointer to the setting */
static void *acf_dscur_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
{
- Curve *cu = (Curve *)ale->data;
+ LegacyCurve *cu = (LegacyCurve *)ale->data;
/* clear extra return data first */
*type = 0;
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index c1a09b9d21f..8ddcf0cf3e1 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -731,7 +731,7 @@ static bAnimListElem *make_new_animlistelem(void *data,
break;
}
case ANIMTYPE_DSCUR: {
- Curve *cu = (Curve *)data;
+ LegacyCurve *cu = (LegacyCurve *)data;
AnimData *adt = cu->adt;
ale->flag = FILTER_CUR_OBJD(cu);
@@ -2550,7 +2550,7 @@ static size_t animdata_filter_ds_obdata(
case OB_SURF: /* ------- Nurbs Surface ---------- */
case OB_FONT: /* ------- Text Curve ---------- */
{
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
if (ads->filterflag & ADS_FILTER_NOCUR) {
return 0;
diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h
index 03ddeebde42..dd76d31dc72 100644
--- a/source/blender/editors/curve/curve_intern.h
+++ b/source/blender/editors/curve/curve_intern.h
@@ -205,7 +205,7 @@ bool ED_curve_pick_vert(struct ViewContext *vc,
short *r_handle,
struct Base **r_base);
void ED_curve_nurb_vert_selected_find(
- Curve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp);
+ LegacyCurve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp);
/* editcurve_paint.c */
void CURVE_OT_draw(struct wmOperatorType *ot);
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index a034e4bb10e..fb658c44784 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -89,7 +89,7 @@ static bool curve_delete_vertices(Object *obedit, View3D *v3d);
ListBase *object_editcurve_get(Object *ob)
{
if (ob && ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
return &cu->editnurb->nurbs;
}
return NULL;
@@ -470,7 +470,7 @@ static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
}
}
-static void switch_keys_direction(Curve *cu, Nurb *actnu)
+static void switch_keys_direction(LegacyCurve *cu, Nurb *actnu)
{
EditNurb *editnurb = cu->editnurb;
ListBase *nubase = &editnurb->nurbs;
@@ -518,7 +518,7 @@ static void switch_keys_direction(Curve *cu, Nurb *actnu)
}
}
-static void keyData_switchDirectionNurb(Curve *cu, Nurb *nu)
+static void keyData_switchDirectionNurb(LegacyCurve *cu, Nurb *nu)
{
EditNurb *editnurb = cu->editnurb;
@@ -640,7 +640,7 @@ static void calc_keyHandles(ListBase *nurb, float *key)
static void calc_shapeKeys(Object *obedit, ListBase *newnurbs)
{
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
if (cu->key == NULL) {
return;
@@ -892,7 +892,7 @@ static void calc_shapeKeys(Object *obedit, ListBase *newnurbs)
/** \name Animation Data
* \{ */
-static bool curve_is_animated(Curve *cu)
+static bool curve_is_animated(LegacyCurve *cu)
{
AnimData *ad = BKE_animdata_from_id(&cu->id);
@@ -950,7 +950,7 @@ static void fcurve_remove(AnimData *adt, ListBase *orig_curves, FCurve *fcu)
BKE_fcurve_free(fcu);
}
-static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves)
+static void curve_rename_fcurves(LegacyCurve *cu, ListBase *orig_curves)
{
int a, pt_index;
EditNurb *editnurb = cu->editnurb;
@@ -1074,7 +1074,7 @@ static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves)
}
}
-int ED_curve_updateAnimPaths(Main *bmain, Curve *cu)
+int ED_curve_updateAnimPaths(Main *bmain, LegacyCurve *cu)
{
AnimData *adt = BKE_animdata_from_id(&cu->id);
EditNurb *editnurb = cu->editnurb;
@@ -1109,7 +1109,7 @@ int ED_curve_updateAnimPaths(Main *bmain, Curve *cu)
static int *init_index_map(Object *obedit, int *r_old_totvert)
{
- Curve *curve = (Curve *)obedit->data;
+ LegacyCurve *curve = (LegacyCurve *)obedit->data;
EditNurb *editnurb = curve->editnurb;
CVKeyIndex *keyIndex;
int *old_to_new_map;
@@ -1174,7 +1174,7 @@ static int *init_index_map(Object *obedit, int *r_old_totvert)
static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit)
{
- Curve *curve = (Curve *)obedit->data;
+ LegacyCurve *curve = (LegacyCurve *)obedit->data;
EditNurb *editnurb = curve->editnurb;
int *old_to_new_map = NULL;
int old_totvert;
@@ -1255,7 +1255,7 @@ void ED_curve_editnurb_load(Main *bmain, Object *obedit)
}
if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
ListBase newnurb = {NULL, NULL}, oldnurb = cu->nurb;
remap_hooks_and_vertex_parents(bmain, obedit);
@@ -1285,7 +1285,7 @@ void ED_curve_editnurb_load(Main *bmain, Object *obedit)
void ED_curve_editnurb_make(Object *obedit)
{
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
EditNurb *editnurb = cu->editnurb;
KeyBlock *actkey;
@@ -1330,7 +1330,7 @@ void ED_curve_editnurb_make(Object *obedit)
void ED_curve_editnurb_free(Object *obedit)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
BKE_curve_editNurb_free(cu);
}
@@ -1364,7 +1364,7 @@ static int separate_exec(bContext *C, wmOperator *op)
Base *oldbase = bases[b_index];
Base *newbase;
Object *oldob, *newob;
- Curve *oldcu, *newcu;
+ LegacyCurve *oldcu, *newcu;
EditNurb *newedit;
ListBase newnurb = {NULL, NULL};
@@ -1493,7 +1493,7 @@ static int curve_split_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -1758,7 +1758,7 @@ static void weightflagNurb(ListBase *editnurb, short flag, float w)
static void ed_surf_delete_selected(Object *obedit)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
ListBase *editnurb = object_editcurve_get(obedit);
BPoint *bp, *bpn, *newbp;
int a, b, newu, newv;
@@ -1853,7 +1853,7 @@ static void ed_surf_delete_selected(Object *obedit)
static void ed_curve_delete_selected(Object *obedit, View3D *v3d)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
ListBase *nubase = &editnurb->nurbs;
BezTriple *bezt, *bezt1;
@@ -2104,13 +2104,19 @@ bool ed_editnurb_extrude_flag(EditNurb *editnurb, const uint8_t flag)
return ok;
}
-static void calc_duplicate_actnurb(const ListBase *editnurb, const ListBase *newnurb, Curve *cu)
+static void calc_duplicate_actnurb(const ListBase *editnurb,
+ const ListBase *newnurb,
+ LegacyCurve *cu)
{
cu->actnu = BLI_listbase_count(editnurb) + BLI_listbase_count(newnurb);
}
-static bool calc_duplicate_actvert(
- const ListBase *editnurb, const ListBase *newnurb, Curve *cu, int start, int end, int vert)
+static bool calc_duplicate_actvert(const ListBase *editnurb,
+ const ListBase *newnurb,
+ LegacyCurve *cu,
+ int start,
+ int end,
+ int vert)
{
if (cu->actvert == -1) {
calc_duplicate_actnurb(editnurb, newnurb, cu);
@@ -2132,7 +2138,7 @@ static void adduplicateflagNurb(
Nurb *newnu;
BezTriple *bezt, *bezt1;
BPoint *bp, *bp1, *bp2, *bp3;
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
int a, b, c, starta, enda, diffa, cyclicu, cyclicv, newu, newv;
char *usel;
@@ -2545,7 +2551,7 @@ static int switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -3210,7 +3216,7 @@ static int hide_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!(invert || ED_curve_select_check(v3d, cu->editnurb))) {
continue;
@@ -3386,7 +3392,7 @@ void CURVE_OT_reveal(wmOperatorType *ot)
*/
static void subdividenurb(Object *obedit, View3D *v3d, int number_cuts)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
BezTriple *bezt, *beztnew, *beztn;
BPoint *bp, *prevbp, *bpnew, *bpn;
@@ -3789,7 +3795,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -3880,7 +3886,7 @@ static int set_spline_type_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
if (changed_size) {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
cu->actvert = CU_ACT_NONE;
}
@@ -3941,7 +3947,7 @@ static int set_handle_type_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -4004,7 +4010,7 @@ static int curve_normals_make_consistent_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -4209,7 +4215,7 @@ enum {
CURVE_MERGE_ERR_RESOLUTION_SOME,
};
-static bool merge_2_nurb(Curve *cu, ListBase *editnurb, Nurb *nu1, Nurb *nu2)
+static bool merge_2_nurb(LegacyCurve *cu, ListBase *editnurb, Nurb *nu1, Nurb *nu2)
{
BPoint *bp, *bp1, *bp2, *temp;
float len1, len2;
@@ -4370,7 +4376,7 @@ static bool merge_2_nurb(Curve *cu, ListBase *editnurb, Nurb *nu1, Nurb *nu2)
static int merge_nurb(View3D *v3d, Object *obedit)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
ListBase *editnurb = object_editcurve_get(obedit);
NurbSort *nus1, *nus2;
bool ok = true;
@@ -4450,7 +4456,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
status.unselected++;
@@ -4755,7 +4761,7 @@ bool ED_curve_editnurb_select_pick(
if (ED_curve_pick_vert(&vc, 1, &nu, &bezt, &bp, &hand, &basact)) {
Object *obedit = basact->object;
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
ListBase *editnurb = object_editcurve_get(obedit);
const void *vert = BKE_curve_vert_active_get(cu);
@@ -4766,7 +4772,7 @@ bool ED_curve_editnurb_select_pick(
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *ob_iter = objects[ob_index];
- ED_curve_deselect_all(((Curve *)ob_iter->data)->editnurb);
+ ED_curve_deselect_all(((LegacyCurve *)ob_iter->data)->editnurb);
DEG_id_tag_update(ob_iter->data, ID_RECALC_SELECT | ID_RECALC_COPY_ON_WRITE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob_iter->data);
@@ -4901,7 +4907,7 @@ bool ED_curve_editnurb_select_pick(
bool ed_editnurb_spin(
float viewmat[4][4], View3D *v3d, Object *obedit, const float axis[3], const float cent[3])
{
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
ListBase *editnurb = object_editcurve_get(obedit);
float cmat[3][3], tmat[3][3], imat[3][3];
float bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3];
@@ -4998,7 +5004,7 @@ static int spin_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -5079,7 +5085,7 @@ void CURVE_OT_spin(wmOperatorType *ot)
/** \name Extrude Vertex Operator
* \{ */
-static bool ed_editcurve_extrude(Curve *cu, EditNurb *editnurb, View3D *v3d)
+static bool ed_editcurve_extrude(LegacyCurve *cu, EditNurb *editnurb, View3D *v3d)
{
bool changed = false;
@@ -5328,7 +5334,7 @@ static bool ed_editcurve_extrude(Curve *cu, EditNurb *editnurb, View3D *v3d)
/** \name Add Vertex Operator
* \{ */
-static int ed_editcurve_addvert(Curve *cu,
+static int ed_editcurve_addvert(LegacyCurve *cu,
EditNurb *editnurb,
View3D *v3d,
const float location_init[3])
@@ -5476,7 +5482,7 @@ static int add_vertex_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *obedit = CTX_data_edit_object(C);
View3D *v3d = CTX_wm_view3d(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
float location[3];
float imat[4][4];
@@ -5509,7 +5515,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event)
ED_view3d_viewcontext_init(C, &vc, depsgraph);
if (vc.rv3d && !RNA_struct_property_is_set(op->ptr, "location")) {
- Curve *cu;
+ LegacyCurve *cu;
float location[3];
const bool use_proj = ((vc.scene->toolsettings->snap_flag & SCE_SNAP) &&
(vc.scene->toolsettings->snap_mode == SCE_SNAP_MODE_FACE));
@@ -5640,7 +5646,7 @@ static int curve_extrude_exec(bContext *C, wmOperator *UNUSED(op))
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
bool changed = false;
bool as_curve = false;
@@ -5793,7 +5799,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -5882,7 +5888,7 @@ static int duplicate_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -5945,7 +5951,7 @@ static bool curve_delete_vertices(Object *obedit, View3D *v3d)
static bool curve_delete_segments(Object *obedit, View3D *v3d, const bool split)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
ListBase *nubase = &editnurb->nurbs, newnurb = {NULL, NULL};
Nurb *nu1;
@@ -6385,7 +6391,7 @@ static int curve_delete_exec(bContext *C, wmOperator *op)
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
bool changed = false;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
@@ -6497,7 +6503,7 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op))
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -6643,7 +6649,7 @@ static int curve_decimate_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
bool all_supported = true;
bool changed = false;
@@ -6794,7 +6800,7 @@ int ED_curve_join_objects_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
Object *ob_active = CTX_data_active_object(C);
- Curve *cu;
+ LegacyCurve *cu;
BezTriple *bezt;
BPoint *bp;
ListBase tempbase;
@@ -6822,7 +6828,7 @@ int ED_curve_join_objects_exec(bContext *C, wmOperator *op)
* See #object_join_exec for detailed comment on why the safe version is used. */
invert_m4_m4_safe_ortho(imat, ob_active->obmat);
- Curve *cu_active = ob_active->data;
+ LegacyCurve *cu_active = ob_active->data;
CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) {
if (ob_iter->type == ob_active->type) {
@@ -6919,7 +6925,7 @@ static int clear_tilt_exec(bContext *C, wmOperator *UNUSED(op))
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -7009,7 +7015,7 @@ static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op))
Object *object = CTX_data_active_object(C);
Object *object_eval = DEG_get_evaluated_object(depsgraph, object);
- Curve *curve = (Curve *)object->data;
+ LegacyCurve *curve = (LegacyCurve *)object->data;
float min[3], max[3], size[3], loc[3];
int a;
diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c
index 614805a70f5..e92e98a152b 100644
--- a/source/blender/editors/curve/editcurve_add.c
+++ b/source/blender/editors/curve/editcurve_add.c
@@ -121,7 +121,7 @@ Nurb *ED_curve_add_nurbs_primitive(
Nurb *nu = NULL;
BezTriple *bezt;
BPoint *bp;
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
float vec[3], zvec[3] = {0.0f, 0.0f, 1.0f};
float umat[4][4], viewmat[4][4];
float fac;
@@ -528,12 +528,12 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
if (!isSurf) { /* adding curve */
if (obedit == NULL || obedit->type != OB_CURVE) {
const char *name = get_curve_defname(type);
- Curve *cu;
+ LegacyCurve *cu;
obedit = ED_object_add_type(C, OB_CURVE, name, loc, rot, true, local_view_bits);
newob = true;
- cu = (Curve *)obedit->data;
+ cu = (LegacyCurve *)obedit->data;
if (type & CU_PRIM_PATH) {
cu->flag |= CU_PATH | CU_3D;
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index 403ace56e3b..6900bb2ec6d 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -143,7 +143,7 @@ struct CurveDrawData {
static float stroke_elem_radius_from_pressure(const struct CurveDrawData *cdd,
const float pressure)
{
- const Curve *cu = cdd->vc.obedit->data;
+ const LegacyCurve *cu = cdd->vc.obedit->data;
return ((pressure * cdd->radius.range) + cdd->radius.min) * cu->bevel_radius;
}
@@ -362,7 +362,7 @@ static void curve_draw_stroke_3d(const struct bContext *UNUSED(C),
}
Object *obedit = cdd->vc.obedit;
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (cu->bevel_radius > 0.0f) {
BLI_mempool_iter iter;
@@ -757,7 +757,7 @@ static int curve_draw_exec(bContext *C, wmOperator *op)
const CurvePaintSettings *cps = &cdd->vc.scene->toolsettings->curve_paint_settings;
Object *obedit = cdd->vc.obedit;
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
ListBase *nurblist = object_editcurve_get(obedit);
int stroke_len = BLI_mempool_len(cdd->stroke_elem_pool);
@@ -1071,7 +1071,7 @@ static int curve_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event)
View3D *v3d = cdd->vc.v3d;
RegionView3D *rv3d = cdd->vc.rv3d;
Object *obedit = cdd->vc.obedit;
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
const float *plane_no = NULL;
const float *plane_co = NULL;
diff --git a/source/blender/editors/curve/editcurve_query.c b/source/blender/editors/curve/editcurve_query.c
index a8fd3ea2803..5c03f5833cc 100644
--- a/source/blender/editors/curve/editcurve_query.c
+++ b/source/blender/editors/curve/editcurve_query.c
@@ -166,7 +166,7 @@ bool ED_curve_pick_vert(ViewContext *vc,
* \{ */
void ED_curve_nurb_vert_selected_find(
- Curve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp)
+ LegacyCurve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp)
{
/* In nu and (bezt or bp) selected are written if there's 1 sel. */
/* If more points selected in 1 spline: return only nu, bezt and bp are 0. */
@@ -231,7 +231,7 @@ void ED_curve_nurb_vert_selected_find(
}
}
-bool ED_curve_active_center(Curve *cu, float center[3])
+bool ED_curve_active_center(LegacyCurve *cu, float center[3])
{
Nurb *nu = NULL;
void *vert = NULL;
diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c
index 1229b7eacc8..f3ec2b7840a 100644
--- a/source/blender/editors/curve/editcurve_select.c
+++ b/source/blender/editors/curve/editcurve_select.c
@@ -262,7 +262,7 @@ bool ED_curve_deselect_all_multi_ex(Base **bases, int bases_len)
bool changed_multi = false;
for (uint base_index = 0; base_index < bases_len; base_index++) {
Object *obedit = bases[base_index]->object;
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
changed_multi |= ED_curve_deselect_all(cu->editnurb);
DEG_id_tag_update(&cu->id, ID_RECALC_SELECT);
}
@@ -418,14 +418,14 @@ static void selectend_nurb(Object *obedit, eEndPoint_Types selfirst, bool doswap
ListBase *editnurb = object_editcurve_get(obedit);
BPoint *bp;
BezTriple *bezt;
- Curve *cu;
+ LegacyCurve *cu;
int a;
if (obedit == NULL) {
return;
}
- cu = (Curve *)obedit->data;
+ cu = (LegacyCurve *)obedit->data;
cu->actvert = CU_ACT_NONE;
LISTBASE_FOREACH (Nurb *, nu, editnurb) {
@@ -570,7 +570,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
action = SEL_SELECT;
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (ED_curve_select_check(v3d, cu->editnurb)) {
action = SEL_DESELECT;
@@ -581,7 +581,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
bool changed = false;
switch (action) {
@@ -642,7 +642,7 @@ static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
ListBase *nurbs = &editnurb->nurbs;
bool changed = false;
@@ -771,7 +771,7 @@ void CURVE_OT_select_linked_pick(wmOperatorType *ot)
static int select_row_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
ListBase *editnurb = object_editcurve_get(obedit);
static BPoint *last = NULL;
static int direction = 0;
@@ -1411,7 +1411,7 @@ static void select_nth_bp(Nurb *nu, BPoint *bp, const struct CheckerIntervalPara
}
}
-static bool ed_curve_select_nth(Curve *cu, const struct CheckerIntervalParams *params)
+static bool ed_curve_select_nth(LegacyCurve *cu, const struct CheckerIntervalParams *params)
{
Nurb *nu = NULL;
void *vert = NULL;
@@ -1445,7 +1445,7 @@ static int select_nth_exec(bContext *C, wmOperator *op)
view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (!ED_curve_select_check(v3d, cu->editnurb)) {
continue;
@@ -1731,7 +1731,7 @@ static int curve_select_similar_exec(bContext *C, wmOperator *op)
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
tot_nurbs_selected_all += ED_curve_select_count(v3d, cu->editnurb);
}
@@ -1758,7 +1758,7 @@ static int curve_select_similar_exec(bContext *C, wmOperator *op)
/* Get type of selected control points. */
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
@@ -1791,7 +1791,7 @@ static int curve_select_similar_exec(bContext *C, wmOperator *op)
/* Select control points with desired type. */
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditNurb *editnurb = cu->editnurb;
bool changed = false;
@@ -2028,7 +2028,7 @@ static int edcu_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE
ED_view3d_viewcontext_init_object(&vc, basact->object);
Object *obedit = basact->object;
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
Nurb *nu_src = BKE_curve_nurb_active_get(cu);
int vert_src = cu->actvert;
diff --git a/source/blender/editors/curve/editcurve_undo.c b/source/blender/editors/curve/editcurve_undo.c
index 5619e2efc36..0e1ffa0ca9e 100644
--- a/source/blender/editors/curve/editcurve_undo.c
+++ b/source/blender/editors/curve/editcurve_undo.c
@@ -72,7 +72,7 @@ typedef struct {
size_t undo_size;
} UndoCurve;
-static void undocurve_to_editcurve(Main *bmain, UndoCurve *ucu, Curve *cu, short *r_shapenr)
+static void undocurve_to_editcurve(Main *bmain, UndoCurve *ucu, LegacyCurve *cu, short *r_shapenr)
{
ListBase *undobase = &ucu->nubase;
ListBase *editbase = BKE_curve_editNurbs_get(cu);
@@ -115,7 +115,7 @@ static void undocurve_to_editcurve(Main *bmain, UndoCurve *ucu, Curve *cu, short
ED_curve_updateAnimPaths(bmain, cu);
}
-static void undocurve_from_editcurve(UndoCurve *ucu, Curve *cu, const short shapenr)
+static void undocurve_from_editcurve(UndoCurve *ucu, LegacyCurve *cu, const short shapenr)
{
BLI_assert(BLI_array_is_zeroed(ucu, 1));
ListBase *nubase = BKE_curve_editNurbs_get(cu);
@@ -177,7 +177,7 @@ static Object *editcurve_object_from_context(bContext *C)
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
if (obedit && ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (BKE_curve_editNurbs_get(cu) != NULL) {
return obedit;
}
@@ -225,7 +225,7 @@ static bool curve_undosys_step_encode(struct bContext *C, struct Main *bmain, Un
for (uint i = 0; i < objects_len; i++) {
Object *ob = objects[i];
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
CurveUndoStep_Elem *elem = &us->elems[i];
elem->obedit_ref.ptr = ob;
@@ -256,7 +256,7 @@ static void curve_undosys_step_decode(struct bContext *C,
for (uint i = 0; i < us->elems_len; i++) {
CurveUndoStep_Elem *elem = &us->elems[i];
Object *obedit = elem->obedit_ref.ptr;
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (cu->editnurb == NULL) {
/* Should never fail, may not crash but can give odd behavior. */
CLOG_ERROR(&LOG,
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 6e0aeb87318..d6c04c67cb1 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -377,7 +377,7 @@ static char32_t findaccent(char32_t char1, uint code)
static int insert_into_textbuf(Object *obedit, uintptr_t c)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
if (ef->len < MAXTEXT - 1) {
@@ -405,7 +405,7 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c)
static void text_update_edited(bContext *C, Object *obedit, int mode)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
BLI_assert(ef->len >= 0);
@@ -440,7 +440,7 @@ static void text_update_edited(bContext *C, Object *obedit, int mode)
static int kill_selection(Object *obedit, int ins) /* ins == new character len */
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
int selend, selstart, direction;
int getfrom;
@@ -479,7 +479,7 @@ static bool font_paste_wchar(Object *obedit,
/* optional */
struct CharInfo *str_info)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
int selend, selstart;
@@ -633,7 +633,7 @@ static void txt_add_object(bContext *C,
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
- Curve *cu;
+ LegacyCurve *cu;
Object *obedit;
Base *base;
const struct TextLine *tmp;
@@ -764,7 +764,7 @@ static const EnumPropertyItem style_items[] = {
static int set_style(bContext *C, const int style, const bool clear)
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
int i, selstart, selend;
@@ -824,7 +824,7 @@ void FONT_OT_style_set(wmOperatorType *ot)
static int toggle_style_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
int style, clear, selstart, selend;
if (!BKE_vfont_select_get(obedit, &selstart, &selend)) {
@@ -867,7 +867,7 @@ void FONT_OT_style_toggle(wmOperatorType *ot)
static int font_select_all_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
if (ef->len) {
@@ -908,7 +908,7 @@ static void copy_selection(Object *obedit)
int selstart, selend;
if (BKE_vfont_select_get(obedit, &selstart, &selend)) {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
char *buf = NULL;
char32_t *text_buf;
@@ -1115,7 +1115,7 @@ static int move_cursor(bContext *C, int type, const bool select)
{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
int cursmove = -1;
@@ -1306,7 +1306,7 @@ void FONT_OT_move_select(wmOperatorType *ot)
static int change_spacing_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
int kern, delta = RNA_int_get(op->ptr, "delta");
int selstart, selend;
@@ -1374,7 +1374,7 @@ void FONT_OT_change_spacing(wmOperatorType *ot)
static int change_character_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
int character, delta = RNA_int_get(op->ptr, "delta");
@@ -1432,7 +1432,7 @@ void FONT_OT_change_character(wmOperatorType *ot)
static int line_break_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
insert_into_textbuf(obedit, '\n');
@@ -1479,7 +1479,7 @@ static const EnumPropertyItem delete_type_items[] = {
static int delete_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
int selstart, selend, type = RNA_enum_get(op->ptr, "type");
int range[2] = {0, 0};
@@ -1652,7 +1652,7 @@ static int insert_text_exec(bContext *C, wmOperator *op)
static int insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
static int accentcode = 0;
uintptr_t ascii = event->ascii;
@@ -1776,7 +1776,7 @@ void FONT_OT_text_insert(wmOperatorType *ot)
static int textbox_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_active_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
int i;
if (cu->totbox < 256) {
@@ -1817,7 +1817,7 @@ void FONT_OT_textbox_add(wmOperatorType *ot)
static int textbox_remove_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_active_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
int i;
int index = RNA_int_get(op->ptr, "index");
@@ -1862,7 +1862,7 @@ void FONT_OT_textbox_remove(wmOperatorType *ot)
void ED_curve_editfont_make(Object *obedit)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
int len_char32;
@@ -1898,7 +1898,7 @@ void ED_curve_editfont_make(Object *obedit)
void ED_curve_editfont_load(Object *obedit)
{
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
/* Free the old curve string */
@@ -1928,7 +1928,7 @@ void ED_curve_editfont_load(Object *obedit)
void ED_curve_editfont_free(Object *obedit)
{
- BKE_curve_editfont_free((Curve *)obedit->data);
+ BKE_curve_editfont_free((LegacyCurve *)obedit->data);
}
/** \} */
@@ -1946,7 +1946,7 @@ static const EnumPropertyItem case_items[] = {
static int set_case(bContext *C, int ccase)
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
char32_t *str;
int len;
@@ -2013,7 +2013,7 @@ void FONT_OT_case_set(wmOperatorType *ot)
static int toggle_case_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
char32_t *str;
int ccase = CASE_UPPER;
@@ -2202,7 +2202,7 @@ bool ED_curve_editfont_select_pick(
{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obedit = CTX_data_edit_object(C);
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
ViewContext vc;
/* bias against the active, in pixels, allows cycling */
const float active_bias_px = 4.0f;
diff --git a/source/blender/editors/curve/editfont_undo.c b/source/blender/editors/curve/editfont_undo.c
index 45448f18675..5731ecaa71c 100644
--- a/source/blender/editors/curve/editfont_undo.c
+++ b/source/blender/editors/curve/editfont_undo.c
@@ -230,7 +230,7 @@ static void uf_arraystore_free(UndoFont *uf)
#endif /* USE_ARRAY_STORE */
-static void undofont_to_editfont(UndoFont *uf, Curve *cu)
+static void undofont_to_editfont(UndoFont *uf, LegacyCurve *cu)
{
EditFont *ef = cu->editfont;
@@ -256,7 +256,7 @@ static void undofont_to_editfont(UndoFont *uf, Curve *cu)
#endif
}
-static void *undofont_from_editfont(UndoFont *uf, Curve *cu)
+static void *undofont_from_editfont(UndoFont *uf, LegacyCurve *cu)
{
BLI_assert(BLI_array_is_zeroed(uf, 1));
@@ -324,7 +324,7 @@ static Object *editfont_object_from_context(bContext *C)
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
if (obedit && obedit->type == OB_FONT) {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
EditFont *ef = cu->editfont;
if (ef != NULL) {
return obedit;
@@ -355,7 +355,7 @@ static bool font_undosys_step_encode(struct bContext *C, struct Main *bmain, Und
{
FontUndoStep *us = (FontUndoStep *)us_p;
us->obedit_ref.ptr = editfont_object_from_context(C);
- Curve *cu = us->obedit_ref.ptr->data;
+ LegacyCurve *cu = us->obedit_ref.ptr->data;
undofont_from_editfont(&us->data, cu);
us->step.data_size = us->data.undo_size;
cu->editfont->needs_flush_to_id = 1;
@@ -377,7 +377,7 @@ static void font_undosys_step_decode(struct bContext *C,
/* Pass in an array of 1 (typically used for multi-object edit-mode). */
ED_undo_object_editmode_restore_helper(C, &obedit, 1, sizeof(Object *));
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
undofont_to_editfont(&us->data, cu);
DEG_id_tag_update(&cu->id, ID_RECALC_GEOMETRY);
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c
index bf414851aed..36266e6c9ef 100644
--- a/source/blender/editors/gpencil/gpencil_convert.c
+++ b/source/blender/editors/gpencil/gpencil_convert.c
@@ -399,7 +399,7 @@ static void gpencil_stroke_path_animation_add_keyframes(ReportList *reports,
PropertyRNA *prop,
Depsgraph *depsgraph,
FCurve *fcu,
- Curve *cu,
+ LegacyCurve *cu,
tGpTimingData *gtd,
RNG *rng,
const float time_range,
@@ -508,7 +508,7 @@ static void gpencil_stroke_path_animation_add_keyframes(ReportList *reports,
static void gpencil_stroke_path_animation(bContext *C,
ReportList *reports,
- Curve *cu,
+ LegacyCurve *cu,
tGpTimingData *gtd)
{
Main *bmain = CTX_data_main(C);
@@ -656,7 +656,7 @@ static void gpencil_stroke_to_path_add_point(tGpTimingData *gtd,
static void gpencil_stroke_to_path(bContext *C,
bGPDlayer *gpl,
bGPDstroke *gps,
- Curve *cu,
+ LegacyCurve *cu,
rctf *subrect,
Nurb **curnu,
float minmax_weights[2],
@@ -904,7 +904,7 @@ static void gpencil_stroke_to_bezier_add_point(tGpTimingData *gtd,
static void gpencil_stroke_to_bezier(bContext *C,
bGPDlayer *gpl,
bGPDstroke *gps,
- Curve *cu,
+ LegacyCurve *cu,
rctf *subrect,
Nurb **curnu,
float minmax_weights[2],
@@ -1186,7 +1186,7 @@ static void gpencil_stroke_to_bezier(bContext *C,
#undef WIDTH_CORR_FAC
#undef BEZT_HANDLE_FAC
-static void gpencil_stroke_finalize_curve_endpoints(Curve *cu)
+static void gpencil_stroke_finalize_curve_endpoints(LegacyCurve *cu)
{
/* start */
Nurb *nu = cu->nurb.first;
@@ -1221,7 +1221,7 @@ static void gpencil_stroke_finalize_curve_endpoints(Curve *cu)
}
}
-static void gpencil_stroke_norm_curve_weights(Curve *cu, const float minmax_weights[2])
+static void gpencil_stroke_norm_curve_weights(LegacyCurve *cu, const float minmax_weights[2])
{
const float delta = minmax_weights[0];
@@ -1290,7 +1290,7 @@ static void gpencil_layer_to_curve(bContext *C,
bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV);
bGPDstroke *prev_gps = NULL;
Object *ob;
- Curve *cu;
+ LegacyCurve *cu;
Nurb *nu = NULL;
Base *base_new = NULL;
float minmax_weights[2] = {1.0f, 0.0f};
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 3294316f880..93481abef4e 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -370,7 +370,7 @@ typedef enum eAnimFilter_Flags {
#define FILTER_CAM_OBJD(ca) (CHECK_TYPE_INLINE(ca, Camera *), ((ca->flag & CAM_DS_EXPAND)))
#define FILTER_CACHEFILE_OBJD(cf) \
(CHECK_TYPE_INLINE(cf, CacheFile *), (((cf)->flag & CACHEFILE_DS_EXPAND)))
-#define FILTER_CUR_OBJD(cu) (CHECK_TYPE_INLINE(cu, Curve *), ((cu->flag & CU_DS_EXPAND)))
+#define FILTER_CUR_OBJD(cu) (CHECK_TYPE_INLINE(cu, LegacyCurve *), ((cu->flag & CU_DS_EXPAND)))
#define FILTER_PART_OBJD(part) \
(CHECK_TYPE_INLINE(part, ParticleSettings *), (((part)->flag & PART_DS_EXPAND)))
#define FILTER_MBALL_OBJD(mb) (CHECK_TYPE_INLINE(mb, MetaBall *), ((mb->flag2 & MB_DS_EXPAND)))
diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h
index 805d42b6fbc..7a266516b56 100644
--- a/source/blender/editors/include/ED_curve.h
+++ b/source/blender/editors/include/ED_curve.h
@@ -30,7 +30,7 @@ extern "C" {
struct BPoint;
struct Base;
struct BezTriple;
-struct Curve;
+struct LegacyCurve;
struct EditNurb;
struct Main;
struct Nurb;
@@ -111,9 +111,9 @@ void ED_curve_bpcpy(struct EditNurb *editnurb, struct BPoint *dst, struct BPoint
/**
* Return 0 if animation data wasn't changed, 1 otherwise.
*/
-int ED_curve_updateAnimPaths(struct Main *bmain, struct Curve *cu);
+int ED_curve_updateAnimPaths(struct Main *bmain, struct LegacyCurve *cu);
-bool ED_curve_active_center(struct Curve *cu, float center[3]);
+bool ED_curve_active_center(struct LegacyCurve *cu, float center[3]);
/**
* TextBox selection
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 9354171a1e4..f757daac88f 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -855,7 +855,7 @@ static int effector_add_exec(bContext *C, wmOperator *op)
if (type == PFIELD_GUIDE) {
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
- Curve *cu;
+ LegacyCurve *cu;
ob = ED_object_add_type(
C, OB_CURVE, get_effector_defname(type), loc, rot, false, local_view_bits);
@@ -2596,7 +2596,7 @@ static void object_data_convert_ensure_curve_cache(Depsgraph *depsgraph, Scene *
static void object_data_convert_curve_to_mesh(Main *bmain, Depsgraph *depsgraph, Object *ob)
{
Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
- Curve *curve = ob->data;
+ LegacyCurve *curve = ob->data;
Mesh *mesh = BKE_mesh_new_from_object_to_bmain(bmain, depsgraph, object_eval, true);
if (mesh == NULL) {
@@ -2937,7 +2937,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
newob = basen->object;
/* Decrement original curve's usage count. */
- id_us_min(&((Curve *)newob->data)->id);
+ id_us_min(&((LegacyCurve *)newob->data)->id);
/* Make a new copy of the curve. */
newob->data = BKE_id_copy(bmain, ob->data);
@@ -2946,7 +2946,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
newob = ob;
}
- Curve *cu = newob->data;
+ LegacyCurve *cu = newob->data;
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
BKE_vfont_to_curve_ex(ob_eval, ob_eval->data, FO_EDIT, &cu->nurb, NULL, NULL, NULL, NULL);
@@ -3018,7 +3018,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
newob = basen->object;
/* Decrement original curve's usage count. */
- id_us_min(&((Curve *)newob->data)->id);
+ id_us_min(&((LegacyCurve *)newob->data)->id);
/* make a new copy of the curve */
newob->data = BKE_id_copy(bmain, ob->data);
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 5c3a8fc2277..84e6aeca774 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -531,7 +531,7 @@ static void test_constraint(
con->flag |= CONSTRAINT_DISABLE;
}
else {
- Curve *cu = ct->tar->data;
+ LegacyCurve *cu = ct->tar->data;
/* auto-set 'Path' setting on curve so this works. */
cu->flag |= CU_PATH;
@@ -1083,7 +1083,7 @@ static int followpath_path_animate_exec(bContext *C, wmOperator *op)
/* add F-Curve as appropriate */
if (data->tar) {
- Curve *cu = (Curve *)data->tar->data;
+ LegacyCurve *cu = (LegacyCurve *)data->tar->data;
if (ELEM(NULL, cu->adt, cu->adt->action) ||
(BKE_fcurve_find(&cu->adt->action->curves, "eval_time", 0) == NULL)) {
@@ -2309,7 +2309,7 @@ static bool get_new_constraint_target(
if (only_curve) {
/* Curve-Path option must be enabled for follow-path constraints to be able to work
*/
- Curve *cu = (Curve *)ob->data;
+ LegacyCurve *cu = (LegacyCurve *)ob->data;
cu->flag |= CU_PATH;
}
diff --git a/source/blender/editors/object/object_data_transform.c b/source/blender/editors/object/object_data_transform.c
index 4a4ace309e1..385c19edd23 100644
--- a/source/blender/editors/object/object_data_transform.c
+++ b/source/blender/editors/object/object_data_transform.c
@@ -399,7 +399,7 @@ struct XFormObjectData *ED_object_data_xform_create_ex(ID *id, bool is_edit_mode
break;
}
case ID_CU: {
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
struct Key *key = cu->key;
const short ob_type = BKE_curve_type_get(cu);
@@ -583,7 +583,7 @@ void ED_object_data_xform_by_mat4(struct XFormObjectData *xod_base, const float
}
case ID_CU: {
BLI_assert(xod_base->is_edit_mode == false); /* Not used currently. */
- Curve *cu = (Curve *)xod_base->id;
+ LegacyCurve *cu = (LegacyCurve *)xod_base->id;
struct Key *key = cu->key;
const int key_index = -1;
@@ -687,7 +687,7 @@ void ED_object_data_xform_restore(struct XFormObjectData *xod_base)
break;
}
case ID_CU: {
- Curve *cu = (Curve *)xod_base->id;
+ LegacyCurve *cu = (LegacyCurve *)xod_base->id;
struct Key *key = cu->key;
const int key_index = -1;
@@ -763,7 +763,7 @@ void ED_object_data_xform_tag_update(struct XFormObjectData *xod_base)
}
case ID_CU: {
/* Generic update. */
- Curve *cu = (Curve *)xod_base->id;
+ LegacyCurve *cu = (LegacyCurve *)xod_base->id;
DEG_id_tag_update(&cu->id, ID_RECALC_GEOMETRY);
break;
}
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 38d0a044cb4..4996844c5b3 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -585,7 +585,7 @@ static bool ED_object_editmode_load_free_ex(Main *bmain,
DEG_relations_tag_update(bmain);
}
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- const Curve *cu = obedit->data;
+ const LegacyCurve *cu = obedit->data;
if (cu->editnurb == NULL) {
return false;
}
@@ -599,7 +599,7 @@ static bool ED_object_editmode_load_free_ex(Main *bmain,
}
}
else if (obedit->type == OB_FONT) {
- const Curve *cu = obedit->data;
+ const LegacyCurve *cu = obedit->data;
if (cu->editfont == NULL) {
return false;
}
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 71ad54383a6..d910bb51a7e 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -770,8 +770,8 @@ static bool modifier_apply_obdata(
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
- Curve *curve = ob->data;
- Curve *curve_eval = (Curve *)object_eval->data;
+ LegacyCurve *curve = ob->data;
+ LegacyCurve *curve_eval = (LegacyCurve *)object_eval->data;
ModifierEvalContext mectx = {depsgraph, object_eval, 0};
if (ELEM(mti->type, eModifierTypeType_Constructive, eModifierTypeType_Nonconstructive)) {
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 811f20e82be..c05ac483c51 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -550,8 +550,8 @@ bool ED_object_parent_set(ReportList *reports,
if (par->type != OB_CURVE) {
return false;
}
- Curve *cu = par->data;
- Curve *cu_eval = parent_eval->data;
+ LegacyCurve *cu = par->data;
+ LegacyCurve *cu_eval = parent_eval->data;
if ((cu->flag & CU_PATH) == 0) {
cu->flag |= CU_PATH | CU_FOLLOW;
cu_eval->flag |= CU_PATH | CU_FOLLOW;
@@ -1538,8 +1538,8 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
break;
case MAKE_LINKS_FONTS: {
- Curve *cu_src = ob_src->data;
- Curve *cu_dst = ob_dst->data;
+ LegacyCurve *cu_src = ob_src->data;
+ LegacyCurve *cu_dst = ob_dst->data;
if (ID_IS_LINKED(obdata_id)) {
is_lib = true;
@@ -1801,7 +1801,7 @@ static void single_obdata_users(
Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag)
{
Light *la;
- Curve *cu;
+ LegacyCurve *cu;
Camera *cam;
Mesh *me;
Lattice *lat;
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 4c4727f51ee..98245969fc7 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -657,7 +657,7 @@ static int apply_objects_internal(bContext *C,
if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
ID *obdata = ob->data;
- Curve *cu;
+ LegacyCurve *cu;
cu = ob->data;
@@ -828,12 +828,12 @@ static int apply_objects_internal(bContext *C,
BKE_mball_transform(mb, mat, do_props);
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
scale = mat3_to_scale(rsmat);
BKE_curve_transform_ex(cu, mat, true, do_props, scale);
}
else if (ob->type == OB_FONT) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
scale = mat3_to_scale(rsmat);
@@ -1226,7 +1226,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
}
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
if (centermode == ORIGIN_TO_CURSOR) {
/* done */
@@ -1260,7 +1260,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
else if (ob->type == OB_FONT) {
/* Get from bounding-box. */
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
if (ob->runtime.bb == NULL && (centermode != ORIGIN_TO_CURSOR)) {
/* Do nothing. */
diff --git a/source/blender/editors/object/object_utils.c b/source/blender/editors/object/object_utils.c
index 5f85f6ea0eb..f1d22eeb936 100644
--- a/source/blender/editors/object/object_utils.c
+++ b/source/blender/editors/object/object_utils.c
@@ -80,7 +80,7 @@ bool ED_object_calc_active_center_for_editmode(Object *obedit,
}
case OB_CURVE:
case OB_SURF: {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
if (ED_curve_active_center(cu, r_center)) {
return true;
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 54ff25ede28..d6cad773dc9 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -325,7 +325,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
Nurb *nu;
- ListBase *nurbs = BKE_curve_editNurbs_get((Curve *)ob->data);
+ ListBase *nurbs = BKE_curve_editNurbs_get((LegacyCurve *)ob->data);
if (nurbs) {
for (nu = nurbs->first; nu; nu = nu->next) {
@@ -337,7 +337,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
}
}
else if (ob->type == OB_FONT) {
- EditFont *ef = ((Curve *)ob->data)->editfont;
+ EditFont *ef = ((LegacyCurve *)ob->data)->editfont;
int i, selstart, selend;
if (ef && BKE_vfont_select_get(ob, &selstart, &selend)) {
@@ -425,7 +425,7 @@ static int material_slot_de_select(bContext *C, bool select)
}
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- ListBase *nurbs = BKE_curve_editNurbs_get((Curve *)ob->data);
+ ListBase *nurbs = BKE_curve_editNurbs_get((LegacyCurve *)ob->data);
Nurb *nu;
BPoint *bp;
BezTriple *bezt;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index d017345b523..1679d54c1d4 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -602,7 +602,7 @@ bool ED_operator_editsurfcurve(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- return NULL != ((Curve *)obedit->data)->editnurb;
+ return NULL != ((LegacyCurve *)obedit->data)->editnurb;
}
return false;
}
@@ -621,7 +621,7 @@ bool ED_operator_editcurve(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_CURVE) {
- return NULL != ((Curve *)obedit->data)->editnurb;
+ return NULL != ((LegacyCurve *)obedit->data)->editnurb;
}
return false;
}
@@ -630,7 +630,7 @@ bool ED_operator_editcurve_3d(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_CURVE) {
- Curve *cu = (Curve *)obedit->data;
+ LegacyCurve *cu = (LegacyCurve *)obedit->data;
return (cu->flag & CU_3D) && (NULL != cu->editnurb);
}
@@ -641,7 +641,7 @@ bool ED_operator_editsurf(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_SURF) {
- return NULL != ((Curve *)obedit->data)->editnurb;
+ return NULL != ((LegacyCurve *)obedit->data)->editnurb;
}
return false;
}
@@ -650,7 +650,7 @@ bool ED_operator_editfont(bContext *C)
{
Object *obedit = CTX_data_edit_object(C);
if (obedit && obedit->type == OB_FONT) {
- return NULL != ((Curve *)obedit->data)->editfont;
+ return NULL != ((LegacyCurve *)obedit->data)->editfont;
}
return false;
}
diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc
index bcf26743030..583cd65cb37 100644
--- a/source/blender/editors/space_info/info_stats.cc
+++ b/source/blender/editors/space_info/info_stats.cc
@@ -275,7 +275,7 @@ static void stats_object_edit(Object *obedit, SceneStats *stats)
}
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { /* OB_FONT has no cu->editnurb */
/* Curve Edit */
- Curve *cu = static_cast<Curve *>(obedit->data);
+ LegacyCurve *cu = static_cast<LegacyCurve *>(obedit->data);
BezTriple *bezt;
BPoint *bp;
int a;
diff --git a/source/blender/editors/space_node/node_context_path.cc b/source/blender/editors/space_node/node_context_path.cc
index 2f3855fd654..1a3a86ffda1 100644
--- a/source/blender/editors/space_node/node_context_path.cc
+++ b/source/blender/editors/space_node/node_context_path.cc
@@ -46,7 +46,7 @@
#include "node_intern.hh"
struct Mesh;
-struct Curve;
+struct LegacyCurve;
struct Light;
struct World;
struct Material;
@@ -64,7 +64,7 @@ static void context_path_add_object_data(Vector<ui::ContextPathItem> &path, Obje
ui::context_path_add_generic(path, RNA_Light, light);
}
if (ELEM(object.type, OB_CURVE, OB_FONT, OB_SURF) && object.data) {
- Curve *curve = (Curve *)object.data;
+ LegacyCurve *curve = (LegacyCurve *)object.data;
ui::context_path_add_generic(path, RNA_Curve, curve);
}
}
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 01f0feec771..548aa1c27ec 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -249,7 +249,7 @@ static void unlink_material_fn(bContext *UNUSED(C),
matar = me->mat;
}
else if (GS(tsep->id->name) == ID_CU) {
- Curve *cu = (Curve *)tsep->id;
+ LegacyCurve *cu = (LegacyCurve *)tsep->id;
totcol = cu->totcol;
matar = cu->mat;
}
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 3353726de18..d15aff43607 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -604,7 +604,7 @@ static void outliner_add_id_contents(SpaceOutliner *space_outliner,
break;
}
case ID_CU: {
- Curve *cu = (Curve *)id;
+ LegacyCurve *cu = (LegacyCurve *)id;
if (outliner_animdata_test(cu->adt)) {
outliner_add_element(space_outliner, &te->subtree, cu, te, TSE_ANIM_DATA, 0);
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index b79303551a1..c516b567695 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -368,7 +368,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
TransformMedian_Curve *median = &median_basis.curve;
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
BPoint *bp;
BezTriple *bezt;
int a;
@@ -1070,7 +1070,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
median_basis.curve.radius || median_basis.curve.tilt)) {
const TransformMedian_Curve *median = &median_basis.curve,
*ve_median = &ve_median_basis.curve;
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
BPoint *bp;
BezTriple *bezt;
int a;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 830f7cbeff1..3484a3fb828 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -336,7 +336,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
is_set = true;
}
else if (ob_act && (ob_act->mode & OB_MODE_EDIT) && (ob_act->type == OB_FONT)) {
- Curve *cu = ob_act_eval->data;
+ LegacyCurve *cu = ob_act_eval->data;
EditFont *ef = cu->editfont;
zero_v3(lastofs);
diff --git a/source/blender/editors/space_view3d/view3d_iterators.c b/source/blender/editors/space_view3d/view3d_iterators.c
index 16d9b9182cf..38b247f7006 100644
--- a/source/blender/editors/space_view3d/view3d_iterators.c
+++ b/source/blender/editors/space_view3d/view3d_iterators.c
@@ -606,7 +606,7 @@ void nurbs_foreachScreenVert(ViewContext *vc,
void *userData,
const eV3DProjTest clip_flag)
{
- Curve *cu = vc->obedit->data;
+ LegacyCurve *cu = vc->obedit->data;
Nurb *nu;
int i;
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index cc8aac21a6e..78ad23f4a04 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -941,7 +941,7 @@ static bool do_lasso_select_curve(ViewContext *vc,
view3d_userdata_lassoselect_init(&data, vc, &rect, mcoords, mcoords_len, sel_op);
- Curve *curve = (Curve *)vc->obedit->data;
+ LegacyCurve *curve = (LegacyCurve *)vc->obedit->data;
ListBase *nurbs = BKE_curve_editNurbs_get(curve);
/* For deselect all, items to be selected are tagged with temp flag. Clear that first. */
@@ -3033,7 +3033,7 @@ static bool do_nurbs_box_select(ViewContext *vc, rcti *rect, const eSelectOp sel
view3d_userdata_boxselect_init(&data, vc, rect, sel_op);
- Curve *curve = (Curve *)vc->obedit->data;
+ LegacyCurve *curve = (LegacyCurve *)vc->obedit->data;
ListBase *nurbs = BKE_curve_editNurbs_get(curve);
/* For deselect all, items to be selected are tagged with temp flag. Clear that first. */
@@ -3989,7 +3989,7 @@ static bool nurbscurve_circle_select(ViewContext *vc,
view3d_userdata_circleselect_init(&data, vc, select, mval, rad);
- Curve *curve = (Curve *)vc->obedit->data;
+ LegacyCurve *curve = (LegacyCurve *)vc->obedit->data;
ListBase *nurbs = BKE_curve_editNurbs_get(curve);
/* For deselect all, items to be selected are tagged with temp flag. Clear that first. */
diff --git a/source/blender/editors/transform/transform_convert_curve.c b/source/blender/editors/transform/transform_convert_curve.c
index 255af3feca2..3776ea14548 100644
--- a/source/blender/editors/transform/transform_convert_curve.c
+++ b/source/blender/editors/transform/transform_convert_curve.c
@@ -92,7 +92,7 @@ void createTransCurveVerts(TransInfo *t)
int data_len_all_pt = 0;
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
- Curve *cu = tc->obedit->data;
+ LegacyCurve *cu = tc->obedit->data;
BLI_assert(cu->editnurb != NULL);
BezTriple *bezt;
BPoint *bp;
@@ -177,7 +177,7 @@ void createTransCurveVerts(TransInfo *t)
continue;
}
- Curve *cu = tc->obedit->data;
+ LegacyCurve *cu = tc->obedit->data;
BezTriple *bezt;
BPoint *bp;
int a;
@@ -445,7 +445,7 @@ void recalcData_curve(TransInfo *t)
}
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
- Curve *cu = tc->obedit->data;
+ LegacyCurve *cu = tc->obedit->data;
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
Nurb *nu = nurbs->first;
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 9bd55d78039..e4bde98972d 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -832,7 +832,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
}
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
FOREACH_EDIT_OBJECT_BEGIN (ob_iter, use_mat_local) {
- Curve *cu = ob_iter->data;
+ LegacyCurve *cu = ob_iter->data;
Nurb *nu;
BezTriple *bezt;
BPoint *bp;
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index fa2485c33c2..cac7a15960b 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -999,7 +999,7 @@ int getTransformOrientation_ex(ViewLayer *view_layer,
} /* end editmesh */
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
Nurb *nu = NULL;
int a;
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index 350d3a2676c..2449c13cd36 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -1986,7 +1986,7 @@ static short snapCurve(SnapObjectContext *sctx,
return 0;
}
- Curve *cu = ob_eval->data;
+ LegacyCurve *cu = ob_eval->data;
float dist_px_sq = square_f(*dist_px);
float lpmat[4][4];
diff --git a/source/blender/editors/util/ed_transverts.c b/source/blender/editors/util/ed_transverts.c
index b4a93eb996c..74827998007 100644
--- a/source/blender/editors/util/ed_transverts.c
+++ b/source/blender/editors/util/ed_transverts.c
@@ -61,7 +61,7 @@ void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit)
BM_mesh_normals_update(em->bm);
}
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
Nurb *nu = nurbs->first;
@@ -367,7 +367,7 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const
}
}
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
- Curve *cu = obedit->data;
+ LegacyCurve *cu = obedit->data;
int totmalloc = 0;
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
diff --git a/source/blender/io/alembic/exporter/abc_writer_curves.cc b/source/blender/io/alembic/exporter/abc_writer_curves.cc
index 5e01609f930..c3698c53287 100644
--- a/source/blender/io/alembic/exporter/abc_writer_curves.cc
+++ b/source/blender/io/alembic/exporter/abc_writer_curves.cc
@@ -55,7 +55,7 @@ void ABCCurveWriter::create_alembic_objects(const HierarchyContext *context)
abc_curve_ = OCurves(args_.abc_parent, args_.abc_name, timesample_index_);
abc_curve_schema_ = abc_curve_.getSchema();
- Curve *cu = static_cast<Curve *>(context->object->data);
+ LegacyCurve *cu = static_cast<LegacyCurve *>(context->object->data);
OCompoundProperty user_props = abc_curve_schema_.getUserProperties();
OInt16Property user_prop_resolu(user_props, ABC_CURVE_RESOLUTION_U_PROPNAME);
user_prop_resolu.set(cu->resolu);
@@ -73,7 +73,7 @@ Alembic::Abc::OCompoundProperty ABCCurveWriter::abc_prop_for_custom_props()
void ABCCurveWriter::do_write(HierarchyContext &context)
{
- Curve *curve = static_cast<Curve *>(context.object->data);
+ LegacyCurve *curve = static_cast<LegacyCurve *>(context.object->data);
std::vector<Imath::V3f> verts;
std::vector<int32_t> vert_counts;
diff --git a/source/blender/io/alembic/exporter/abc_writer_nurbs.cc b/source/blender/io/alembic/exporter/abc_writer_nurbs.cc
index ce451eb1428..515832e2f0b 100644
--- a/source/blender/io/alembic/exporter/abc_writer_nurbs.cc
+++ b/source/blender/io/alembic/exporter/abc_writer_nurbs.cc
@@ -46,7 +46,7 @@ ABCNurbsWriter::ABCNurbsWriter(const ABCWriterConstructorArgs &args) : ABCAbstra
void ABCNurbsWriter::create_alembic_objects(const HierarchyContext *context)
{
- Curve *curve = static_cast<Curve *>(context->object->data);
+ LegacyCurve *curve = static_cast<LegacyCurve *>(context->object->data);
size_t num_nurbs = BLI_listbase_count(&curve->nurb);
OObject abc_parent = args_.abc_parent;
const char *abc_parent_path = abc_parent.getFullName().c_str();
@@ -92,7 +92,7 @@ Alembic::Abc::OCompoundProperty ABCNurbsWriter::abc_prop_for_custom_props()
bool ABCNurbsWriter::check_is_animated(const HierarchyContext &context) const
{
/* Check if object has shape keys. */
- Curve *cu = static_cast<Curve *>(context.object->data);
+ LegacyCurve *cu = static_cast<LegacyCurve *>(context.object->data);
return (cu->key != nullptr);
}
@@ -123,7 +123,7 @@ static void get_knots(std::vector<float> &knots, const int num_knots, float *nu_
void ABCNurbsWriter::do_write(HierarchyContext &context)
{
- Curve *curve = static_cast<Curve *>(context.object->data);
+ LegacyCurve *curve = static_cast<LegacyCurve *>(context.object->data);
ListBase *nulb;
if (context.object->runtime.curve_cache->deformed_nurbs.first != nullptr) {
diff --git a/source/blender/io/alembic/intern/abc_reader_curves.cc b/source/blender/io/alembic/intern/abc_reader_curves.cc
index bd1e57da648..1407a23a7d3 100644
--- a/source/blender/io/alembic/intern/abc_reader_curves.cc
+++ b/source/blender/io/alembic/intern/abc_reader_curves.cc
@@ -92,7 +92,7 @@ bool AbcCurveReader::accepts_object_type(
void AbcCurveReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel)
{
- Curve *cu = BKE_curve_add(bmain, m_data_name.c_str(), OB_CURVE);
+ LegacyCurve *cu = BKE_curve_add(bmain, m_data_name.c_str(), OB_CURVE);
cu->flag |= CU_3D;
cu->actvert = CU_ACT_NONE;
@@ -117,7 +117,7 @@ void AbcCurveReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSele
}
}
-void AbcCurveReader::read_curve_sample(Curve *cu,
+void AbcCurveReader::read_curve_sample(LegacyCurve *cu,
const ICurvesSchema &schema,
const ISampleSelector &sample_sel)
{
@@ -301,7 +301,7 @@ Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh,
int vertex_idx = 0;
int curve_idx;
- Curve *curve = static_cast<Curve *>(m_object->data);
+ LegacyCurve *curve = static_cast<LegacyCurve *>(m_object->data);
const int curve_count = BLI_listbase_count(&curve->nurb);
bool same_topology = curve_count == num_vertices->size();
diff --git a/source/blender/io/alembic/intern/abc_reader_curves.h b/source/blender/io/alembic/intern/abc_reader_curves.h
index 6bc0691a870..df8d263baad 100644
--- a/source/blender/io/alembic/intern/abc_reader_curves.h
+++ b/source/blender/io/alembic/intern/abc_reader_curves.h
@@ -25,7 +25,7 @@
#include "abc_reader_mesh.h"
#include "abc_reader_object.h"
-struct Curve;
+struct LegacyCurve;
#define ABC_CURVE_RESOLUTION_U_PROPNAME "blender:resolution"
@@ -57,7 +57,7 @@ class AbcCurveReader final : public AbcObjectReader {
const float velocity_scale,
const char **err_str) override;
- void read_curve_sample(Curve *cu,
+ void read_curve_sample(LegacyCurve *cu,
const Alembic::AbcGeom::ICurvesSchema &schema,
const Alembic::Abc::ISampleSelector &sample_selector);
};
diff --git a/source/blender/io/alembic/intern/abc_reader_nurbs.cc b/source/blender/io/alembic/intern/abc_reader_nurbs.cc
index 4492d1e1ca0..20d27b748a3 100644
--- a/source/blender/io/alembic/intern/abc_reader_nurbs.cc
+++ b/source/blender/io/alembic/intern/abc_reader_nurbs.cc
@@ -110,7 +110,7 @@ static bool set_knots(const FloatArraySamplePtr &knots, float *&nu_knots)
void AbcNurbsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel)
{
- Curve *cu = static_cast<Curve *>(BKE_curve_add(bmain, m_data_name.c_str(), OB_SURF));
+ LegacyCurve *cu = static_cast<LegacyCurve *>(BKE_curve_add(bmain, m_data_name.c_str(), OB_SURF));
cu->actvert = CU_ACT_NONE;
std::vector<std::pair<INuPatchSchema, IObject>>::iterator it;
diff --git a/source/blender/io/usd/intern/usd_reader_curve.cc b/source/blender/io/usd/intern/usd_reader_curve.cc
index 5007d204020..b213b1369d1 100644
--- a/source/blender/io/usd/intern/usd_reader_curve.cc
+++ b/source/blender/io/usd/intern/usd_reader_curve.cc
@@ -56,7 +56,7 @@ void USDCurvesReader::create_object(Main *bmain, const double /* motionSampleTim
void USDCurvesReader::read_object_data(Main *bmain, double motionSampleTime)
{
- Curve *cu = (Curve *)object_->data;
+ LegacyCurve *cu = (LegacyCurve *)object_->data;
read_curve_sample(cu, motionSampleTime);
if (curve_prim_.GetPointsAttr().ValueMightBeTimeVarying()) {
@@ -66,7 +66,7 @@ void USDCurvesReader::read_object_data(Main *bmain, double motionSampleTime)
USDXformReader::read_object_data(bmain, motionSampleTime);
}
-void USDCurvesReader::read_curve_sample(Curve *cu, const double motionSampleTime)
+void USDCurvesReader::read_curve_sample(LegacyCurve *cu, const double motionSampleTime)
{
curve_prim_ = pxr::UsdGeomBasisCurves(prim_);
@@ -202,7 +202,7 @@ Mesh *USDCurvesReader::read_mesh(struct Mesh *existing_mesh,
int vertex_idx = 0;
int curve_idx;
- Curve *curve = static_cast<Curve *>(object_->data);
+ LegacyCurve *curve = static_cast<LegacyCurve *>(object_->data);
const int curve_count = BLI_listbase_count(&curve->nurb);
bool same_topology = curve_count == num_subcurves;
diff --git a/source/blender/io/usd/intern/usd_reader_curve.h b/source/blender/io/usd/intern/usd_reader_curve.h
index 1e676bbbd02..ff0f5afd9cd 100644
--- a/source/blender/io/usd/intern/usd_reader_curve.h
+++ b/source/blender/io/usd/intern/usd_reader_curve.h
@@ -26,14 +26,14 @@
#include "pxr/usd/usdGeom/basisCurves.h"
-struct Curve;
+struct LegacyCurve;
namespace blender::io::usd {
class USDCurvesReader : public USDGeomReader {
protected:
pxr::UsdGeomBasisCurves curve_prim_;
- Curve *curve_;
+ LegacyCurve *curve_;
public:
USDCurvesReader(const pxr::UsdPrim &prim,
@@ -51,7 +51,7 @@ class USDCurvesReader : public USDGeomReader {
void create_object(Main *bmain, double motionSampleTime) override;
void read_object_data(Main *bmain, double motionSampleTime) override;
- void read_curve_sample(Curve *cu, double motionSampleTime);
+ void read_curve_sample(LegacyCurve *cu, double motionSampleTime);
Mesh *read_mesh(struct Mesh *existing_mesh,
double motionSampleTime,
diff --git a/source/blender/io/usd/intern/usd_reader_nurbs.cc b/source/blender/io/usd/intern/usd_reader_nurbs.cc
index 8370804b776..3917bbeb983 100644
--- a/source/blender/io/usd/intern/usd_reader_nurbs.cc
+++ b/source/blender/io/usd/intern/usd_reader_nurbs.cc
@@ -72,7 +72,7 @@ void USDNurbsReader::create_object(Main *bmain, const double /* motionSampleTime
void USDNurbsReader::read_object_data(Main *bmain, const double motionSampleTime)
{
- Curve *cu = (Curve *)object_->data;
+ LegacyCurve *cu = (LegacyCurve *)object_->data;
read_curve_sample(cu, motionSampleTime);
if (curve_prim_.GetPointsAttr().ValueMightBeTimeVarying()) {
@@ -82,7 +82,7 @@ void USDNurbsReader::read_object_data(Main *bmain, const double motionSampleTime
USDXformReader::read_object_data(bmain, motionSampleTime);
}
-void USDNurbsReader::read_curve_sample(Curve *cu, const double motionSampleTime)
+void USDNurbsReader::read_curve_sample(LegacyCurve *cu, const double motionSampleTime)
{
curve_prim_ = pxr::UsdGeomNurbsCurves(prim_);
@@ -202,7 +202,7 @@ Mesh *USDNurbsReader::read_mesh(struct Mesh * /* existing_mesh */,
int vertex_idx = 0;
int curve_idx;
- Curve *curve = static_cast<Curve *>(object_->data);
+ LegacyCurve *curve = static_cast<LegacyCurve *>(object_->data);
const int curve_count = BLI_listbase_count(&curve->nurb);
bool same_topology = curve_count == num_subcurves;
diff --git a/source/blender/io/usd/intern/usd_reader_nurbs.h b/source/blender/io/usd/intern/usd_reader_nurbs.h
index 33a4acf503e..3d453765fb0 100644
--- a/source/blender/io/usd/intern/usd_reader_nurbs.h
+++ b/source/blender/io/usd/intern/usd_reader_nurbs.h
@@ -25,14 +25,14 @@
#include "pxr/usd/usdGeom/nurbsCurves.h"
-struct Curve;
+struct LegacyCurve;
namespace blender::io::usd {
class USDNurbsReader : public USDGeomReader {
protected:
pxr::UsdGeomNurbsCurves curve_prim_;
- Curve *curve_;
+ LegacyCurve *curve_;
public:
USDNurbsReader(const pxr::UsdPrim &prim,
@@ -50,7 +50,7 @@ class USDNurbsReader : public USDGeomReader {
void create_object(Main *bmain, double motionSampleTime) override;
void read_object_data(Main *bmain, double motionSampleTime) override;
- void read_curve_sample(Curve *cu, double motionSampleTime);
+ void read_curve_sample(LegacyCurve *cu, double motionSampleTime);
Mesh *read_mesh(struct Mesh *existing_mesh,
double motionSampleTime,
diff --git a/source/blender/makesdna/DNA_curve_defaults.h b/source/blender/makesdna/DNA_curve_defaults.h
index 614653db2b8..49f685bf947 100644
--- a/source/blender/makesdna/DNA_curve_defaults.h
+++ b/source/blender/makesdna/DNA_curve_defaults.h
@@ -27,7 +27,7 @@
/** \name Curve Struct
* \{ */
-#define _DNA_DEFAULT_Curve \
+#define _DNA_DEFAULT_LegacyCurve \
{ \
.size = {1, 1, 1}, \
.flag = CU_DEFORM_BOUNDS_OFF | CU_PATH_RADIUS, \
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index c1c8fe06121..d017c4da062 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -202,7 +202,7 @@ typedef struct EditNurb {
} EditNurb;
-typedef struct Curve {
+typedef struct LegacyCurve {
ID id;
/** Animation data (must be immediately after id for utilities to use it). */
struct AnimData *adt;
@@ -310,7 +310,7 @@ typedef struct Curve {
struct CurveEval *curve_eval;
void *batch_cache;
-} Curve;
+} LegacyCurve;
#define CURVE_VFONT_ANY(cu) ((cu)->vfont), ((cu)->vfontb), ((cu)->vfonti), ((cu)->vfontbi)
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 0f570f8603d..0ea74547020 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -32,8 +32,8 @@ extern "C" {
#endif
struct AnimData;
-struct Curve;
-struct Curve;
+struct LegacyCurve;
+struct LegacyCurve;
struct MDeformVert;
#define GP_DEFAULT_PIX_FACTOR 1.0f
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 57c8ef200ae..c01edc119e8 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -43,7 +43,7 @@ extern "C" {
struct AnimData;
struct BoundBox;
-struct Curve;
+struct LegacyCurve;
struct FluidsimSettings;
struct GeometrySet;
struct Ipo;
@@ -198,7 +198,7 @@ typedef struct Object_Runtime {
* This is a curve representation of corresponding object.
* It created when Python calls `object.to_curve()`.
*/
- struct Curve *object_as_temp_curve;
+ struct LegacyCurve *object_as_temp_curve;
/** Runtime evaluated curve-specific data, not stored in the file. */
struct CurveCache *curve_cache;
diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c
index 1d4257328a4..d928263c993 100644
--- a/source/blender/makesdna/intern/dna_defaults.c
+++ b/source/blender/makesdna/intern/dna_defaults.c
@@ -172,7 +172,7 @@ SDNA_DEFAULT_DECL_STRUCT(Camera);
SDNA_DEFAULT_DECL_STRUCT(Collection);
/* DNA_curve_defaults.h */
-SDNA_DEFAULT_DECL_STRUCT(Curve);
+SDNA_DEFAULT_DECL_STRUCT(LegacyCurve);
/* DNA_fluid_defaults.h */
SDNA_DEFAULT_DECL_STRUCT(FluidDomainSettings);
@@ -375,7 +375,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = {
SDNA_DEFAULT_DECL(Collection),
/* DNA_curve_defaults.h */
- SDNA_DEFAULT_DECL(Curve),
+ SDNA_DEFAULT_DECL(LegacyCurve),
/* DNA_fluid_defaults.h */
SDNA_DEFAULT_DECL(FluidDomainSettings),
diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h
index c5769d7eee4..bd79c421899 100644
--- a/source/blender/makesdna/intern/dna_rename_defs.h
+++ b/source/blender/makesdna/intern/dna_rename_defs.h
@@ -74,10 +74,10 @@ DNA_STRUCT_RENAME_ELEM(Camera, YF_dofdist, dof_distance)
DNA_STRUCT_RENAME_ELEM(Camera, clipend, clip_end)
DNA_STRUCT_RENAME_ELEM(Camera, clipsta, clip_start)
DNA_STRUCT_RENAME_ELEM(Collection, dupli_ofs, instance_offset)
-DNA_STRUCT_RENAME_ELEM(Curve, ext1, extrude)
-DNA_STRUCT_RENAME_ELEM(Curve, ext2, bevel_radius)
-DNA_STRUCT_RENAME_ELEM(Curve, len_wchar, len_char32)
-DNA_STRUCT_RENAME_ELEM(Curve, width, offset)
+DNA_STRUCT_RENAME_ELEM(LegacyCurve, ext1, extrude)
+DNA_STRUCT_RENAME_ELEM(LegacyCurve, ext2, bevel_radius)
+DNA_STRUCT_RENAME_ELEM(LegacyCurve, len_wchar, len_char32)
+DNA_STRUCT_RENAME_ELEM(LegacyCurve, width, offset)
DNA_STRUCT_RENAME_ELEM(Editing, over_border, overlay_frame_rect)
DNA_STRUCT_RENAME_ELEM(Editing, over_cfra, overlay_frame_abs)
DNA_STRUCT_RENAME_ELEM(Editing, over_flag, overlay_frame_flag)
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index be612a1602b..a69351d6d9e 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -872,7 +872,7 @@ static void rna_ID_update_tag(ID *id, Main *bmain, ReportList *reports, int flag
/* XXX, new function for this! */
# if 0
if (ob->type == OB_FONT) {
- Curve *cu = ob->data;
+ LegacyCurve *cu = ob->data;
freedisplist(&cu->disp);
BKE_vfont_to_curve(bmain, sce, ob, FO_EDIT, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 6cca0c51988..e42e86fa19d 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -182,7 +182,10 @@ static const EnumPropertyItem curve2d_fill_mode_items[] = {
# include "ED_curve.h" /* for BKE_curve_nurbs_get */
/* highly irritating but from RNA we can't know this */
-static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index, int *pt_index)
+static Nurb *curve_nurb_from_point(LegacyCurve *cu,
+ const void *point,
+ int *nu_index,
+ int *pt_index)
{
ListBase *nurbs = BKE_curve_nurbs_get(cu);
Nurb *nu;
@@ -221,7 +224,7 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index,
static StructRNA *rna_Curve_refine(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
short obtype = BKE_curve_type_get(cu);
if (obtype == OB_FONT) {
@@ -273,7 +276,7 @@ static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
if (cu->texflag & CU_AUTOSPACE) {
BKE_curve_texspace_calc(cu);
@@ -282,13 +285,13 @@ static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
static int rna_Curve_texspace_editable(PointerRNA *ptr, const char **UNUSED(r_info))
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
return (cu->texflag & CU_AUTOSPACE) ? 0 : PROP_EDITABLE;
}
static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values)
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
BKE_curve_texspace_ensure(cu);
@@ -297,14 +300,14 @@ static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values)
static void rna_Curve_texspace_loc_set(PointerRNA *ptr, const float *values)
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
copy_v3_v3(cu->loc, values);
}
static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
BKE_curve_texspace_ensure(cu);
@@ -313,7 +316,7 @@ static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values)
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
copy_v3_v3(cu->size, values);
}
@@ -321,7 +324,7 @@ static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values)
static void rna_Curve_material_index_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
*min = 0;
*max = max_ii(0, cu->totcol - 1);
}
@@ -342,14 +345,14 @@ static void rna_ChariInfo_material_index_set(PointerRNA *ptr, int value)
static void rna_Curve_active_textbox_index_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
*min = 0;
*max = max_ii(0, cu->totbox - 1);
}
static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
if (value == CU_3D) {
cu->flag |= CU_3D;
}
@@ -364,7 +367,7 @@ static const EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C),
PropertyRNA *UNUSED(prop),
bool *UNUSED(r_free))
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
/* cast to quiet warning it IS a const still */
return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items :
@@ -382,7 +385,7 @@ static int rna_Nurb_length(PointerRNA *ptr)
static void rna_Nurb_type_set(PointerRNA *ptr, int value)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
Nurb *nu = (Nurb *)ptr->data;
const int pntsu_prev = nu->pntsu;
@@ -423,7 +426,7 @@ static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
Nurb *nu = curve_nurb_from_point(cu, ptr->data, NULL, NULL);
if (nu) {
@@ -435,7 +438,7 @@ static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
Object *ob = cu->bevobj;
if (ob) {
@@ -449,7 +452,7 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
Object *ob = (Object *)value.data;
if (ob) {
@@ -471,7 +474,7 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr,
*/
static void rna_Curve_bevel_resolution_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
if (cu->bevel_mode == CU_BEV_MODE_CURVE_PROFILE) {
BKE_curveprofile_init(cu->bevel_profile, cu->bevresol + 1);
@@ -482,7 +485,7 @@ static void rna_Curve_bevel_resolution_update(Main *bmain, Scene *scene, Pointer
static void rna_Curve_bevel_mode_set(PointerRNA *ptr, int value)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
if (value == CU_BEV_MODE_CURVE_PROFILE) {
if (cu->bevel_profile == NULL) {
@@ -496,7 +499,7 @@ static void rna_Curve_bevel_mode_set(PointerRNA *ptr, int value)
static bool rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
Object *ob = (Object *)value.data;
if (ob) {
@@ -510,7 +513,7 @@ static bool rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
Object *ob = cu->taperobj;
if (ob) {
@@ -524,7 +527,7 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
Object *ob = (Object *)value.data;
if (ob) {
@@ -542,7 +545,7 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr,
static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
LISTBASE_FOREACH (Nurb *, nu, nurbs) {
@@ -554,7 +557,7 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe
static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
LISTBASE_FOREACH (Nurb *, nu, nurbs) {
@@ -566,26 +569,26 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe
static float rna_Curve_offset_get(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
return cu->offset - 1.0f;
}
static void rna_Curve_offset_set(PointerRNA *ptr, float value)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
cu->offset = 1.0f + value;
}
static int rna_Curve_body_length(PointerRNA *ptr);
static void rna_Curve_body_get(PointerRNA *ptr, char *value)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
BLI_strncpy(value, cu->str, rna_Curve_body_length(ptr) + 1);
}
static int rna_Curve_body_length(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
return cu->len;
}
@@ -595,7 +598,7 @@ static void rna_Curve_body_set(PointerRNA *ptr, const char *value)
size_t len_bytes;
size_t len_chars = BLI_strlen_utf8_ex(value, &len_bytes);
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
cu->len_char32 = len_chars;
cu->len = len_bytes;
@@ -694,7 +697,7 @@ static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, ReportList *reports
}
}
-static Nurb *rna_Curve_spline_new(Curve *cu, int type)
+static Nurb *rna_Curve_spline_new(LegacyCurve *cu, int type)
{
Nurb *nu = (Nurb *)MEM_callocN(sizeof(Nurb), "spline.new");
@@ -723,7 +726,7 @@ static Nurb *rna_Curve_spline_new(Curve *cu, int type)
return nu;
}
-static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, PointerRNA *nu_ptr)
+static void rna_Curve_spline_remove(LegacyCurve *cu, ReportList *reports, PointerRNA *nu_ptr)
{
Nurb *nu = nu_ptr->data;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
@@ -740,7 +743,7 @@ static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, PointerRNA *
WM_main_add_notifier(NC_GEOM | ND_DATA, NULL);
}
-static void rna_Curve_spline_clear(Curve *cu)
+static void rna_Curve_spline_clear(LegacyCurve *cu)
{
ListBase *nurbs = BKE_curve_nurbs_get(cu);
@@ -752,7 +755,7 @@ static void rna_Curve_spline_clear(Curve *cu)
static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
Nurb *nu;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
@@ -771,7 +774,7 @@ static void rna_Curve_active_spline_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
{
- Curve *cu = (Curve *)ptr->data;
+ LegacyCurve *cu = (LegacyCurve *)ptr->data;
Nurb *nu = value.data;
ListBase *nubase = BKE_curve_nurbs_get(cu);
@@ -786,7 +789,7 @@ static void rna_Curve_active_spline_set(PointerRNA *ptr,
static char *rna_Curve_spline_path(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
ListBase *nubase = BKE_curve_nurbs_get(cu);
Nurb *nu = ptr->data;
int index = BLI_findindex(nubase, nu);
@@ -802,7 +805,7 @@ static char *rna_Curve_spline_path(PointerRNA *ptr)
/* use for both bezier and nurbs */
static char *rna_Curve_spline_point_path(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
Nurb *nu;
void *point = ptr->data;
int nu_index, pt_index;
@@ -824,7 +827,7 @@ static char *rna_Curve_spline_point_path(PointerRNA *ptr)
static char *rna_TextBox_path(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
TextBox *tb = ptr->data;
int index = (int)(tb - cu->tb);
@@ -838,13 +841,13 @@ static char *rna_TextBox_path(PointerRNA *ptr)
static void rna_Curve_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
rna_iterator_listbase_begin(iter, BKE_curve_nurbs_get(cu), NULL);
}
static bool rna_Curve_is_editmode_get(PointerRNA *ptr)
{
- Curve *cu = (Curve *)ptr->owner_id;
+ LegacyCurve *cu = (LegacyCurve *)ptr->owner_id;
const short type = BKE_curve_type_get(cu);
if (type == OB_FONT) {
return (cu->editfont != NULL);
@@ -1392,7 +1395,7 @@ static void rna_def_surface(BlenderRNA *brna)
StructRNA *srna;
srna = RNA_def_struct(brna, "SurfaceCurve", "Curve");
- RNA_def_struct_sdna(srna, "Curve");
+ RNA_def_struct_sdna(srna, "LegacyCurve");
RNA_def_struct_ui_text(srna, "Surface Curve", "Curve data-block used for storing surfaces");
RNA_def_struct_ui_icon(srna, ICON_SURFACE_DATA);
@@ -1404,7 +1407,7 @@ static void rna_def_text(BlenderRNA *brna)
StructRNA *srna;
srna = RNA_def_struct(brna, "TextCurve", "Curve");
- RNA_def_struct_sdna(srna, "Curve");
+ RNA_def_struct_sdna(srna, "LegacyCurve");
RNA_def_struct_ui_text(srna, "Text Curve", "Curve data-block used for storing text");
RNA_def_struct_ui_icon(srna, ICON_FONT_DATA);
@@ -1484,7 +1487,7 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_srna(cprop, "CurveSplines");
srna = RNA_def_struct(brna, "CurveSplines", NULL);
- RNA_def_struct_sdna(srna, "Curve");
+ RNA_def_struct_sdna(srna, "LegacyCurve");
RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines");
func = RNA_def_function(srna, "new", "rna_Curve_spline_new");
@@ -1597,6 +1600,7 @@ static void rna_def_curve(BlenderRNA *brna)
};
srna = RNA_def_struct(brna, "Curve", "ID");
+ RNA_def_struct_sdna(srna, "LegacyCurve");
RNA_def_struct_ui_text(srna, "Curve", "Curve data-block storing curves, splines and NURBS");
RNA_def_struct_ui_icon(srna, ICON_CURVE_DATA);
RNA_def_struct_refine_func(srna, "rna_Curve_refine");
diff --git a/source/blender/makesrna/intern/rna_curve_api.c b/source/blender/makesrna/intern/rna_curve_api.c
index beea607e8c0..6e40a38c425 100644
--- a/source/blender/makesrna/intern/rna_curve_api.c
+++ b/source/blender/makesrna/intern/rna_curve_api.c
@@ -35,14 +35,14 @@
#include "rna_internal.h" /* own include */
#ifdef RNA_RUNTIME
-static void rna_Curve_transform(Curve *cu, float mat[16], bool shape_keys)
+static void rna_Curve_transform(LegacyCurve *cu, float mat[16], bool shape_keys)
{
BKE_curve_transform(cu, (const float(*)[4])mat, shape_keys, true);
DEG_id_tag_update(&cu->id, 0);
}
-static void rna_Curve_update_gpu_tag(Curve *cu)
+static void rna_Curve_update_gpu_tag(LegacyCurve *cu)
{
BKE_curve_batch_cache_dirty_tag(cu, BKE_CURVE_BATCH_DIRTY_ALL);
}
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index c7a1c89af63..04ddcf738af 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -62,7 +62,7 @@ static Key *rna_ShapeKey_find_key(ID *id)
{
switch (GS(id->name)) {
case ID_CU:
- return ((Curve *)id)->key;
+ return ((LegacyCurve *)id)->key;
case ID_KE:
return (Key *)id;
case ID_LT:
@@ -511,7 +511,7 @@ static void rna_ShapeKey_NurbInfo_find_index(Key *key,
bool input_elem,
NurbInfo *r_info)
{
- Curve *cu = (Curve *)key->from;
+ LegacyCurve *cu = (LegacyCurve *)key->from;
memset(r_info, 0, sizeof(*r_info));
@@ -536,7 +536,7 @@ typedef struct ShapeKeyCurvePoint {
static void rna_ShapeKey_data_begin_mixed(CollectionPropertyIterator *iter,
Key *key,
KeyBlock *kb,
- Curve *cu)
+ LegacyCurve *cu)
{
int point_count = rna_ShapeKey_curve_find_index(key, kb->totelem);
@@ -571,7 +571,7 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA
int tot = kb->totelem, size = key->elemsize;
if (GS(key->from->name) == ID_CU && tot > 0) {
- Curve *cu = (Curve *)key->from;
+ LegacyCurve *cu = (LegacyCurve *)key->from;
StructRNA *type = NULL;
NurbInfo info = {0};
@@ -628,7 +628,7 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter)
}
if (GS(key->from->name) == ID_CU) {
- Curve *cu = (Curve *)key->from;
+ LegacyCurve *cu = (LegacyCurve *)key->from;
type = rna_ShapeKey_curve_point_type(cu->nurb.first);
}
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 0276c8a3f8a..ccd066834d1 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -444,12 +444,12 @@ static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
return lt;
}
-static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
+static LegacyCurve *rna_Main_curves_new(Main *bmain, const char *name, int type)
{
char safe_name[MAX_ID_NAME - 2];
rna_idname_validate(name, safe_name);
- Curve *cu = BKE_curve_add(bmain, safe_name, type);
+ LegacyCurve *cu = BKE_curve_add(bmain, safe_name, type);
id_us_min(&cu->id);
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index d46ae13b482..904355c975e 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1203,7 +1203,7 @@ static void rna_CurveModifier_dependency_update(Main *bmain, Scene *scene, Point
rna_Modifier_update(bmain, scene, ptr);
DEG_relations_tag_update(bmain);
if (cmd->object != NULL) {
- Curve *curve = cmd->object->data;
+ LegacyCurve *curve = cmd->object->data;
if ((curve->flag & CU_PATH) == 0) {
DEG_id_tag_update(&curve->id, ID_RECALC_GEOMETRY);
}
@@ -1216,7 +1216,7 @@ static void rna_ArrayModifier_dependency_update(Main *bmain, Scene *scene, Point
rna_Modifier_update(bmain, scene, ptr);
DEG_relations_tag_update(bmain);
if (amd->curve_ob != NULL) {
- Curve *curve = amd->curve_ob->data;
+ LegacyCurve *curve = amd->curve_ob->data;
if ((curve->flag & CU_PATH) == 0) {
DEG_id_tag_update(&curve->id, ID_RECALC_GEOMETRY);
}
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 63c4774d0e5..1d5d7325c1e 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -407,10 +407,10 @@ static void rna_Object_to_mesh_clear(Object *object)
BKE_object_to_mesh_clear(object);
}
-static Curve *rna_Object_to_curve(Object *object,
- ReportList *reports,
- Depsgraph *depsgraph,
- bool apply_modifiers)
+static LegacyCurve *rna_Object_to_curve(Object *object,
+ ReportList *reports,
+ Depsgraph *depsgraph,
+ bool apply_modifiers)
{
if (!ELEM(object->type, OB_FONT, OB_CURVE)) {
BKE_report(reports, RPT_ERROR, "Object is not a curve or a text");
diff --git a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
index 910dfe261e8..2ccbf387b8f 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
@@ -155,7 +155,7 @@ static TextLayout get_text_layout(GeoNodeExecParams ¶ms)
params.extract_input<float>("Text Box Height");
VFont *vfont = (VFont *)params.node().id;
- Curve cu = {{nullptr}};
+ LegacyCurve cu = {{nullptr}};
cu.type = OB_FONT;
/* Set defaults */
cu.resolu = 12;
@@ -233,7 +233,7 @@ static Map<int, int> create_curve_instances(GeoNodeExecParams ¶ms,
if (handles.contains(charcodes[i])) {
continue;
}
- Curve cu = {{nullptr}};
+ LegacyCurve cu = {{nullptr}};
cu.type = OB_FONT;
cu.resolu = 12;
cu.vfont = vfont;
Event Timeline
Jacques Lucke (JacquesLucke)
created this paste.
Dec 18 2021, 1:14 PM
Log In to Comment