Cleanup: Rename original curve object type enum

This commit renames enums related the "Curve" object type and ID type
to add `_LEGACY` to the end. The idea is to make our aspirations clearer
in the code and to avoid ambiguities between `CURVE` and `CURVES`.

Ref T95355

To summarize for the record, the plans are:
- In the short/medium term, replace the `Curve` object data type with
 `Curves`
- In the longer term (no immediate plans), use a proper data block for
  3D text and surfaces.

Differential Revision: https://developer.blender.org/D14114
This commit is contained in:
2022-02-18 09:50:29 -06:00
parent 48b17da1d9
commit ddf189892c
130 changed files with 466 additions and 427 deletions

View File

@@ -72,7 +72,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)) {
if (ob && ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
Curve *cu = ob->data;
return &cu->editnurb->nurbs;
}
@@ -1238,7 +1238,7 @@ void ED_curve_editnurb_load(Main *bmain, Object *obedit)
return;
}
if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
Curve *cu = obedit->data;
ListBase newnurb = {NULL, NULL}, oldnurb = cu->nurb;
@@ -1273,7 +1273,7 @@ void ED_curve_editnurb_make(Object *obedit)
EditNurb *editnurb = cu->editnurb;
KeyBlock *actkey;
if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
actkey = BKE_keyblock_from_object(obedit);
if (actkey) {
@@ -5637,7 +5637,7 @@ static int curve_extrude_exec(bContext *C, wmOperator *UNUSED(op))
}
/* First test: curve? */
if (obedit->type != OB_CURVE) {
if (obedit->type != OB_CURVES_LEGACY) {
LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) {
if ((nu->pntsv == 1) && (ED_curve_nurb_select_count(v3d, nu) < nu->pntsu)) {
as_curve = true;
@@ -5646,7 +5646,7 @@ static int curve_extrude_exec(bContext *C, wmOperator *UNUSED(op))
}
}
if (obedit->type == OB_CURVE || as_curve) {
if (obedit->type == OB_CURVES_LEGACY || as_curve) {
changed = ed_editcurve_extrude(cu, editnurb, v3d);
}
else {
@@ -6715,7 +6715,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
Object *obedit = objects[ob_index];
ListBase *editnurb = object_editcurve_get(obedit);
if (obedit->type != OB_CURVE) {
if (obedit->type != OB_CURVES_LEGACY) {
continue;
}
@@ -6874,7 +6874,7 @@ int ED_curve_join_objects_exec(bContext *C, wmOperator *op)
cu = ob_active->data;
BLI_movelisttolist(&cu->nurb, &tempbase);
if (ob_active->type == OB_CURVE && CU_IS_2D(cu)) {
if (ob_active->type == OB_CURVES_LEGACY && CU_IS_2D(cu)) {
/* Account for mixed 2D/3D curves when joining */
BKE_curve_dimension_update(cu);
}
@@ -6984,7 +6984,7 @@ static bool match_texture_space_poll(bContext *C)
{
Object *object = CTX_data_active_object(C);
return object && ELEM(object->type, OB_CURVE, OB_SURF, OB_FONT);
return object && ELEM(object->type, OB_CURVES_LEGACY, OB_SURF, OB_FONT);
}
static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op))