Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-02-18 18:50:29 +0300
committerHans Goudey <h.goudey@me.com>2022-02-18 18:50:29 +0300
commitddf189892c596d939228cc531b775bfd6708bb2d (patch)
treecb3b28527696ef5a6a3eec581a55e6141c2e686d /source/blender/editors/curve
parent48b17da1d9fe4d559c5b0fa58029df05a45d3960 (diff)
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
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c16
-rw-r--r--source/blender/editors/curve/editcurve_add.c32
-rw-r--r--source/blender/editors/curve/editcurve_undo.c2
3 files changed, 25 insertions, 25 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 20a2251b6e1..a33fbb29f85 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -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))
diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c
index 2aaebf494a6..d7201495f75 100644
--- a/source/blender/editors/curve/editcurve_add.c
+++ b/source/blender/editors/curve/editcurve_add.c
@@ -53,25 +53,25 @@ static const char *get_curve_defname(int type)
if ((type & CU_TYPE) == CU_BEZIER) {
switch (stype) {
case CU_PRIM_CURVE:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "BezierCurve");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "BezierCurve");
case CU_PRIM_CIRCLE:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "BezierCircle");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "BezierCircle");
case CU_PRIM_PATH:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "CurvePath");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "CurvePath");
default:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "Curve");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "Curve");
}
}
else {
switch (stype) {
case CU_PRIM_CURVE:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "NurbsCurve");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "NurbsCurve");
case CU_PRIM_CIRCLE:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "NurbsCircle");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "NurbsCircle");
case CU_PRIM_PATH:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "NurbsPath");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "NurbsPath");
default:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "Curve");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "Curve");
}
}
}
@@ -82,17 +82,17 @@ static const char *get_surf_defname(int type)
switch (stype) {
case CU_PRIM_CURVE:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "SurfCurve");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "SurfCurve");
case CU_PRIM_CIRCLE:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "SurfCircle");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "SurfCircle");
case CU_PRIM_PATCH:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "SurfPatch");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "SurfPatch");
case CU_PRIM_SPHERE:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "SurfSphere");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "SurfSphere");
case CU_PRIM_DONUT:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "SurfTorus");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "SurfTorus");
default:
- return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE, "Surface");
+ return CTX_DATA_(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "Surface");
}
}
@@ -510,11 +510,11 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
}
if (!isSurf) { /* adding curve */
- if (obedit == NULL || obedit->type != OB_CURVE) {
+ if (obedit == NULL || obedit->type != OB_CURVES_LEGACY) {
const char *name = get_curve_defname(type);
Curve *cu;
- obedit = ED_object_add_type(C, OB_CURVE, name, loc, rot, true, local_view_bits);
+ obedit = ED_object_add_type(C, OB_CURVES_LEGACY, name, loc, rot, true, local_view_bits);
newob = true;
cu = (Curve *)obedit->data;
diff --git a/source/blender/editors/curve/editcurve_undo.c b/source/blender/editors/curve/editcurve_undo.c
index 7b68c859b43..888bb2169e0 100644
--- a/source/blender/editors/curve/editcurve_undo.c
+++ b/source/blender/editors/curve/editcurve_undo.c
@@ -162,7 +162,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)) {
+ if (obedit && ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
Curve *cu = obedit->data;
if (BKE_curve_editNurbs_get(cu) != NULL) {
return obedit;