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:
parent
48b17da1d9
commit
ddf189892c
|
@ -230,7 +230,7 @@ extern IDTypeInfo IDType_ID_SCE;
|
|||
extern IDTypeInfo IDType_ID_LI;
|
||||
extern IDTypeInfo IDType_ID_OB;
|
||||
extern IDTypeInfo IDType_ID_ME;
|
||||
extern IDTypeInfo IDType_ID_CU;
|
||||
extern IDTypeInfo IDType_ID_CU_LEGACY;
|
||||
extern IDTypeInfo IDType_ID_MB;
|
||||
extern IDTypeInfo IDType_ID_MA;
|
||||
extern IDTypeInfo IDType_ID_TE;
|
||||
|
|
|
@ -1244,7 +1244,7 @@ void BKE_pose_update_constraint_flags(bPose *pose)
|
|||
/* if we have a valid target, make sure that this will get updated on frame-change
|
||||
* (needed for when there is no anim-data for this pose)
|
||||
*/
|
||||
if ((data->tar) && (data->tar->type == OB_CURVE)) {
|
||||
if ((data->tar) && (data->tar->type == OB_CURVES_LEGACY)) {
|
||||
pose->flag |= POSE_CONSTRAINTS_TIMEDEPEND;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ float BKE_anim_path_get_length(const CurveCache *curve_cache)
|
|||
|
||||
void BKE_anim_path_calc_data(Object *ob)
|
||||
{
|
||||
if (ob == NULL || ob->type != OB_CURVE) {
|
||||
if (ob == NULL || ob->type != OB_CURVES_LEGACY) {
|
||||
return;
|
||||
}
|
||||
if (ob->runtime.curve_cache == NULL) {
|
||||
|
@ -222,7 +222,7 @@ bool BKE_where_on_path(const Object *ob,
|
|||
float *r_radius,
|
||||
float *r_weight)
|
||||
{
|
||||
if (ob == NULL || ob->type != OB_CURVE) {
|
||||
if (ob == NULL || ob->type != OB_CURVES_LEGACY) {
|
||||
return false;
|
||||
}
|
||||
Curve *cu = ob->data;
|
||||
|
|
|
@ -70,7 +70,7 @@ static void splineik_init_tree_from_pchan(Scene *UNUSED(scene),
|
|||
ik_data = con->data;
|
||||
|
||||
/* Target can only be a curve. */
|
||||
if ((ik_data->tar == NULL) || (ik_data->tar->type != OB_CURVE)) {
|
||||
if ((ik_data->tar == NULL) || (ik_data->tar->type != OB_CURVES_LEGACY)) {
|
||||
continue;
|
||||
}
|
||||
/* Skip if disabled. */
|
||||
|
|
|
@ -1493,7 +1493,7 @@ static void followpath_get_tarmat(struct Depsgraph *UNUSED(depsgraph),
|
|||
{
|
||||
bFollowPathConstraint *data = con->data;
|
||||
|
||||
if (VALID_CONS_TARGET(ct) && (ct->tar->type == OB_CURVE)) {
|
||||
if (VALID_CONS_TARGET(ct) && (ct->tar->type == OB_CURVES_LEGACY)) {
|
||||
Curve *cu = ct->tar->data;
|
||||
float vec[4], dir[3], radius;
|
||||
float curvetime;
|
||||
|
@ -2479,7 +2479,7 @@ static void pycon_get_tarmat(struct Depsgraph *UNUSED(depsgraph),
|
|||
#endif
|
||||
|
||||
if (VALID_CONS_TARGET(ct)) {
|
||||
if (ct->tar->type == OB_CURVE && ct->tar->runtime.curve_cache == NULL) {
|
||||
if (ct->tar->type == OB_CURVES_LEGACY && ct->tar->runtime.curve_cache == NULL) {
|
||||
unit_m4(ct->matrix);
|
||||
return;
|
||||
}
|
||||
|
@ -3867,7 +3867,7 @@ static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar
|
|||
bConstraintTarget *ct = targets->first;
|
||||
|
||||
/* only evaluate if there is a target and it is a curve */
|
||||
if (VALID_CONS_TARGET(ct) && (ct->tar->type == OB_CURVE)) {
|
||||
if (VALID_CONS_TARGET(ct) && (ct->tar->type == OB_CURVES_LEGACY)) {
|
||||
float obmat[4][4], ownLoc[3];
|
||||
float curveMin[3], curveMax[3];
|
||||
float targetMatrix[4][4];
|
||||
|
|
|
@ -1148,7 +1148,7 @@ enum eContextObjectMode CTX_data_mode_enum_ex(const Object *obedit,
|
|||
switch (obedit->type) {
|
||||
case OB_MESH:
|
||||
return CTX_MODE_EDIT_MESH;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return CTX_MODE_EDIT_CURVE;
|
||||
case OB_SURF:
|
||||
return CTX_MODE_EDIT_SURFACE;
|
||||
|
|
|
@ -293,14 +293,14 @@ static void curve_blend_read_expand(BlendExpander *expander, ID *id)
|
|||
BLO_expand(expander, cu->textoncurve);
|
||||
}
|
||||
|
||||
IDTypeInfo IDType_ID_CU = {
|
||||
/* id_code */ ID_CU,
|
||||
/* id_filter */ FILTER_ID_CU,
|
||||
/* main_listbase_index */ INDEX_ID_CU,
|
||||
IDTypeInfo IDType_ID_CU_LEGACY = {
|
||||
/* id_code */ ID_CU_LEGACY,
|
||||
/* id_filter */ FILTER_ID_CU_LEGACY,
|
||||
/* main_listbase_index */ INDEX_ID_CU_LEGACY,
|
||||
/* struct_size */ sizeof(Curve),
|
||||
/* name */ "Curve",
|
||||
/* name_plural */ "curves",
|
||||
/* translation_context */ BLT_I18NCONTEXT_ID_CURVE,
|
||||
/* translation_context */ BLT_I18NCONTEXT_ID_CURVE_LEGACY,
|
||||
/* flags */ IDTYPE_FLAGS_APPEND_IS_REUSABLE,
|
||||
/* asset_type_info */ nullptr,
|
||||
|
||||
|
@ -406,7 +406,7 @@ Curve *BKE_curve_add(Main *bmain, const char *name, int type)
|
|||
Curve *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 = (Curve *)BKE_libblock_alloc(bmain, ID_CU_LEGACY, name, 0);
|
||||
|
||||
BKE_curve_init(cu, type);
|
||||
|
||||
|
@ -440,7 +440,7 @@ short BKE_curve_type_get(const Curve *cu)
|
|||
}
|
||||
|
||||
if (!cu->type) {
|
||||
type = OB_CURVE;
|
||||
type = OB_CURVES_LEGACY;
|
||||
|
||||
LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
|
||||
if (nu->pntsv > 1) {
|
||||
|
@ -473,7 +473,7 @@ void BKE_curve_type_test(Object *ob)
|
|||
{
|
||||
ob->type = BKE_curve_type_get((Curve *)ob->data);
|
||||
|
||||
if (ob->type == OB_CURVE) {
|
||||
if (ob->type == OB_CURVES_LEGACY) {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
if (CU_IS_2D(cu)) {
|
||||
BKE_curve_dimension_update(cu);
|
||||
|
|
|
@ -228,7 +228,7 @@ static void curve_bevel_make_from_object(const Curve *cu, ListBase *disp)
|
|||
if (cu->bevobj == NULL) {
|
||||
return;
|
||||
}
|
||||
if (cu->bevobj->type != OB_CURVE) {
|
||||
if (cu->bevobj->type != OB_CURVES_LEGACY) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ static Curve *curve_from_font_object(Object *object, Depsgraph *depsgraph)
|
|||
Object *evaluated_object = DEG_get_evaluated_object(depsgraph, object);
|
||||
BKE_vfont_to_curve_nubase(evaluated_object, FO_EDIT, &new_curve->nurb);
|
||||
|
||||
new_curve->type = OB_CURVE;
|
||||
new_curve->type = OB_CURVES_LEGACY;
|
||||
|
||||
new_curve->flag &= ~CU_3D;
|
||||
BKE_curve_dimension_update(new_curve);
|
||||
|
@ -55,7 +55,7 @@ static Curve *curve_from_curve_object(Object *object, Depsgraph *depsgraph, bool
|
|||
|
||||
Curve *BKE_curve_new_from_object(Object *object, Depsgraph *depsgraph, bool apply_modifiers)
|
||||
{
|
||||
if (!ELEM(object->type, OB_FONT, OB_CURVE)) {
|
||||
if (!ELEM(object->type, OB_FONT, OB_CURVES_LEGACY)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ static void curve_deform_coords_impl(const Object *ob_curve,
|
|||
bool use_dverts = false;
|
||||
int cd_dvert_offset;
|
||||
|
||||
if (ob_curve->type != OB_CURVE) {
|
||||
if (ob_curve->type != OB_CURVES_LEGACY) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -404,7 +404,7 @@ void BKE_curve_deform_co(const Object *ob_curve,
|
|||
CurveDeform cd;
|
||||
float quat[4];
|
||||
|
||||
if (ob_curve->type != OB_CURVE) {
|
||||
if (ob_curve->type != OB_CURVES_LEGACY) {
|
||||
unit_m3(r_mat);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -590,7 +590,7 @@ static float displist_calc_taper(Depsgraph *depsgraph,
|
|||
Object *taperobj,
|
||||
float fac)
|
||||
{
|
||||
if (taperobj == nullptr || taperobj->type != OB_CURVE) {
|
||||
if (taperobj == nullptr || taperobj->type != OB_CURVES_LEGACY) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
|
@ -1263,7 +1263,7 @@ static GeometrySet evaluate_curve_type_object(Depsgraph *depsgraph,
|
|||
const bool for_render,
|
||||
ListBase *r_dispbase)
|
||||
{
|
||||
BLI_assert(ELEM(ob->type, OB_CURVE, OB_FONT));
|
||||
BLI_assert(ELEM(ob->type, OB_CURVES_LEGACY, OB_FONT));
|
||||
const Curve *cu = (const Curve *)ob->data;
|
||||
|
||||
ListBase *deformed_nurbs = &ob->runtime.curve_cache->deformed_nurbs;
|
||||
|
@ -1473,7 +1473,7 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
|
|||
Object *ob,
|
||||
const bool for_render)
|
||||
{
|
||||
BLI_assert(ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT));
|
||||
BLI_assert(ELEM(ob->type, OB_SURF, OB_CURVES_LEGACY, OB_FONT));
|
||||
Curve &cow_curve = *(Curve *)ob->data;
|
||||
|
||||
BKE_object_free_derived_caches(ob);
|
||||
|
|
|
@ -143,7 +143,7 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef
|
|||
BLI_rng_srandom(eff->pd->rng, eff->pd->seed + cfra);
|
||||
}
|
||||
|
||||
if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type == OB_CURVE) {
|
||||
if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type == OB_CURVES_LEGACY) {
|
||||
Curve *cu = eff->ob->data;
|
||||
if (cu->flag & CU_PATH) {
|
||||
if (eff->ob->runtime.curve_cache == NULL ||
|
||||
|
@ -161,7 +161,7 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef
|
|||
}
|
||||
else if (eff->pd->shape == PFIELD_SHAPE_SURFACE) {
|
||||
eff->surmd = (SurfaceModifierData *)BKE_modifiers_findby_type(eff->ob, eModifierType_Surface);
|
||||
if (eff->ob->type == OB_CURVE) {
|
||||
if (eff->ob->type == OB_CURVES_LEGACY) {
|
||||
eff->flag |= PE_USE_NORMAL_DATA;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,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_ = (Curve *)BKE_id_new_nomain(ID_CU_LEGACY, nullptr);
|
||||
curve_for_render_->curve_eval = curve_;
|
||||
|
||||
return curve_for_render_;
|
||||
|
|
|
@ -632,7 +632,7 @@ bool BKE_object_has_geometry_set_instances(const Object *ob)
|
|||
is_instance = ob->type != OB_VOLUME;
|
||||
break;
|
||||
case GEO_COMPONENT_TYPE_CURVE:
|
||||
is_instance = !ELEM(ob->type, OB_CURVE, OB_FONT);
|
||||
is_instance = !ELEM(ob->type, OB_CURVES_LEGACY, OB_FONT);
|
||||
break;
|
||||
}
|
||||
if (is_instance) {
|
||||
|
|
|
@ -59,7 +59,7 @@ static void id_type_init(void)
|
|||
INIT_TYPE(ID_LI);
|
||||
INIT_TYPE(ID_OB);
|
||||
INIT_TYPE(ID_ME);
|
||||
INIT_TYPE(ID_CU);
|
||||
INIT_TYPE(ID_CU_LEGACY);
|
||||
INIT_TYPE(ID_MB);
|
||||
INIT_TYPE(ID_MA);
|
||||
INIT_TYPE(ID_TE);
|
||||
|
@ -215,7 +215,7 @@ uint64_t BKE_idtype_idcode_to_idfilter(const short idcode)
|
|||
CASE_IDFILTER(BR);
|
||||
CASE_IDFILTER(CA);
|
||||
CASE_IDFILTER(CF);
|
||||
CASE_IDFILTER(CU);
|
||||
CASE_IDFILTER(CU_LEGACY);
|
||||
CASE_IDFILTER(GD);
|
||||
CASE_IDFILTER(GR);
|
||||
CASE_IDFILTER(CV);
|
||||
|
@ -264,7 +264,7 @@ short BKE_idtype_idcode_from_idfilter(const uint64_t idfilter)
|
|||
CASE_IDFILTER(BR);
|
||||
CASE_IDFILTER(CA);
|
||||
CASE_IDFILTER(CF);
|
||||
CASE_IDFILTER(CU);
|
||||
CASE_IDFILTER(CU_LEGACY);
|
||||
CASE_IDFILTER(GD);
|
||||
CASE_IDFILTER(GR);
|
||||
CASE_IDFILTER(CV);
|
||||
|
@ -312,7 +312,7 @@ int BKE_idtype_idcode_to_index(const short idcode)
|
|||
CASE_IDINDEX(BR);
|
||||
CASE_IDINDEX(CA);
|
||||
CASE_IDINDEX(CF);
|
||||
CASE_IDINDEX(CU);
|
||||
CASE_IDINDEX(CU_LEGACY);
|
||||
CASE_IDINDEX(GD);
|
||||
CASE_IDINDEX(GR);
|
||||
CASE_IDINDEX(CV);
|
||||
|
@ -371,7 +371,7 @@ short BKE_idtype_idcode_from_index(const int index)
|
|||
CASE_IDCODE(BR);
|
||||
CASE_IDCODE(CA);
|
||||
CASE_IDCODE(CF);
|
||||
CASE_IDCODE(CU);
|
||||
CASE_IDCODE(CU_LEGACY);
|
||||
CASE_IDCODE(GD);
|
||||
CASE_IDCODE(GR);
|
||||
CASE_IDCODE(CV);
|
||||
|
|
|
@ -1090,7 +1090,7 @@ static char *get_rna_access(ID *id,
|
|||
propname = particle_adrcodes_to_paths(adrcode, &dummy_index);
|
||||
break;
|
||||
|
||||
case ID_CU: /* curve */
|
||||
case ID_CU_LEGACY: /* curve */
|
||||
/* this used to be a 'dummy' curve which got evaluated on the fly...
|
||||
* now we've got real var for this!
|
||||
*/
|
||||
|
|
|
@ -281,7 +281,7 @@ Key *BKE_key_add(Main *bmain, ID *id) /* common function */
|
|||
key->elemsize = sizeof(float[KEYELEM_FLOAT_LEN_COORD]);
|
||||
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
el = key->elemstr;
|
||||
|
||||
el[0] = KEYELEM_ELEM_SIZE_CURVE;
|
||||
|
@ -659,7 +659,7 @@ static bool key_pointer_size(const Key *key, const int mode, int *poinsize, int
|
|||
*ofs = sizeof(float[KEYELEM_FLOAT_LEN_COORD]);
|
||||
*poinsize = *ofs;
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
if (mode == KEY_MODE_BPOINT) {
|
||||
*ofs = sizeof(float[KEYELEM_FLOAT_LEN_BPOINT]);
|
||||
*step = KEYELEM_ELEM_LEN_BPOINT;
|
||||
|
@ -1524,7 +1524,7 @@ float *BKE_key_evaluate_object_ex(Object *ob, int *r_totelem, float *arr, size_t
|
|||
tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
||||
size = tot * sizeof(float[KEYELEM_FLOAT_LEN_COORD]);
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = ob->data;
|
||||
|
||||
tot = BKE_keyblock_curve_element_count(&cu->nurb);
|
||||
|
@ -1570,7 +1570,7 @@ float *BKE_key_evaluate_object_ex(Object *ob, int *r_totelem, float *arr, size_t
|
|||
MEM_freeN(weights);
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
cp_cu_key(ob->data, key, actkb, kb, 0, tot, out, tot);
|
||||
}
|
||||
}
|
||||
|
@ -1582,7 +1582,7 @@ float *BKE_key_evaluate_object_ex(Object *ob, int *r_totelem, float *arr, size_t
|
|||
else if (ob->type == OB_LATTICE) {
|
||||
do_latt_key(ob, key, out, tot);
|
||||
}
|
||||
else if (ob->type == OB_CURVE) {
|
||||
else if (ob->type == OB_CURVES_LEGACY) {
|
||||
do_curve_key(ob, key, out, tot);
|
||||
}
|
||||
else if (ob->type == OB_SURF) {
|
||||
|
@ -1714,7 +1714,7 @@ bool BKE_key_idtype_support(const short id_type)
|
|||
{
|
||||
switch (id_type) {
|
||||
case ID_ME:
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
case ID_LT:
|
||||
return true;
|
||||
default:
|
||||
|
@ -1729,7 +1729,7 @@ Key **BKE_key_from_id_p(ID *id)
|
|||
Mesh *me = (Mesh *)id;
|
||||
return &me->key;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *cu = (Curve *)id;
|
||||
if (cu->vfont == NULL) {
|
||||
return &cu->key;
|
||||
|
@ -2269,7 +2269,7 @@ void BKE_keyblock_update_from_vertcos(Object *ob, KeyBlock *kb, const float (*ve
|
|||
Lattice *lt = ob->data;
|
||||
BLI_assert((lt->pntsu * lt->pntsv * lt->pntsw) == kb->totelem);
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = ob->data;
|
||||
BLI_assert(BKE_keyblock_curve_element_count(&cu->nurb) == kb->totelem);
|
||||
}
|
||||
|
@ -2293,7 +2293,7 @@ void BKE_keyblock_update_from_vertcos(Object *ob, KeyBlock *kb, const float (*ve
|
|||
copy_v3_v3(fp, *co);
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
Nurb *nu;
|
||||
BezTriple *bezt;
|
||||
|
@ -2335,7 +2335,7 @@ void BKE_keyblock_convert_from_vertcos(Object *ob, KeyBlock *kb, const float (*v
|
|||
tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
||||
elemsize = lt->key->elemsize;
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
elemsize = cu->key->elemsize;
|
||||
tot = BKE_keyblock_curve_element_count(&cu->nurb);
|
||||
|
@ -2366,7 +2366,7 @@ float (*BKE_keyblock_convert_to_vertcos(Object *ob, KeyBlock *kb))[3]
|
|||
Lattice *lt = (Lattice *)ob->data;
|
||||
tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
tot = BKE_nurbList_verts_count(&cu->nurb);
|
||||
}
|
||||
|
@ -2383,7 +2383,7 @@ float (*BKE_keyblock_convert_to_vertcos(Object *ob, KeyBlock *kb))[3]
|
|||
copy_v3_v3(*co, fp);
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
Nurb *nu;
|
||||
BezTriple *bezt;
|
||||
|
@ -2422,7 +2422,7 @@ void BKE_keyblock_update_from_offset(Object *ob, KeyBlock *kb, const float (*ofs
|
|||
add_v3_v3(fp, *ofs);
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
Nurb *nu;
|
||||
BezTriple *bezt;
|
||||
|
|
|
@ -402,7 +402,7 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
|
|||
return FILTER_ID_ALL;
|
||||
case ID_ME:
|
||||
return FILTER_ID_ME | FILTER_ID_MA | FILTER_ID_IM;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return FILTER_ID_OB | FILTER_ID_MA | FILTER_ID_VF;
|
||||
case ID_MB:
|
||||
return FILTER_ID_MA;
|
||||
|
@ -418,7 +418,7 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
|
|||
return FILTER_ID_OB | FILTER_ID_IM;
|
||||
case ID_KE:
|
||||
/* Warning! key->from, could be more types in future? */
|
||||
return FILTER_ID_ME | FILTER_ID_CU | FILTER_ID_LT;
|
||||
return FILTER_ID_ME | FILTER_ID_CU_LEGACY | FILTER_ID_LT;
|
||||
case ID_SCR:
|
||||
return FILTER_ID_SCE;
|
||||
case ID_WO:
|
||||
|
@ -490,7 +490,7 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used)
|
|||
|
||||
/* Exception: ID_KE aren't available as filter_id. */
|
||||
if (id_type_used == ID_KE) {
|
||||
return ELEM(id_type_owner, ID_ME, ID_CU, ID_LT);
|
||||
return ELEM(id_type_owner, ID_ME, ID_CU_LEGACY, ID_LT);
|
||||
}
|
||||
|
||||
/* Exception: ID_SCR aren't available as filter_id. */
|
||||
|
|
|
@ -380,7 +380,7 @@ static void libblock_remap_data_postprocess_obdata_relink(Main *bmain, Object *o
|
|||
case ID_ME:
|
||||
multires_force_sculpt_rebuild(ob);
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
BKE_curve_type_test(ob);
|
||||
break;
|
||||
default:
|
||||
|
@ -573,7 +573,7 @@ static void libblock_remap_foreach_idpair_cb(ID *old_id, ID *new_id, void *user_
|
|||
bmain, NULL, (Collection *)old_id, (Collection *)new_id);
|
||||
break;
|
||||
case ID_ME:
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
case ID_MB:
|
||||
case ID_CV:
|
||||
case ID_PT:
|
||||
|
|
|
@ -563,7 +563,7 @@ ListBase *which_libbase(Main *bmain, short type)
|
|||
return &(bmain->objects);
|
||||
case ID_ME:
|
||||
return &(bmain->meshes);
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return &(bmain->curves);
|
||||
case ID_MB:
|
||||
return &(bmain->metaballs);
|
||||
|
@ -670,7 +670,7 @@ int set_listbasepointers(Main *bmain, ListBase *lb[/*INDEX_ID_MAX*/])
|
|||
|
||||
lb[INDEX_ID_CF] = &(bmain->cachefiles);
|
||||
lb[INDEX_ID_ME] = &(bmain->meshes);
|
||||
lb[INDEX_ID_CU] = &(bmain->curves);
|
||||
lb[INDEX_ID_CU_LEGACY] = &(bmain->curves);
|
||||
lb[INDEX_ID_MB] = &(bmain->metaballs);
|
||||
lb[INDEX_ID_CV] = &(bmain->hair_curves);
|
||||
lb[INDEX_ID_PT] = &(bmain->pointclouds);
|
||||
|
|
|
@ -313,7 +313,7 @@ Material ***BKE_object_material_array_p(Object *ob)
|
|||
Mesh *me = ob->data;
|
||||
return &(me->mat);
|
||||
}
|
||||
if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
|
||||
if (ELEM(ob->type, OB_CURVES_LEGACY, OB_FONT, OB_SURF)) {
|
||||
Curve *cu = ob->data;
|
||||
return &(cu->mat);
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ short *BKE_object_material_len_p(Object *ob)
|
|||
Mesh *me = ob->data;
|
||||
return &(me->totcol);
|
||||
}
|
||||
if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
|
||||
if (ELEM(ob->type, OB_CURVES_LEGACY, OB_FONT, OB_SURF)) {
|
||||
Curve *cu = ob->data;
|
||||
return &(cu->totcol);
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ Material ***BKE_id_material_array_p(ID *id)
|
|||
switch (GS(id->name)) {
|
||||
case ID_ME:
|
||||
return &(((Mesh *)id)->mat);
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return &(((Curve *)id)->mat);
|
||||
case ID_MB:
|
||||
return &(((MetaBall *)id)->mat);
|
||||
|
@ -407,7 +407,7 @@ short *BKE_id_material_len_p(ID *id)
|
|||
switch (GS(id->name)) {
|
||||
case ID_ME:
|
||||
return &(((Mesh *)id)->totcol);
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return &(((Curve *)id)->totcol);
|
||||
case ID_MB:
|
||||
return &(((MetaBall *)id)->totcol);
|
||||
|
@ -434,7 +434,7 @@ static void material_data_index_remove_id(ID *id, short index)
|
|||
case ID_ME:
|
||||
BKE_mesh_material_index_remove((Mesh *)id, index);
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
BKE_curve_material_index_remove((Curve *)id, index);
|
||||
break;
|
||||
case ID_MB:
|
||||
|
@ -468,7 +468,7 @@ bool BKE_object_material_slot_used(Object *object, short actcol)
|
|||
switch (GS(ob_data->name)) {
|
||||
case ID_ME:
|
||||
return BKE_mesh_material_index_used((Mesh *)ob_data, actcol - 1);
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return BKE_curve_material_index_used((Curve *)ob_data, actcol - 1);
|
||||
case ID_MB:
|
||||
/* Meta-elements don't support materials at the moment. */
|
||||
|
@ -489,7 +489,7 @@ static void material_data_index_clear_id(ID *id)
|
|||
case ID_ME:
|
||||
BKE_mesh_material_index_clear((Mesh *)id);
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
BKE_curve_material_index_clear((Curve *)id);
|
||||
break;
|
||||
case ID_MB:
|
||||
|
@ -1062,7 +1062,7 @@ void BKE_object_material_remap(Object *ob, const unsigned int *remap)
|
|||
if (ob->type == OB_MESH) {
|
||||
BKE_mesh_material_remap(ob->data, remap, ob->totcol);
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
|
||||
BKE_curve_material_remap(ob->data, remap, ob->totcol);
|
||||
}
|
||||
else if (ob->type == OB_GPENCIL) {
|
||||
|
@ -1314,7 +1314,7 @@ bool BKE_object_material_slot_remove(Main *bmain, Object *ob)
|
|||
}
|
||||
|
||||
/* check indices from mesh */
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
|
||||
material_data_index_remove_id((ID *)ob->data, actcol - 1);
|
||||
if (ob->runtime.curve_cache) {
|
||||
BKE_displist_free(&ob->runtime.curve_cache->disp);
|
||||
|
|
|
@ -739,14 +739,14 @@ 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);
|
||||
Curve *cu = BKE_curve_add(bmain, ob->id.name + 2, OB_CURVES_LEGACY);
|
||||
cu->flag |= CU_3D;
|
||||
|
||||
cu->nurb = nurblist;
|
||||
|
||||
id_us_min(&((Mesh *)ob->data)->id);
|
||||
ob->data = cu;
|
||||
ob->type = OB_CURVE;
|
||||
ob->type = OB_CURVES_LEGACY;
|
||||
|
||||
BKE_object_free_derived_caches(ob);
|
||||
}
|
||||
|
@ -886,7 +886,7 @@ static void object_for_curve_to_mesh_free(Object *temp_object)
|
|||
{
|
||||
/* Clear edit mode pointers that were explicitly copied to the temporary curve. */
|
||||
ID *final_object_data = static_cast<ID *>(temp_object->data);
|
||||
if (GS(final_object_data->name) == ID_CU) {
|
||||
if (GS(final_object_data->name) == ID_CU_LEGACY) {
|
||||
Curve &curve = *reinterpret_cast<Curve *>(final_object_data);
|
||||
curve.editfont = nullptr;
|
||||
curve.editnurb = nullptr;
|
||||
|
@ -901,7 +901,7 @@ static void object_for_curve_to_mesh_free(Object *temp_object)
|
|||
*/
|
||||
static void curve_to_mesh_eval_ensure(Object &object)
|
||||
{
|
||||
BLI_assert(GS(static_cast<ID *>(object.data)->name) == ID_CU);
|
||||
BLI_assert(GS(static_cast<ID *>(object.data)->name) == ID_CU_LEGACY);
|
||||
Curve &curve = *static_cast<Curve *>(object.data);
|
||||
/* Clear all modifiers for the bevel object.
|
||||
*
|
||||
|
@ -1110,7 +1110,7 @@ Mesh *BKE_mesh_new_from_object(Depsgraph *depsgraph,
|
|||
Mesh *new_mesh = nullptr;
|
||||
switch (object->type) {
|
||||
case OB_FONT:
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
new_mesh = mesh_new_from_curve_type_object(object);
|
||||
break;
|
||||
|
@ -1182,7 +1182,7 @@ Mesh *BKE_mesh_new_from_object_to_bmain(Main *bmain,
|
|||
Object *object,
|
||||
bool preserve_all_data_layers)
|
||||
{
|
||||
BLI_assert(ELEM(object->type, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_MESH));
|
||||
BLI_assert(ELEM(object->type, OB_FONT, OB_CURVES_LEGACY, OB_SURF, OB_MBALL, OB_MESH));
|
||||
|
||||
Mesh *mesh = BKE_mesh_new_from_object(depsgraph, object, preserve_all_data_layers, false);
|
||||
if (mesh == nullptr) {
|
||||
|
|
|
@ -668,7 +668,7 @@ ModifierData *BKE_modifiers_get_virtual_modifierlist(const Object *ob,
|
|||
virtualModifierData->amd.deformflag = ((bArmature *)(ob->parent->data))->deformflag;
|
||||
md = &virtualModifierData->amd.modifier;
|
||||
}
|
||||
else if (ob->parent->type == OB_CURVE && ob->partype == PARSKEL) {
|
||||
else if (ob->parent->type == OB_CURVES_LEGACY && ob->partype == PARSKEL) {
|
||||
virtualModifierData->cmd.object = ob->parent;
|
||||
virtualModifierData->cmd.defaxis = ob->trackflag + 1;
|
||||
virtualModifierData->cmd.modifier.next = md;
|
||||
|
|
|
@ -1385,8 +1385,14 @@ ModifierData *BKE_object_active_modifier(const Object *ob)
|
|||
|
||||
bool BKE_object_supports_modifiers(const Object *ob)
|
||||
{
|
||||
return (
|
||||
ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE, OB_POINTCLOUD, OB_VOLUME));
|
||||
return (ELEM(ob->type,
|
||||
OB_MESH,
|
||||
OB_CURVES_LEGACY,
|
||||
OB_SURF,
|
||||
OB_FONT,
|
||||
OB_LATTICE,
|
||||
OB_POINTCLOUD,
|
||||
OB_VOLUME));
|
||||
}
|
||||
|
||||
bool BKE_object_support_modifier_type_check(const Object *ob, int modifier_type)
|
||||
|
@ -1402,7 +1408,7 @@ bool BKE_object_support_modifier_type_check(const Object *ob, int modifier_type)
|
|||
if (ELEM(ob->type, OB_POINTCLOUD, OB_VOLUME, OB_CURVES)) {
|
||||
return (mti->modifyGeometrySet != nullptr);
|
||||
}
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_SURF, OB_FONT, OB_LATTICE)) {
|
||||
if (ob->type == OB_LATTICE && (mti->flags & eModifierTypeFlag_AcceptsVertexCosOnly) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1871,7 +1877,7 @@ bool BKE_object_is_in_editmode(const Object *ob)
|
|||
case OB_LATTICE:
|
||||
return ((Lattice *)ob->data)->editlatt != nullptr;
|
||||
case OB_SURF:
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return ((Curve *)ob->data)->editnurb != nullptr;
|
||||
case OB_GPENCIL:
|
||||
/* Grease Pencil object has no edit mode data. */
|
||||
|
@ -1893,7 +1899,7 @@ bool BKE_object_data_is_in_editmode(const ID *id)
|
|||
switch (type) {
|
||||
case ID_ME:
|
||||
return ((const Mesh *)id)->edit_mesh != nullptr;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return ((((const Curve *)id)->editnurb != nullptr) ||
|
||||
(((const Curve *)id)->editfont != nullptr));
|
||||
case ID_MB:
|
||||
|
@ -1919,7 +1925,7 @@ char *BKE_object_data_editmode_flush_ptr_get(struct ID *id)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
if (((Curve *)id)->vfont != nullptr) {
|
||||
EditFont *ef = ((Curve *)id)->editfont;
|
||||
if (ef != nullptr) {
|
||||
|
@ -2062,7 +2068,7 @@ static const char *get_obdata_defname(int type)
|
|||
switch (type) {
|
||||
case OB_MESH:
|
||||
return DATA_("Mesh");
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return DATA_("Curve");
|
||||
case OB_SURF:
|
||||
return DATA_("Surf");
|
||||
|
@ -2133,8 +2139,8 @@ void *BKE_object_obdata_add_from_type(Main *bmain, int type, const char *name)
|
|||
switch (type) {
|
||||
case OB_MESH:
|
||||
return BKE_mesh_add(bmain, name);
|
||||
case OB_CURVE:
|
||||
return BKE_curve_add(bmain, name, OB_CURVE);
|
||||
case OB_CURVES_LEGACY:
|
||||
return BKE_curve_add(bmain, name, OB_CURVES_LEGACY);
|
||||
case OB_SURF:
|
||||
return BKE_curve_add(bmain, name, OB_SURF);
|
||||
case OB_FONT:
|
||||
|
@ -2175,7 +2181,7 @@ int BKE_object_obdata_to_type(const ID *id)
|
|||
switch (GS(id->name)) {
|
||||
case ID_ME:
|
||||
return OB_MESH;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return BKE_curve_type_get((const Curve *)id);
|
||||
case ID_MB:
|
||||
return OB_MBALL;
|
||||
|
@ -2656,7 +2662,7 @@ Object *BKE_object_duplicate(Main *bmain, Object *ob, uint dupflag, uint duplica
|
|||
id_new = BKE_id_copy_for_duplicate(bmain, id_old, dupflag, copy_flags);
|
||||
}
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
if (dupflag & USER_DUP_CURVE) {
|
||||
id_new = BKE_id_copy_for_duplicate(bmain, id_old, dupflag, copy_flags);
|
||||
}
|
||||
|
@ -3220,7 +3226,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
|
|||
"object position can be wrong now");
|
||||
}
|
||||
}
|
||||
else if (ELEM(par->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(par->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
ListBase *nurb;
|
||||
|
||||
/* Unless there's some weird depsgraph failure the cache should exist. */
|
||||
|
@ -3293,7 +3299,7 @@ void BKE_object_get_parent_matrix(Object *ob, Object *par, float r_parentmat[4][
|
|||
switch (ob->partype & PARTYPE) {
|
||||
case PAROBJECT: {
|
||||
bool ok = false;
|
||||
if (par->type == OB_CURVE) {
|
||||
if (par->type == OB_CURVES_LEGACY) {
|
||||
if ((((Curve *)par->data)->flag & CU_PATH) && (ob_parcurve(ob, par, tmat))) {
|
||||
ok = true;
|
||||
}
|
||||
|
@ -3589,7 +3595,7 @@ BoundBox *BKE_object_boundbox_get(Object *ob)
|
|||
case OB_MESH:
|
||||
bb = BKE_mesh_boundbox_get(ob);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
case OB_FONT:
|
||||
bb = BKE_curve_boundbox_get(ob);
|
||||
|
@ -3758,7 +3764,7 @@ void BKE_object_minmax(Object *ob, float r_min[3], float r_max[3], const bool us
|
|||
bool changed = false;
|
||||
|
||||
switch (ob->type) {
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_FONT:
|
||||
case OB_SURF: {
|
||||
BoundBox bb = *BKE_curve_boundbox_get(ob);
|
||||
|
@ -4187,7 +4193,7 @@ bool BKE_object_obdata_texspace_get(Object *ob, char **r_texflag, float **r_loc,
|
|||
BKE_mesh_texspace_get_reference((Mesh *)ob->data, r_texflag, r_loc, r_size);
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
BKE_curve_texspace_ensure(cu);
|
||||
if (r_texflag) {
|
||||
|
@ -4555,7 +4561,7 @@ KeyBlock *BKE_object_shapekey_insert(Main *bmain,
|
|||
case OB_MESH:
|
||||
key = insert_meshkey(bmain, ob, name, from_mix);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
key = insert_curvekey(bmain, ob, name, from_mix);
|
||||
break;
|
||||
|
@ -4627,7 +4633,7 @@ bool BKE_object_shapekey_remove(Main *bmain, Object *ob, KeyBlock *kb)
|
|||
case OB_MESH:
|
||||
BKE_keyblock_convert_to_mesh(key->refkey, (Mesh *)ob->data);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
BKE_keyblock_convert_to_curve(
|
||||
key->refkey, (Curve *)ob->data, BKE_curve_nurbs_get((Curve *)ob->data));
|
||||
|
@ -4842,7 +4848,7 @@ int BKE_object_is_deform_modified(Scene *scene, Object *ob)
|
|||
flag |= eModifierMode_Realtime | eModifierMode_Render;
|
||||
}
|
||||
|
||||
if (ob->type == OB_CURVE) {
|
||||
if (ob->type == OB_CURVES_LEGACY) {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
if (cu->taperobj != nullptr && object_deforms_in_time(cu->taperobj)) {
|
||||
flag |= eModifierMode_Realtime | eModifierMode_Render;
|
||||
|
@ -4919,7 +4925,7 @@ bool BKE_object_supports_material_slots(struct Object *ob)
|
|||
{
|
||||
return ELEM(ob->type,
|
||||
OB_MESH,
|
||||
OB_CURVE,
|
||||
OB_CURVES_LEGACY,
|
||||
OB_SURF,
|
||||
OB_FONT,
|
||||
OB_MBALL,
|
||||
|
@ -5153,7 +5159,7 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot)
|
|||
BLI_kdtree_3d_balance(tree);
|
||||
break;
|
||||
}
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF: {
|
||||
/* TODO: take deformation into account */
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
|
@ -5460,7 +5466,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) {
|
||||
if (ob->type == OB_CURVES_LEGACY) {
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
BKE_animsys_evaluate_animdata(
|
||||
&cu->id, cu->adt, &anim_eval_context, ADT_RECALC_ANIM, flush_to_original);
|
||||
|
|
|
@ -851,7 +851,7 @@ static void make_duplis_geometry_set_impl(const DupliContext *ctx,
|
|||
dupli->ob_data = (ID *)volume;
|
||||
}
|
||||
}
|
||||
if (!ELEM(ctx->object->type, OB_CURVE, OB_FONT) || geometry_set_is_instance) {
|
||||
if (!ELEM(ctx->object->type, OB_CURVES_LEGACY, 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();
|
||||
|
|
|
@ -181,7 +181,7 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o
|
|||
BKE_displist_make_mball(depsgraph, scene, ob);
|
||||
break;
|
||||
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
case OB_FONT: {
|
||||
bool for_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER);
|
||||
|
@ -300,7 +300,7 @@ void BKE_object_data_batch_cache_dirty_tag(ID *object_data)
|
|||
BKE_lattice_batch_cache_dirty_tag((struct Lattice *)object_data,
|
||||
BKE_LATTICE_BATCH_DIRTY_ALL);
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
BKE_curve_batch_cache_dirty_tag((struct Curve *)object_data, BKE_CURVE_BATCH_DIRTY_ALL);
|
||||
break;
|
||||
case ID_MB:
|
||||
|
@ -364,7 +364,7 @@ void BKE_object_data_select_update(Depsgraph *depsgraph, ID *object_data)
|
|||
case ID_ME:
|
||||
BKE_mesh_batch_cache_dirty_tag((Mesh *)object_data, BKE_MESH_BATCH_DIRTY_SELECT);
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
BKE_curve_batch_cache_dirty_tag((Curve *)object_data, BKE_CURVE_BATCH_DIRTY_SELECT);
|
||||
break;
|
||||
case ID_LT:
|
||||
|
|
|
@ -2967,7 +2967,7 @@ static void curve_surf_to_softbody(Object *ob)
|
|||
totvert = BKE_nurbList_verts_count(&cu->nurb);
|
||||
|
||||
if (ob->softflag & OB_SB_EDGES) {
|
||||
if (ob->type == OB_CURVE) {
|
||||
if (ob->type == OB_CURVES_LEGACY) {
|
||||
totspring = totvert - BLI_listbase_count(&cu->nurb);
|
||||
}
|
||||
}
|
||||
|
@ -3320,7 +3320,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
|
|||
break;
|
||||
case OB_LATTICE:
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
break;
|
||||
default:
|
||||
|
@ -3537,7 +3537,7 @@ void sbObjectStep(struct Depsgraph *depsgraph,
|
|||
case OB_LATTICE:
|
||||
lattice_to_softbody(ob);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
curve_surf_to_softbody(ob);
|
||||
break;
|
||||
|
|
|
@ -1302,8 +1302,8 @@ static bool vfont_to_curve(Object *ob,
|
|||
MEM_freeN(i_textbox_array);
|
||||
|
||||
/* TEXT ON CURVE */
|
||||
/* NOTE: Only OB_CURVE objects could have a path. */
|
||||
if (cu->textoncurve && cu->textoncurve->type == OB_CURVE) {
|
||||
/* NOTE: Only OB_CURVES_LEGACY objects could have a path. */
|
||||
if (cu->textoncurve && cu->textoncurve->type == OB_CURVES_LEGACY) {
|
||||
BLI_assert(cu->textoncurve->runtime.curve_cache != NULL);
|
||||
if (cu->textoncurve->runtime.curve_cache != NULL &&
|
||||
cu->textoncurve->runtime.curve_cache->anim_path_accum_length != NULL) {
|
||||
|
|
|
@ -2913,7 +2913,7 @@ static const char *dataname(short id_code)
|
|||
return "Data from MA";
|
||||
case ID_TE:
|
||||
return "Data from TE";
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return "Data from CU";
|
||||
case ID_GR:
|
||||
return "Data from GR";
|
||||
|
|
|
@ -1644,7 +1644,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||
BLI_addtail((ListBase *)&ob->modifiers, lmd);
|
||||
ob->partype = PAROBJECT;
|
||||
}
|
||||
else if (parent->type == OB_CURVE && ob->partype == PARCURVE) {
|
||||
else if (parent->type == OB_CURVES_LEGACY && ob->partype == PARCURVE) {
|
||||
CurveModifierData *cmd;
|
||||
|
||||
cmd = (CurveModifierData *)BKE_modifier_new(eModifierType_Curve);
|
||||
|
|
|
@ -1356,7 +1356,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||
bFollowPathConstraint *data = con->data;
|
||||
Object *obc = blo_do_versions_newlibadr(fd, lib, data->tar);
|
||||
|
||||
if (obc && obc->type == OB_CURVE) {
|
||||
if (obc && obc->type == OB_CURVES_LEGACY) {
|
||||
Curve *cu = blo_do_versions_newlibadr(fd, lib, obc->data);
|
||||
if (cu) {
|
||||
cu->flag |= CU_PATH;
|
||||
|
|
|
@ -92,7 +92,7 @@ bool BLT_lang_is_ime_supported(void);
|
|||
#define BLT_I18NCONTEXT_ID_CAMERA "Camera"
|
||||
#define BLT_I18NCONTEXT_ID_CACHEFILE "CacheFile"
|
||||
#define BLT_I18NCONTEXT_ID_COLLECTION "Collection"
|
||||
#define BLT_I18NCONTEXT_ID_CURVE "Curve"
|
||||
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY "Curve"
|
||||
#define BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE "FreestyleLineStyle"
|
||||
#define BLT_I18NCONTEXT_ID_GPENCIL "GPencil"
|
||||
#define BLT_I18NCONTEXT_ID_CURVES "Curves"
|
||||
|
@ -154,7 +154,7 @@ typedef struct {
|
|||
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_CAMERA, "id_camera"), \
|
||||
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_CACHEFILE, "id_cachefile"), \
|
||||
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_COLLECTION, "id_collection"), \
|
||||
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_CURVE, "id_curve"), \
|
||||
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_CURVE_LEGACY, "id_curve"), \
|
||||
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE, "id_fs_linestyle"), \
|
||||
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_GPENCIL, "id_gpencil"), \
|
||||
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_CURVES, "id_curves"), \
|
||||
|
|
|
@ -580,7 +580,7 @@ void DepsgraphNodeBuilder::build_id(ID *id)
|
|||
break;
|
||||
case ID_ME:
|
||||
case ID_MB:
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
case ID_LT:
|
||||
case ID_GD:
|
||||
case ID_CV:
|
||||
|
@ -872,7 +872,7 @@ void DepsgraphNodeBuilder::build_object_data(Object *object)
|
|||
/* type-specific data. */
|
||||
switch (object->type) {
|
||||
case OB_MESH:
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_FONT:
|
||||
case OB_SURF:
|
||||
case OB_MBALL:
|
||||
|
@ -1504,7 +1504,7 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata)
|
|||
op_node->set_as_entry();
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
op_node = add_operation_node(obdata,
|
||||
NodeType::GEOMETRY,
|
||||
OperationCode::GEOMETRY_EVAL,
|
||||
|
|
|
@ -221,7 +221,8 @@ OperationCode bone_target_opcode(ID *target,
|
|||
|
||||
bool object_have_geometry_component(const Object *object)
|
||||
{
|
||||
return ELEM(object->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL, OB_LATTICE, OB_GPENCIL);
|
||||
return ELEM(
|
||||
object->type, OB_MESH, OB_CURVES_LEGACY, OB_FONT, OB_SURF, OB_MBALL, OB_LATTICE, OB_GPENCIL);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -537,7 +538,7 @@ void DepsgraphRelationBuilder::build_id(ID *id)
|
|||
break;
|
||||
case ID_ME:
|
||||
case ID_MB:
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
case ID_LT:
|
||||
case ID_CV:
|
||||
case ID_PT:
|
||||
|
@ -827,7 +828,7 @@ void DepsgraphRelationBuilder::build_object_data(Object *object)
|
|||
/* type-specific data. */
|
||||
switch (object->type) {
|
||||
case OB_MESH:
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_FONT:
|
||||
case OB_SURF:
|
||||
case OB_MBALL:
|
||||
|
@ -983,7 +984,7 @@ void DepsgraphRelationBuilder::build_object_parent(Object *object)
|
|||
add_relation(parent_key, object_transform_key, "Lattice Deform Parent");
|
||||
add_relation(geom_key, object_transform_key, "Lattice Deform Parent Geom");
|
||||
}
|
||||
else if (object->parent->type == OB_CURVE) {
|
||||
else if (object->parent->type == OB_CURVES_LEGACY) {
|
||||
Curve *cu = (Curve *)object->parent->data;
|
||||
|
||||
if (cu->flag & CU_PATH) {
|
||||
|
@ -2040,7 +2041,7 @@ void DepsgraphRelationBuilder::build_shapekeys(Key *key)
|
|||
* Therefore, each user of a piece of shared geometry data ends up evaluating
|
||||
* its own version of the stuff, complete with whatever modifiers it may use.
|
||||
*
|
||||
* - The data-blocks for the geometry data - "obdata" (e.g. ID_ME, ID_CU, ID_LT.)
|
||||
* - The data-blocks for the geometry data - "obdata" (e.g. ID_ME, ID_CU_LEGACY, ID_LT.)
|
||||
* are used for
|
||||
* 1) calculating the bounding boxes of the geometry data,
|
||||
* 2) aggregating inward links from other objects (e.g. for text on curve)
|
||||
|
@ -2125,7 +2126,7 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
|
|||
/* Materials. */
|
||||
build_materials(object->mat, object->totcol);
|
||||
/* Geometry collision. */
|
||||
if (ELEM(object->type, OB_MESH, OB_CURVE, OB_LATTICE)) {
|
||||
if (ELEM(object->type, OB_MESH, OB_CURVES_LEGACY, OB_LATTICE)) {
|
||||
// add geometry collider relations
|
||||
}
|
||||
/* Make sure uber update is the last in the dependencies. */
|
||||
|
@ -2220,7 +2221,7 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
|
|||
break;
|
||||
case ID_MB:
|
||||
break;
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *cu = (Curve *)obdata;
|
||||
if (cu->bevobj != nullptr) {
|
||||
ComponentKey bevob_geom_key(&cu->bevobj->id, NodeType::GEOMETRY);
|
||||
|
|
|
@ -71,7 +71,7 @@ void depsgraph_geometry_tag_to_component(const ID *id, NodeType *component_type)
|
|||
|
||||
bool is_selectable_data_id_type(const ID_Type id_type)
|
||||
{
|
||||
return ELEM(id_type, ID_ME, ID_CU, ID_MB, ID_LT, ID_GD, ID_CV, ID_PT, ID_VO);
|
||||
return ELEM(id_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_GD, ID_CV, ID_PT, ID_VO);
|
||||
}
|
||||
|
||||
void depsgraph_select_tag_to_component_opcode(const ID *id,
|
||||
|
@ -332,7 +332,7 @@ void deg_graph_id_tag_legacy_compat(
|
|||
}
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *curve = (Curve *)id;
|
||||
if (curve->key != nullptr) {
|
||||
ID *key_id = &curve->key->id;
|
||||
|
@ -569,7 +569,7 @@ NodeType geometry_tag_to_component(const ID *id)
|
|||
const Object *object = (Object *)id;
|
||||
switch (object->type) {
|
||||
case OB_MESH:
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
case OB_FONT:
|
||||
case OB_LATTICE:
|
||||
|
@ -586,7 +586,7 @@ NodeType geometry_tag_to_component(const ID *id)
|
|||
break;
|
||||
}
|
||||
case ID_ME:
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
case ID_LT:
|
||||
case ID_MB:
|
||||
case ID_CV:
|
||||
|
|
|
@ -125,7 +125,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_LEGACY, Curve, key)
|
||||
SPECIAL_CASE(ID_LT, Lattice, key)
|
||||
SPECIAL_CASE(ID_ME, Mesh, key)
|
||||
|
||||
|
@ -174,7 +174,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_LEGACY, Curve, key, curve)
|
||||
SPECIAL_CASE(ID_LT, Lattice, key, lattice)
|
||||
SPECIAL_CASE(ID_ME, Mesh, key, mesh)
|
||||
|
||||
|
@ -214,7 +214,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_LEGACY, Curve, key)
|
||||
SPECIAL_CASE(ID_LT, Lattice, key)
|
||||
SPECIAL_CASE(ID_ME, Mesh, key)
|
||||
|
||||
|
@ -252,7 +252,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_LEGACY, Curve, key, Key)
|
||||
SPECIAL_CASE(ID_LT, Lattice, key, Key)
|
||||
SPECIAL_CASE(ID_ME, Mesh, key, Key)
|
||||
|
||||
|
@ -578,7 +578,7 @@ void update_edit_mode_pointers(const Depsgraph *depsgraph, const ID *id_orig, ID
|
|||
case ID_ME:
|
||||
update_mesh_edit_mode_pointers(id_orig, id_cow);
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
update_curve_edit_mode_pointers(depsgraph, id_orig, id_cow);
|
||||
break;
|
||||
case ID_MB:
|
||||
|
@ -953,7 +953,7 @@ void discard_edit_mode_pointers(ID *id_cow)
|
|||
case ID_ME:
|
||||
discard_mesh_edit_mode_pointers(id_cow);
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
discard_curve_edit_mode_pointers(id_cow);
|
||||
break;
|
||||
case ID_MB:
|
||||
|
|
|
@ -81,7 +81,7 @@ void ObjectRuntimeBackup::restore_to_object(Object *object)
|
|||
object->runtime = runtime;
|
||||
object->runtime.data_orig = data_orig;
|
||||
object->runtime.bb = bb;
|
||||
if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_CURVE, OB_FONT) && data_eval != nullptr) {
|
||||
if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_CURVES_LEGACY, OB_FONT) && data_eval != nullptr) {
|
||||
if (object->id.recalc & ID_RECALC_GEOMETRY) {
|
||||
/* If geometry is tagged for update it means, that part of
|
||||
* evaluated mesh are not valid anymore. In this case we can not
|
||||
|
|
|
@ -212,7 +212,7 @@ BLI_INLINE OVERLAY_DupliData *OVERLAY_duplidata_get(Object *ob, void *vedata, bo
|
|||
{
|
||||
OVERLAY_DupliData **dupli_data = (OVERLAY_DupliData **)DRW_duplidata_get(vedata);
|
||||
*do_init = false;
|
||||
if (!ELEM(ob->type, OB_MESH, OB_SURF, OB_LATTICE, OB_CURVE, OB_FONT)) {
|
||||
if (!ELEM(ob->type, OB_MESH, OB_SURF, OB_LATTICE, OB_CURVES_LEGACY, OB_FONT)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,7 @@ static bool overlay_object_is_edit_mode(const OVERLAY_PrivateData *pd, const Obj
|
|||
return pd->ctx_mode == CTX_MODE_EDIT_MESH;
|
||||
case OB_ARMATURE:
|
||||
return pd->ctx_mode == CTX_MODE_EDIT_ARMATURE;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return pd->ctx_mode == CTX_MODE_EDIT_CURVE;
|
||||
case OB_SURF:
|
||||
return pd->ctx_mode == CTX_MODE_EDIT_SURFACE;
|
||||
|
@ -298,7 +298,7 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
|
|||
(ob->sculpt->mode_type == OB_MODE_SCULPT);
|
||||
const bool has_surface = ELEM(ob->type,
|
||||
OB_MESH,
|
||||
OB_CURVE,
|
||||
OB_CURVES_LEGACY,
|
||||
OB_SURF,
|
||||
OB_MBALL,
|
||||
OB_FONT,
|
||||
|
@ -368,7 +368,7 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
|
|||
OVERLAY_edit_armature_cache_populate(vedata, ob);
|
||||
}
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
OVERLAY_edit_curve_cache_populate(vedata, ob);
|
||||
break;
|
||||
case OB_SURF:
|
||||
|
|
|
@ -456,7 +456,7 @@ static void OVERLAY_texture_space(OVERLAY_ExtraCallBuffers *cb, Object *ob, cons
|
|||
case ID_ME:
|
||||
BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, &texcosize);
|
||||
break;
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *cu = (Curve *)ob_data;
|
||||
BKE_curve_texspace_ensure(cu);
|
||||
texcoloc = cu->loc;
|
||||
|
@ -499,7 +499,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;
|
||||
Curve *cu = (ob->type == OB_CURVES_LEGACY) ? ob->data : NULL;
|
||||
|
||||
union {
|
||||
float mat[4][4];
|
||||
|
|
|
@ -196,14 +196,14 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
|
|||
}
|
||||
}
|
||||
|
||||
if (ELEM(ob->type, OB_CURVE, OB_FONT, OB_SURF)) {
|
||||
if (ELEM(ob->type, OB_CURVES_LEGACY, OB_FONT, OB_SURF)) {
|
||||
OVERLAY_ExtraCallBuffers *cb = OVERLAY_extra_call_buffer_get(vedata, ob);
|
||||
float *color;
|
||||
DRW_object_wire_theme_get(ob, draw_ctx->view_layer, &color);
|
||||
|
||||
struct GPUBatch *geom = NULL;
|
||||
switch (ob->type) {
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
geom = DRW_cache_curve_edge_wire_get(ob);
|
||||
break;
|
||||
case OB_FONT:
|
||||
|
|
|
@ -225,7 +225,7 @@ void select_id_draw_object(void *vedata,
|
|||
stl, ob, select_mode, initial_offset, r_vert_offset, r_edge_offset, r_face_offset);
|
||||
}
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -813,7 +813,7 @@ GPUBatch *DRW_cache_object_edge_detection_get(Object *ob, bool *r_is_manifold)
|
|||
switch (ob->type) {
|
||||
case OB_MESH:
|
||||
return DRW_cache_mesh_edge_detection_get(ob, r_is_manifold);
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return NULL;
|
||||
case OB_SURF:
|
||||
return DRW_cache_surf_edge_detection_get(ob, r_is_manifold);
|
||||
|
@ -837,7 +837,7 @@ GPUBatch *DRW_cache_object_face_wireframe_get(Object *ob)
|
|||
switch (ob->type) {
|
||||
case OB_MESH:
|
||||
return DRW_cache_mesh_face_wireframe_get(ob);
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return NULL;
|
||||
case OB_SURF:
|
||||
return DRW_cache_surf_face_wireframe_get(ob);
|
||||
|
@ -864,7 +864,7 @@ GPUBatch *DRW_cache_object_loose_edges_get(struct Object *ob)
|
|||
switch (ob->type) {
|
||||
case OB_MESH:
|
||||
return DRW_cache_mesh_loose_edges_get(ob);
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return NULL;
|
||||
case OB_SURF:
|
||||
return DRW_cache_surf_loose_edges_get(ob);
|
||||
|
@ -888,7 +888,7 @@ GPUBatch *DRW_cache_object_surface_get(Object *ob)
|
|||
switch (ob->type) {
|
||||
case OB_MESH:
|
||||
return DRW_cache_mesh_surface_get(ob);
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return NULL;
|
||||
case OB_SURF:
|
||||
return DRW_cache_surf_surface_get(ob);
|
||||
|
@ -915,7 +915,7 @@ GPUVertBuf *DRW_cache_object_pos_vertbuf_get(Object *ob)
|
|||
switch (type) {
|
||||
case OB_MESH:
|
||||
return DRW_mesh_batch_cache_pos_vertbuf_get((me != NULL) ? me : ob->data);
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
case OB_FONT:
|
||||
return DRW_curve_batch_cache_pos_vertbuf_get(ob->data);
|
||||
|
@ -947,7 +947,7 @@ int DRW_cache_object_material_count_get(struct Object *ob)
|
|||
switch (type) {
|
||||
case OB_MESH:
|
||||
return DRW_mesh_material_count_get(ob, (me != NULL) ? me : ob->data);
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
case OB_FONT:
|
||||
return DRW_curve_material_count_get(ob->data);
|
||||
|
@ -972,7 +972,7 @@ GPUBatch **DRW_cache_object_surface_material_get(struct Object *ob,
|
|||
switch (ob->type) {
|
||||
case OB_MESH:
|
||||
return DRW_cache_mesh_surface_shaded_get(ob, gpumat_array, gpumat_array_len);
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return NULL;
|
||||
case OB_SURF:
|
||||
return DRW_cache_surf_surface_shaded_get(ob, gpumat_array, gpumat_array_len);
|
||||
|
@ -2922,21 +2922,21 @@ 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);
|
||||
BLI_assert(ob->type == OB_CURVES_LEGACY);
|
||||
struct Curve *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);
|
||||
BLI_assert(ob->type == OB_CURVES_LEGACY);
|
||||
struct Curve *cu = ob->data;
|
||||
return DRW_curve_batch_cache_get_normal_edge(cu);
|
||||
}
|
||||
|
||||
GPUBatch *DRW_cache_curve_edge_overlay_get(Object *ob)
|
||||
{
|
||||
BLI_assert(ELEM(ob->type, OB_CURVE, OB_SURF));
|
||||
BLI_assert(ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF));
|
||||
|
||||
struct Curve *cu = ob->data;
|
||||
return DRW_curve_batch_cache_get_edit_edges(cu);
|
||||
|
@ -2944,7 +2944,7 @@ GPUBatch *DRW_cache_curve_edge_overlay_get(Object *ob)
|
|||
|
||||
GPUBatch *DRW_cache_curve_vert_overlay_get(Object *ob)
|
||||
{
|
||||
BLI_assert(ELEM(ob->type, OB_CURVE, OB_SURF));
|
||||
BLI_assert(ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF));
|
||||
|
||||
struct Curve *cu = ob->data;
|
||||
return DRW_curve_batch_cache_get_edit_verts(cu);
|
||||
|
@ -3373,7 +3373,7 @@ void drw_batch_cache_validate(Object *ob)
|
|||
case OB_MESH:
|
||||
DRW_mesh_batch_cache_validate(ob, (Mesh *)ob->data);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_FONT:
|
||||
DRW_curve_batch_cache_validate((Curve *)ob->data);
|
||||
break;
|
||||
|
@ -3423,7 +3423,7 @@ void drw_batch_cache_generate_requested(Object *ob)
|
|||
DRW_mesh_batch_cache_create_requested(
|
||||
DST.task_graph, ob, (Mesh *)ob->data, scene, is_paint_mode, use_hide);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_FONT:
|
||||
DRW_curve_batch_cache_create_requested(ob, scene);
|
||||
break;
|
||||
|
|
|
@ -945,7 +945,7 @@ int DRW_curve_material_count_get(Curve *cu)
|
|||
|
||||
void DRW_curve_batch_cache_create_requested(Object *ob, const struct Scene *scene)
|
||||
{
|
||||
BLI_assert(ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT));
|
||||
BLI_assert(ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF, OB_FONT));
|
||||
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
CurveBatchCache *cache = curve_batch_cache_get(cu);
|
||||
|
|
|
@ -412,7 +412,7 @@ bool DRW_object_is_flat(Object *ob, int *r_axis)
|
|||
|
||||
if (!ELEM(ob->type,
|
||||
OB_MESH,
|
||||
OB_CURVE,
|
||||
OB_CURVES_LEGACY,
|
||||
OB_SURF,
|
||||
OB_FONT,
|
||||
OB_MBALL,
|
||||
|
|
|
@ -2774,7 +2774,7 @@ void DRW_draw_depth_object(
|
|||
GPU_uniformbuf_free(ubo);
|
||||
|
||||
} break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -514,7 +514,7 @@ static void drw_call_calc_orco(Object *ob, float (*r_orcofacs)[4])
|
|||
case ID_ME:
|
||||
BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, &texcosize);
|
||||
break;
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *cu = (Curve *)ob_data;
|
||||
BKE_curve_texspace_ensure(cu);
|
||||
texcoloc = cu->loc;
|
||||
|
@ -566,7 +566,7 @@ static void drw_call_obinfos_init(DRWObjectInfos *ob_infos, Object *ob)
|
|||
drw_call_calc_orco(ob, ob_infos->orcotexfac);
|
||||
/* Random float value. */
|
||||
uint random = (DST.dupli_source) ?
|
||||
DST.dupli_source->random_id :
|
||||
DST.dupli_source->random_id :
|
||||
/* TODO(fclem): this is rather costly to do at runtime. Maybe we can
|
||||
* put it in ob->runtime and make depsgraph ensure it is up to date. */
|
||||
BLI_hash_int_2d(BLI_hash_string(ob->id.name + 2), 0);
|
||||
|
|
|
@ -668,7 +668,7 @@ static int acf_object_icon(bAnimListElem *ale)
|
|||
return ICON_OUTLINER_OB_MESH;
|
||||
case OB_CAMERA:
|
||||
return ICON_OUTLINER_OB_CAMERA;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
return ICON_OUTLINER_OB_CURVE;
|
||||
case OB_MBALL:
|
||||
return ICON_OUTLINER_OB_META;
|
||||
|
|
|
@ -2530,9 +2530,9 @@ static size_t animdata_filter_ds_obdata(
|
|||
expanded = FILTER_LAM_OBJD(la);
|
||||
break;
|
||||
}
|
||||
case OB_CURVE: /* ------- Curve ---------- */
|
||||
case OB_SURF: /* ------- Nurbs Surface ---------- */
|
||||
case OB_FONT: /* ------- Text Curve ---------- */
|
||||
case OB_CURVES_LEGACY: /* ------- Curve ---------- */
|
||||
case OB_SURF: /* ------- Nurbs Surface ---------- */
|
||||
case OB_FONT: /* ------- Text Curve ---------- */
|
||||
{
|
||||
Curve *cu = (Curve *)ob->data;
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1300,8 +1300,8 @@ static void gpencil_layer_to_curve(bContext *C,
|
|||
/* init the curve object (remove rotation and get curve data from it)
|
||||
* - must clear transforms set on object, as those skew our results
|
||||
*/
|
||||
ob = BKE_object_add_only_object(bmain, OB_CURVE, gpl->info);
|
||||
cu = ob->data = BKE_curve_add(bmain, gpl->info, OB_CURVE);
|
||||
ob = BKE_object_add_only_object(bmain, OB_CURVES_LEGACY, gpl->info);
|
||||
cu = ob->data = BKE_curve_add(bmain, gpl->info, OB_CURVES_LEGACY);
|
||||
BKE_collection_object_add(bmain, collection, ob);
|
||||
base_new = BKE_view_layer_base_find(view_layer, ob);
|
||||
DEG_relations_tag_update(bmain); /* added object */
|
||||
|
|
|
@ -2271,7 +2271,7 @@ int UI_icon_from_idcode(const int idcode)
|
|||
return ICON_CAMERA_DATA;
|
||||
case ID_CF:
|
||||
return ICON_FILE;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return ICON_CURVE_DATA;
|
||||
case ID_GD:
|
||||
return ICON_OUTLINER_DATA_GREASEPENCIL;
|
||||
|
|
|
@ -731,7 +731,7 @@ static const char *template_id_browse_tip(const StructRNA *type)
|
|||
return N_("Browse Object to be linked");
|
||||
case ID_ME:
|
||||
return N_("Browse Mesh Data to be linked");
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
return N_("Browse Curve Data to be linked");
|
||||
case ID_MB:
|
||||
return N_("Browse Metaball Data to be linked");
|
||||
|
@ -844,7 +844,7 @@ static uiBut *template_id_def_new_but(uiBlock *block,
|
|||
BLT_I18NCONTEXT_ID_SCENE,
|
||||
BLT_I18NCONTEXT_ID_OBJECT,
|
||||
BLT_I18NCONTEXT_ID_MESH,
|
||||
BLT_I18NCONTEXT_ID_CURVE,
|
||||
BLT_I18NCONTEXT_ID_CURVE_LEGACY,
|
||||
BLT_I18NCONTEXT_ID_METABALL,
|
||||
BLT_I18NCONTEXT_ID_MATERIAL,
|
||||
BLT_I18NCONTEXT_ID_TEXTURE,
|
||||
|
|
|
@ -58,7 +58,7 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C,
|
|||
}
|
||||
me_eval_needs_free = false;
|
||||
}
|
||||
else if (ELEM(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_FONT, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
|
||||
me_eval = BKE_mesh_new_nomain_from_curve(ob_eval);
|
||||
me_eval_needs_free = true;
|
||||
|
|
|
@ -755,7 +755,8 @@ void MESH_OT_loopcut(wmOperatorType *ot)
|
|||
RNA_def_property_enum_items(prop, rna_enum_proportional_falloff_curve_only_items);
|
||||
RNA_def_property_enum_default(prop, PROP_INVSQUARE);
|
||||
RNA_def_property_ui_text(prop, "Falloff", "Falloff type the feather");
|
||||
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
|
||||
RNA_def_property_translation_context(prop,
|
||||
BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
|
||||
|
||||
/* For redo only. */
|
||||
prop = RNA_def_int(ot->srna, "object_index", -1, -1, INT_MAX, "Object Index", "", 0, INT_MAX);
|
||||
|
|
|
@ -269,7 +269,8 @@ static void mesh_operator_edgering_props(wmOperatorType *ot,
|
|||
RNA_def_property_enum_items(prop, rna_enum_proportional_falloff_curve_only_items);
|
||||
RNA_def_property_enum_default(prop, PROP_SMOOTH);
|
||||
RNA_def_property_ui_text(prop, "Profile Shape", "Shape of the profile");
|
||||
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
|
||||
RNA_def_property_translation_context(prop,
|
||||
BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
|
||||
}
|
||||
|
||||
static void mesh_operator_edgering_props_get(wmOperator *op, struct EdgeRingOpSubdProps *op_props)
|
||||
|
|
|
@ -841,7 +841,7 @@ static int effector_add_exec(bContext *C, wmOperator *op)
|
|||
Scene *scene = CTX_data_scene(C);
|
||||
Curve *cu;
|
||||
ob = ED_object_add_type(
|
||||
C, OB_CURVE, get_effector_defname(type), loc, rot, false, local_view_bits);
|
||||
C, OB_CURVES_LEGACY, get_effector_defname(type), loc, rot, false, local_view_bits);
|
||||
|
||||
cu = ob->data;
|
||||
cu->flag |= CU_PATH | CU_3D;
|
||||
|
@ -2525,7 +2525,11 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
|
|||
* \{ */
|
||||
|
||||
static const EnumPropertyItem convert_target_items[] = {
|
||||
{OB_CURVE, "CURVE", ICON_OUTLINER_OB_CURVE, "Curve", "Curve from Mesh or Text objects"},
|
||||
{OB_CURVES_LEGACY,
|
||||
"CURVE",
|
||||
ICON_OUTLINER_OB_CURVE,
|
||||
"Curve",
|
||||
"Curve from Mesh or Text objects"},
|
||||
{OB_MESH,
|
||||
"MESH",
|
||||
ICON_OUTLINER_OB_MESH,
|
||||
|
@ -2558,7 +2562,7 @@ static void object_data_convert_ensure_curve_cache(Depsgraph *depsgraph, Scene *
|
|||
* Also happens in case we are working on a copy of the object
|
||||
* (all its caches have been nuked then).
|
||||
*/
|
||||
if (ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
|
||||
if (ELEM(ob->type, OB_SURF, OB_CURVES_LEGACY, OB_FONT)) {
|
||||
/* We need 'for render' ON here, to enable computing bevel dipslist if needed.
|
||||
* Also makes sense anyway, we would not want e.g. to lose hidden parts etc. */
|
||||
BKE_displist_make_curveTypes(depsgraph, scene, ob, true);
|
||||
|
@ -2773,7 +2777,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (ob->type == OB_MESH && target == OB_CURVE) {
|
||||
else if (ob->type == OB_MESH && target == OB_CURVES_LEGACY) {
|
||||
ob->flag |= OB_DONE;
|
||||
|
||||
if (keep_original) {
|
||||
|
@ -2793,7 +2797,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
|
||||
BKE_mesh_to_curve(bmain, depsgraph, scene, newob);
|
||||
|
||||
if (newob->type == OB_CURVE) {
|
||||
if (newob->type == OB_CURVES_LEGACY) {
|
||||
BKE_object_free_modifiers(newob, 0); /* after derivedmesh calls! */
|
||||
if (newob->rigidbody_object != NULL) {
|
||||
ED_rigidbody_object_remove(bmain, scene, newob);
|
||||
|
@ -2930,8 +2934,8 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
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);
|
||||
|
||||
newob->type = OB_CURVE;
|
||||
cu->type = OB_CURVE;
|
||||
newob->type = OB_CURVES_LEGACY;
|
||||
cu->type = OB_CURVES_LEGACY;
|
||||
|
||||
if (cu->vfont) {
|
||||
id_us_min(&cu->vfont->id);
|
||||
|
@ -2955,7 +2959,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
if (ID_REAL_USERS(&cu->id) > 1) {
|
||||
for (ob1 = bmain->objects.first; ob1; ob1 = ob1->id.next) {
|
||||
if (ob1->data == ob->data) {
|
||||
ob1->type = OB_CURVE;
|
||||
ob1->type = OB_CURVES_LEGACY;
|
||||
DEG_id_tag_update(&ob1->id,
|
||||
ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
|
||||
}
|
||||
|
@ -2988,7 +2992,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
basen = NULL;
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
ob->flag |= OB_DONE;
|
||||
|
||||
if (target == OB_MESH) {
|
||||
|
@ -3013,7 +3017,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
BKE_object_free_curve_cache(newob);
|
||||
}
|
||||
else if (target == OB_GPENCIL) {
|
||||
if (ob->type != OB_CURVE) {
|
||||
if (ob->type != OB_CURVES_LEGACY) {
|
||||
ob->flag &= ~OB_DONE;
|
||||
BKE_report(op->reports, RPT_ERROR, "Convert Surfaces to Grease Pencil is not supported");
|
||||
}
|
||||
|
@ -3159,7 +3163,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
/* Remove curves and meshes converted to Grease Pencil object. */
|
||||
if (gpencilConverted) {
|
||||
FOREACH_SCENE_OBJECT_BEGIN (scene, ob_delete) {
|
||||
if (ELEM(ob_delete->type, OB_CURVE, OB_MESH)) {
|
||||
if (ELEM(ob_delete->type, OB_CURVES_LEGACY, OB_MESH)) {
|
||||
if (ob_delete->flag & OB_DONE) {
|
||||
ED_object_base_free_and_unlink(bmain, scene, ob_delete);
|
||||
}
|
||||
|
@ -3172,7 +3176,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
/* Remove Text curves converted to Grease Pencil object to avoid duplicated curves. */
|
||||
if (gpencilCurveConverted) {
|
||||
FOREACH_SCENE_OBJECT_BEGIN (scene, ob_delete) {
|
||||
if (ELEM(ob_delete->type, OB_CURVE) && (ob_delete->flag & OB_DONE)) {
|
||||
if (ELEM(ob_delete->type, OB_CURVES_LEGACY) && (ob_delete->flag & OB_DONE)) {
|
||||
ED_object_base_free_and_unlink(bmain, scene, ob_delete);
|
||||
}
|
||||
}
|
||||
|
@ -3701,7 +3705,7 @@ static bool object_join_poll(bContext *C)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_ARMATURE, OB_GPENCIL)) {
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_SURF, OB_ARMATURE, OB_GPENCIL)) {
|
||||
return ED_operator_screenactive(C);
|
||||
}
|
||||
return false;
|
||||
|
@ -3740,7 +3744,7 @@ static int object_join_exec(bContext *C, wmOperator *op)
|
|||
if (ob->type == OB_MESH) {
|
||||
ret = ED_mesh_join_objects_exec(C, op);
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
ret = ED_curve_join_objects_exec(C, op);
|
||||
}
|
||||
else if (ob->type == OB_ARMATURE) {
|
||||
|
|
|
@ -605,7 +605,7 @@ static bool bake_objects_check(Main *bmain,
|
|||
continue;
|
||||
}
|
||||
|
||||
if (ELEM(ob_iter->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL) == false) {
|
||||
if (ELEM(ob_iter->type, OB_MESH, OB_FONT, OB_CURVES_LEGACY, OB_SURF, OB_MBALL) == false) {
|
||||
BKE_reportf(reports,
|
||||
RPT_ERROR,
|
||||
"Object \"%s\" is not a mesh or can't be converted to a mesh (Curve, Text, "
|
||||
|
|
|
@ -511,7 +511,7 @@ static void test_constraint(
|
|||
*
|
||||
* In other cases it should be impossible to have a type mismatch.
|
||||
*/
|
||||
if (ct->tar->type != OB_CURVE) {
|
||||
if (ct->tar->type != OB_CURVES_LEGACY) {
|
||||
con->flag |= CONSTRAINT_DISABLE;
|
||||
}
|
||||
else {
|
||||
|
@ -2275,7 +2275,8 @@ static bool get_new_constraint_target(
|
|||
|
||||
break;
|
||||
}
|
||||
if (((!only_curve) || (ob->type == OB_CURVE)) && ((!only_mesh) || (ob->type == OB_MESH))) {
|
||||
if (((!only_curve) || (ob->type == OB_CURVES_LEGACY)) &&
|
||||
((!only_mesh) || (ob->type == OB_MESH))) {
|
||||
/* set target */
|
||||
*tar_ob = ob;
|
||||
found = true;
|
||||
|
|
|
@ -382,7 +382,7 @@ struct XFormObjectData *ED_object_data_xform_create_ex(ID *id, bool is_edit_mode
|
|||
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *cu = (Curve *)id;
|
||||
struct Key *key = cu->key;
|
||||
|
||||
|
@ -505,7 +505,7 @@ void ED_object_data_xform_destroy(struct XFormObjectData *xod_base)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
struct XFormObjectData_Curve *xod = (struct XFormObjectData_Curve *)xod_base;
|
||||
if (xod->key_data != NULL) {
|
||||
MEM_freeN(xod->key_data);
|
||||
|
@ -565,7 +565,7 @@ void ED_object_data_xform_by_mat4(struct XFormObjectData *xod_base, const float
|
|||
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
BLI_assert(xod_base->is_edit_mode == false); /* Not used currently. */
|
||||
Curve *cu = (Curve *)xod_base->id;
|
||||
|
||||
|
@ -670,7 +670,7 @@ void ED_object_data_xform_restore(struct XFormObjectData *xod_base)
|
|||
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *cu = (Curve *)xod_base->id;
|
||||
|
||||
struct Key *key = cu->key;
|
||||
|
@ -745,7 +745,7 @@ void ED_object_data_xform_tag_update(struct XFormObjectData *xod_base)
|
|||
DEG_id_tag_update(<->id, ID_RECALC_GEOMETRY);
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
/* Generic update. */
|
||||
Curve *cu = (Curve *)xod_base->id;
|
||||
DEG_id_tag_update(&cu->id, ID_RECALC_GEOMETRY);
|
||||
|
|
|
@ -568,7 +568,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)) {
|
||||
else if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
const Curve *cu = obedit->data;
|
||||
if (cu->editnurb == NULL) {
|
||||
return false;
|
||||
|
@ -799,7 +799,7 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag
|
|||
|
||||
WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_LATTICE, scene);
|
||||
}
|
||||
else if (ELEM(ob->type, OB_SURF, OB_CURVE)) {
|
||||
else if (ELEM(ob->type, OB_SURF, OB_CURVES_LEGACY)) {
|
||||
ok = true;
|
||||
ED_curve_editnurb_make(ob);
|
||||
|
||||
|
@ -1023,7 +1023,7 @@ void ED_object_check_force_modifiers(Main *bmain, Scene *scene, Object *object)
|
|||
if (!md) {
|
||||
if (pd && (pd->shape == PFIELD_SHAPE_SURFACE) &&
|
||||
!ELEM(pd->forcefield, 0, PFIELD_GUIDE, PFIELD_TEXTURE)) {
|
||||
if (ELEM(object->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE)) {
|
||||
if (ELEM(object->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVES_LEGACY)) {
|
||||
ED_object_modifier_add(NULL, bmain, scene, object, NULL, eModifierType_Surface);
|
||||
}
|
||||
}
|
||||
|
@ -1552,7 +1552,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
|
|||
BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
|
||||
changed = true;
|
||||
}
|
||||
else if (ELEM(ob->type, OB_SURF, OB_CURVE)) {
|
||||
else if (ELEM(ob->type, OB_SURF, OB_CURVES_LEGACY)) {
|
||||
BKE_curve_smooth_flag_set(ob->data, use_smooth);
|
||||
changed = true;
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ static bool object_hook_index_array(Main *bmain,
|
|||
}
|
||||
return true;
|
||||
}
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
ED_curve_editnurb_load(bmain, obedit);
|
||||
ED_curve_editnurb_make(obedit);
|
||||
|
@ -447,7 +447,7 @@ static void object_hook_select(Object *ob, HookModifierData *hmd)
|
|||
else if (ob->type == OB_LATTICE) {
|
||||
select_editlattice_hook(ob, hmd);
|
||||
}
|
||||
else if (ob->type == OB_CURVE) {
|
||||
else if (ob->type == OB_CURVES_LEGACY) {
|
||||
select_editcurve_hook(ob, hmd);
|
||||
}
|
||||
else if (ob->type == OB_SURF) {
|
||||
|
|
|
@ -118,7 +118,7 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
case OB_FONT:
|
||||
case OB_MBALL:
|
||||
|
|
|
@ -110,7 +110,7 @@ static void object_force_modifier_update_for_bind(Depsgraph *depsgraph, Object *
|
|||
else if (ob->type == OB_MBALL) {
|
||||
BKE_displist_make_mball(depsgraph, scene_eval, ob_eval);
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
|
||||
BKE_displist_make_curveTypes(depsgraph, scene_eval, ob_eval, false);
|
||||
}
|
||||
else if (ob->type == OB_GPENCIL) {
|
||||
|
@ -757,7 +757,7 @@ static bool modifier_apply_obdata(
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
|
||||
Curve *curve = ob->data;
|
||||
Curve *curve_eval = (Curve *)object_eval->data;
|
||||
|
|
|
@ -169,7 +169,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (ELEM(obedit->type, OB_SURF, OB_CURVE)) {
|
||||
else if (ELEM(obedit->type, OB_SURF, OB_CURVES_LEGACY)) {
|
||||
ListBase *editnurb = object_editcurve_get(obedit);
|
||||
|
||||
for (Nurb *nu = editnurb->first; nu != NULL; nu = nu->next) {
|
||||
|
@ -341,7 +341,7 @@ EnumPropertyItem prop_clear_parent_types[] = {
|
|||
/* Helper for ED_object_parent_clear() - Remove deform-modifiers associated with parent */
|
||||
static void object_remove_parent_deform_modifiers(Object *ob, const Object *par)
|
||||
{
|
||||
if (ELEM(par->type, OB_ARMATURE, OB_LATTICE, OB_CURVE)) {
|
||||
if (ELEM(par->type, OB_ARMATURE, OB_LATTICE, OB_CURVES_LEGACY)) {
|
||||
ModifierData *md, *mdn;
|
||||
|
||||
/* assume that we only need to remove the first instance of matching deform modifier here */
|
||||
|
@ -363,7 +363,7 @@ static void object_remove_parent_deform_modifiers(Object *ob, const Object *par)
|
|||
free = true;
|
||||
}
|
||||
}
|
||||
else if ((md->type == eModifierType_Curve) && (par->type == OB_CURVE)) {
|
||||
else if ((md->type == eModifierType_Curve) && (par->type == OB_CURVES_LEGACY)) {
|
||||
CurveModifierData *cmd = (CurveModifierData *)md;
|
||||
if (cmd->object == par) {
|
||||
free = true;
|
||||
|
@ -531,7 +531,7 @@ bool ED_object_parent_set(ReportList *reports,
|
|||
switch (partype) {
|
||||
case PAR_FOLLOW:
|
||||
case PAR_PATH_CONST: {
|
||||
if (par->type != OB_CURVE) {
|
||||
if (par->type != OB_CURVES_LEGACY) {
|
||||
return false;
|
||||
}
|
||||
Curve *cu = par->data;
|
||||
|
@ -626,7 +626,7 @@ bool ED_object_parent_set(ReportList *reports,
|
|||
*/
|
||||
/* XXX currently this should only happen for meshes, curves, surfaces,
|
||||
* and lattices - this stuff isn't available for meta-balls yet. */
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
|
||||
if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_SURF, OB_FONT, OB_LATTICE)) {
|
||||
ModifierData *md;
|
||||
|
||||
switch (partype) {
|
||||
|
@ -968,7 +968,7 @@ static int parent_set_invoke_menu(bContext *C, wmOperatorType *ot)
|
|||
uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE);
|
||||
uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_BONE_RELATIVE);
|
||||
}
|
||||
else if (parent->type == OB_CURVE) {
|
||||
else if (parent->type == OB_CURVES_LEGACY) {
|
||||
uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_CURVE);
|
||||
uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_FOLLOW);
|
||||
uiItemEnumO_ptr(layout, ot, NULL, 0, "type", PAR_PATH_CONST);
|
||||
|
@ -1820,7 +1820,7 @@ static void single_obdata_users(
|
|||
ob->data,
|
||||
BKE_id_copy_ex(bmain, ob->data, NULL, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS));
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
case OB_FONT:
|
||||
ob->data = cu = ID_NEW_SET(
|
||||
|
|
|
@ -613,7 +613,7 @@ static int apply_objects_internal(bContext *C,
|
|||
OB_ARMATURE,
|
||||
OB_LATTICE,
|
||||
OB_MBALL,
|
||||
OB_CURVE,
|
||||
OB_CURVES_LEGACY,
|
||||
OB_SURF,
|
||||
OB_FONT,
|
||||
OB_GPENCIL)) {
|
||||
|
@ -639,13 +639,13 @@ static int apply_objects_internal(bContext *C,
|
|||
}
|
||||
}
|
||||
|
||||
if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
ID *obdata = ob->data;
|
||||
Curve *cu;
|
||||
|
||||
cu = ob->data;
|
||||
|
||||
if (((ob->type == OB_CURVE) && !(cu->flag & CU_3D)) && (apply_rot || apply_loc)) {
|
||||
if (((ob->type == OB_CURVES_LEGACY) && !(cu->flag & CU_3D)) && (apply_rot || apply_loc)) {
|
||||
BKE_reportf(
|
||||
reports,
|
||||
RPT_ERROR,
|
||||
|
@ -811,7 +811,7 @@ static int apply_objects_internal(bContext *C,
|
|||
MetaBall *mb = ob->data;
|
||||
BKE_mball_transform(mb, mat, do_props);
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = ob->data;
|
||||
scale = mat3_to_scale(rsmat);
|
||||
BKE_curve_transform_ex(cu, mat, true, do_props, scale);
|
||||
|
@ -1209,7 +1209,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
|
|||
do_inverse_offset = true;
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = ob->data;
|
||||
|
||||
if (centermode == ORIGIN_TO_CURSOR) {
|
||||
|
@ -1223,7 +1223,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
/* don't allow Z change if curve is 2D */
|
||||
if ((ob->type == OB_CURVE) && !(cu->flag & CU_3D)) {
|
||||
if ((ob->type == OB_CURVES_LEGACY) && !(cu->flag & CU_3D)) {
|
||||
cent[2] = 0.0;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ bool ED_object_calc_active_center_for_editmode(Object *obedit,
|
|||
|
||||
break;
|
||||
}
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF: {
|
||||
Curve *cu = obedit->data;
|
||||
|
||||
|
|
|
@ -1188,5 +1188,6 @@ void RENDER_OT_shutter_curve_preset(wmOperatorType *ot)
|
|||
ot->exec = render_shutter_curve_preset_exec;
|
||||
|
||||
prop = RNA_def_enum(ot->srna, "shape", prop_shape_items, CURVE_PRESET_SMOOTH, "Mode", "");
|
||||
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
|
||||
RNA_def_property_translation_context(prop,
|
||||
BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
|
||||
}
|
||||
|
|
|
@ -599,30 +599,30 @@ static int gather_frames_to_render_for_id(LibraryIDLinkCallbackData *cb_data)
|
|||
const ID_Type id_type = GS(id->name);
|
||||
switch (id_type) {
|
||||
/* Whitelist: */
|
||||
case ID_ME: /* Mesh */
|
||||
case ID_CU: /* Curve */
|
||||
case ID_MB: /* MetaBall */
|
||||
case ID_MA: /* Material */
|
||||
case ID_TE: /* Tex (Texture) */
|
||||
case ID_IM: /* Image */
|
||||
case ID_LT: /* Lattice */
|
||||
case ID_LA: /* Light */
|
||||
case ID_CA: /* Camera */
|
||||
case ID_KE: /* Key (shape key) */
|
||||
case ID_VF: /* VFont (Vector Font) */
|
||||
case ID_TXT: /* Text */
|
||||
case ID_SPK: /* Speaker */
|
||||
case ID_SO: /* Sound */
|
||||
case ID_AR: /* bArmature */
|
||||
case ID_NT: /* bNodeTree */
|
||||
case ID_PA: /* ParticleSettings */
|
||||
case ID_MC: /* MovieClip */
|
||||
case ID_MSK: /* Mask */
|
||||
case ID_LP: /* LightProbe */
|
||||
case ID_CV: /* Curves */
|
||||
case ID_PT: /* PointCloud */
|
||||
case ID_VO: /* Volume */
|
||||
case ID_SIM: /* Simulation */
|
||||
case ID_ME: /* Mesh */
|
||||
case ID_CU_LEGACY: /* Curve */
|
||||
case ID_MB: /* MetaBall */
|
||||
case ID_MA: /* Material */
|
||||
case ID_TE: /* Tex (Texture) */
|
||||
case ID_IM: /* Image */
|
||||
case ID_LT: /* Lattice */
|
||||
case ID_LA: /* Light */
|
||||
case ID_CA: /* Camera */
|
||||
case ID_KE: /* Key (shape key) */
|
||||
case ID_VF: /* VFont (Vector Font) */
|
||||
case ID_TXT: /* Text */
|
||||
case ID_SPK: /* Speaker */
|
||||
case ID_SO: /* Sound */
|
||||
case ID_AR: /* bArmature */
|
||||
case ID_NT: /* bNodeTree */
|
||||
case ID_PA: /* ParticleSettings */
|
||||
case ID_MC: /* MovieClip */
|
||||
case ID_MSK: /* Mask */
|
||||
case ID_LP: /* LightProbe */
|
||||
case ID_CV: /* Curves */
|
||||
case ID_PT: /* PointCloud */
|
||||
case ID_VO: /* Volume */
|
||||
case ID_SIM: /* Simulation */
|
||||
break;
|
||||
|
||||
/* Blacklist: */
|
||||
|
|
|
@ -310,7 +310,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Nurb *nu;
|
||||
ListBase *nurbs = BKE_curve_editNurbs_get((Curve *)ob->data);
|
||||
|
||||
|
@ -411,7 +411,7 @@ static int material_slot_de_select(bContext *C, bool select)
|
|||
changed = EDBM_deselect_by_material(em, mat_nr_active, select);
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
ListBase *nurbs = BKE_curve_editNurbs_get((Curve *)ob->data);
|
||||
Nurb *nu;
|
||||
BPoint *bp;
|
||||
|
|
|
@ -585,7 +585,7 @@ bool ED_operator_uvmap(bContext *C)
|
|||
bool ED_operator_editsurfcurve(bContext *C)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
if (obedit && ELEM(obedit->type, OB_CURVE, OB_SURF)) {
|
||||
if (obedit && ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
return NULL != ((Curve *)obedit->data)->editnurb;
|
||||
}
|
||||
return false;
|
||||
|
@ -604,7 +604,7 @@ bool ED_operator_editsurfcurve_region_view3d(bContext *C)
|
|||
bool ED_operator_editcurve(bContext *C)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
if (obedit && obedit->type == OB_CURVE) {
|
||||
if (obedit && obedit->type == OB_CURVES_LEGACY) {
|
||||
return NULL != ((Curve *)obedit->data)->editnurb;
|
||||
}
|
||||
return false;
|
||||
|
@ -613,7 +613,7 @@ bool ED_operator_editcurve(bContext *C)
|
|||
bool ED_operator_editcurve_3d(bContext *C)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
if (obedit && obedit->type == OB_CURVE) {
|
||||
if (obedit && obedit->type == OB_CURVES_LEGACY) {
|
||||
Curve *cu = (Curve *)obedit->data;
|
||||
|
||||
return (cu->flag & CU_3D) && (NULL != cu->editnurb);
|
||||
|
|
|
@ -585,7 +585,8 @@ void BRUSH_OT_curve_preset(wmOperatorType *ot)
|
|||
ot->poll = brush_curve_preset_poll;
|
||||
|
||||
prop = RNA_def_enum(ot->srna, "shape", prop_shape_items, CURVE_PRESET_SMOOTH, "Mode", "");
|
||||
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
|
||||
RNA_def_property_translation_context(prop,
|
||||
BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
|
||||
}
|
||||
|
||||
/* face-select ops */
|
||||
|
|
|
@ -230,7 +230,7 @@ static bool buttons_context_path_data(ButsContextPath *path, int type)
|
|||
return true;
|
||||
}
|
||||
if (RNA_struct_is_a(ptr->type, &RNA_Curve) &&
|
||||
(type == -1 || ELEM(type, OB_CURVE, OB_SURF, OB_FONT))) {
|
||||
(type == -1 || ELEM(type, OB_CURVES_LEGACY, OB_SURF, OB_FONT))) {
|
||||
return true;
|
||||
}
|
||||
if (RNA_struct_is_a(ptr->type, &RNA_Armature) && (ELEM(type, -1, OB_ARMATURE))) {
|
||||
|
@ -293,7 +293,7 @@ static bool buttons_context_path_modifier(ButsContextPath *path)
|
|||
|
||||
if (ELEM(ob->type,
|
||||
OB_MESH,
|
||||
OB_CURVE,
|
||||
OB_CURVES_LEGACY,
|
||||
OB_FONT,
|
||||
OB_SURF,
|
||||
OB_LATTICE,
|
||||
|
|
|
@ -152,7 +152,7 @@ static void stats_object(Object *ob,
|
|||
}
|
||||
break;
|
||||
case OB_SURF:
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_FONT: {
|
||||
const Mesh *me_eval = BKE_object_get_evaluated_mesh(ob);
|
||||
if ((me_eval != nullptr) && !BLI_gset_add(objects_gset, (void *)me_eval)) {
|
||||
|
@ -260,7 +260,7 @@ static void stats_object_edit(Object *obedit, SceneStats *stats)
|
|||
stats->totvert += 2;
|
||||
}
|
||||
}
|
||||
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { /* OB_FONT has no cu->editnurb */
|
||||
else if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) { /* OB_FONT has no cu->editnurb */
|
||||
/* Curve Edit */
|
||||
Curve *cu = static_cast<Curve *>(obedit->data);
|
||||
BezTriple *bezt;
|
||||
|
|
|
@ -47,7 +47,7 @@ static void context_path_add_object_data(Vector<ui::ContextPathItem> &path, Obje
|
|||
Light *light = (Light *)object.data;
|
||||
ui::context_path_add_generic(path, RNA_Light, light);
|
||||
}
|
||||
if (ELEM(object.type, OB_CURVE, OB_FONT, OB_SURF) && object.data) {
|
||||
if (ELEM(object.type, OB_CURVES_LEGACY, OB_FONT, OB_SURF) && object.data) {
|
||||
Curve *curve = (Curve *)object.data;
|
||||
ui::context_path_add_generic(path, RNA_Curve, curve);
|
||||
}
|
||||
|
|
|
@ -2592,7 +2592,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
|
|||
case OB_CAMERA:
|
||||
data.icon = ICON_OUTLINER_OB_CAMERA;
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
data.icon = ICON_OUTLINER_OB_CURVE;
|
||||
break;
|
||||
case OB_MBALL:
|
||||
|
@ -2655,7 +2655,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
|
|||
case ID_ME:
|
||||
data.icon = ICON_OUTLINER_DATA_MESH;
|
||||
break;
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
data.icon = ICON_OUTLINER_DATA_CURVE;
|
||||
break;
|
||||
case ID_MB:
|
||||
|
|
|
@ -108,7 +108,7 @@ typedef struct TreeElementIcon {
|
|||
ID_LI, \
|
||||
ID_OB, \
|
||||
ID_ME, \
|
||||
ID_CU, \
|
||||
ID_CU_LEGACY, \
|
||||
ID_MB, \
|
||||
ID_NT, \
|
||||
ID_MA, \
|
||||
|
|
|
@ -1171,7 +1171,7 @@ static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreE
|
|||
context = BCONTEXT_OBJECT;
|
||||
break;
|
||||
case ID_ME:
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
case ID_MB:
|
||||
case ID_IM:
|
||||
case ID_LT:
|
||||
|
|
|
@ -117,7 +117,7 @@ static void get_element_operation_type(
|
|||
break;
|
||||
|
||||
case ID_ME:
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
case ID_MB:
|
||||
case ID_LT:
|
||||
case ID_LA:
|
||||
|
@ -236,7 +236,7 @@ static void unlink_material_fn(bContext *UNUSED(C),
|
|||
totcol = me->totcol;
|
||||
matar = me->mat;
|
||||
}
|
||||
else if (GS(tsep->id->name) == ID_CU) {
|
||||
else if (GS(tsep->id->name) == ID_CU_LEGACY) {
|
||||
Curve *cu = (Curve *)tsep->id;
|
||||
totcol = cu->totcol;
|
||||
matar = cu->mat;
|
||||
|
|
|
@ -579,7 +579,7 @@ static void outliner_add_id_contents(SpaceOutliner *space_outliner,
|
|||
* would require going over all tfaces, sort images in use. etc... */
|
||||
break;
|
||||
}
|
||||
case ID_CU: {
|
||||
case ID_CU_LEGACY: {
|
||||
Curve *cu = (Curve *)id;
|
||||
|
||||
if (outliner_animdata_test(cu->adt)) {
|
||||
|
|
|
@ -34,7 +34,7 @@ std::unique_ptr<TreeElementID> TreeElementID::createFromID(TreeElement &legacy_t
|
|||
return std::make_unique<TreeElementIDScene>(legacy_te, (Scene &)id);
|
||||
case ID_OB:
|
||||
case ID_ME:
|
||||
case ID_CU:
|
||||
case ID_CU_LEGACY:
|
||||
case ID_MB:
|
||||
case ID_MA:
|
||||
case ID_TE:
|
||||
|
|
|
@ -264,7 +264,7 @@ Object *spreadsheet_get_object_eval(const SpaceSpreadsheet *sspreadsheet,
|
|||
return nullptr;
|
||||
}
|
||||
Object *object_orig = (Object *)used_id;
|
||||
if (!ELEM(object_orig->type, OB_MESH, OB_POINTCLOUD, OB_VOLUME, OB_CURVE, OB_FONT)) {
|
||||
if (!ELEM(object_orig->type, OB_MESH, OB_POINTCLOUD, OB_VOLUME, OB_CURVES_LEGACY, OB_FONT)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
|
|||
|
||||
has_meshdata = (tot || totedgedata);
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
TransformMedian_Curve *median = &median_basis.curve;
|
||||
Curve *cu = ob->data;
|
||||
BPoint *bp;
|
||||
|
@ -1089,7 +1089,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_CURVE, OB_SURF) &&
|
||||
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF) &&
|
||||
(apply_vcos || median_basis.curve.b_weight || median_basis.curve.weight ||
|
||||
median_basis.curve.radius || median_basis.curve.tilt)) {
|
||||
const TransformMedian_Curve *median = &median_basis.curve,
|
||||
|
|
|
@ -1351,7 +1351,7 @@ static void draw_selected_name(
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (ELEM(ob->type, OB_MESH, OB_LATTICE, OB_CURVE)) {
|
||||
else if (ELEM(ob->type, OB_MESH, OB_LATTICE, OB_CURVES_LEGACY)) {
|
||||
/* try to display active bone and active shapekey too (if they exist) */
|
||||
|
||||
if (ob->type == OB_MESH && ob->mode & OB_MODE_WEIGHT_PAINT) {
|
||||
|
|
|
@ -1313,7 +1313,7 @@ static bool view3d_lasso_select(bContext *C,
|
|||
case OB_MESH:
|
||||
changed = do_lasso_select_mesh(vc, wm_userdata, mcoords, mcoords_len, sel_op);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
changed = do_lasso_select_curve(vc, mcoords, mcoords_len, sel_op);
|
||||
break;
|
||||
|
@ -2695,7 +2695,7 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
|
|||
retval = ED_lattice_deselect_all_multi(C);
|
||||
}
|
||||
}
|
||||
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
retval = ED_curve_editnurb_select_pick(C, location, extend, deselect, toggle);
|
||||
if (!retval && deselect_all) {
|
||||
retval = ED_curve_deselect_all_multi(C);
|
||||
|
@ -3586,7 +3586,7 @@ static int view3d_box_select_exec(bContext *C, wmOperator *op)
|
|||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);
|
||||
}
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
changed = do_nurbs_box_select(&vc, &rect, sel_op);
|
||||
if (changed) {
|
||||
|
@ -4342,7 +4342,7 @@ static bool obedit_circle_select(bContext *C,
|
|||
case OB_MESH:
|
||||
changed = mesh_circle_select(vc, wm_userdata, sel_op, mval, rad);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
changed = nurbscurve_circle_select(vc, sel_op, mval, rad);
|
||||
break;
|
||||
|
|
|
@ -1967,7 +1967,7 @@ bool checkUseAxisMatrix(TransInfo *t)
|
|||
/* currently only checks for editmode */
|
||||
if (t->flag & T_EDIT) {
|
||||
if ((t->around == V3D_AROUND_LOCAL_ORIGINS) &&
|
||||
(ELEM(t->obedit_type, OB_MESH, OB_CURVE, OB_MBALL, OB_ARMATURE))) {
|
||||
(ELEM(t->obedit_type, OB_MESH, OB_CURVES_LEGACY, OB_MBALL, OB_ARMATURE))) {
|
||||
/* not all editmode supports axis-matrix */
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1040,7 +1040,7 @@ static void init_proportional_edit(TransInfo *t)
|
|||
/* Already calculated by uv_set_connectivity_distance. */
|
||||
}
|
||||
else if (convert_type == TC_CURVE_VERTS) {
|
||||
BLI_assert(t->obedit_type == OB_CURVE);
|
||||
BLI_assert(t->obedit_type == OB_CURVES_LEGACY);
|
||||
set_prop_dist(t, false);
|
||||
}
|
||||
else {
|
||||
|
@ -1049,7 +1049,7 @@ static void init_proportional_edit(TransInfo *t)
|
|||
|
||||
sort_trans_data_dist(t);
|
||||
}
|
||||
else if (ELEM(t->obedit_type, OB_CURVE)) {
|
||||
else if (ELEM(t->obedit_type, OB_CURVES_LEGACY)) {
|
||||
/* Needed because bezier handles can be partially selected
|
||||
* and are still added into transform data. */
|
||||
sort_trans_data_selected_first(t);
|
||||
|
@ -1286,7 +1286,7 @@ static eTConvertType convert_type_get(const TransInfo *t, Object **r_obj_armatur
|
|||
convert_type = TC_MESH_VERTS;
|
||||
}
|
||||
}
|
||||
else if (ELEM(t->obedit_type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(t->obedit_type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
convert_type = TC_CURVE_VERTS;
|
||||
}
|
||||
else if (t->obedit_type == OB_LATTICE) {
|
||||
|
|
|
@ -44,7 +44,7 @@ void createTransTexspace(TransInfo *t)
|
|||
}
|
||||
|
||||
id = ob->data;
|
||||
if (id == NULL || !ELEM(GS(id->name), ID_ME, ID_CU, ID_MB)) {
|
||||
if (id == NULL || !ELEM(GS(id->name), ID_ME, ID_CU_LEGACY, ID_MB)) {
|
||||
BKE_report(t->reports, RPT_ERROR, "Unsupported object type for text-space transform");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -731,7 +731,8 @@ void postTrans(bContext *C, TransInfo *t)
|
|||
if (t->data_len_all != 0) {
|
||||
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
|
||||
/* free data malloced per trans-data */
|
||||
if (ELEM(t->obedit_type, OB_CURVE, OB_SURF, OB_GPENCIL) || (t->spacetype == SPACE_GRAPH)) {
|
||||
if (ELEM(t->obedit_type, OB_CURVES_LEGACY, OB_SURF, OB_GPENCIL) ||
|
||||
(t->spacetype == SPACE_GRAPH)) {
|
||||
TransData *td = tc->data;
|
||||
for (int a = 0; a < tc->data_len; a++, td++) {
|
||||
if (td->flag & TD_BEZTRIPLE) {
|
||||
|
|
|
@ -816,7 +816,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
|
|||
}
|
||||
FOREACH_EDIT_OBJECT_END();
|
||||
}
|
||||
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
FOREACH_EDIT_OBJECT_BEGIN (ob_iter, use_mat_local) {
|
||||
Curve *cu = ob_iter->data;
|
||||
Nurb *nu;
|
||||
|
|
|
@ -153,7 +153,7 @@ static void gizmo_mesh_extrude_setup(const bContext *C, wmGizmoGroup *gzgroup)
|
|||
op_idname = "ARMATURE_OT_extrude_move";
|
||||
ggd->normal_axis = 1;
|
||||
}
|
||||
else if (obact->type == OB_CURVE) {
|
||||
else if (obact->type == OB_CURVES_LEGACY) {
|
||||
op_idname = "CURVE_OT_extrude_move";
|
||||
ggd->normal_axis = 2;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ bool transdata_check_local_center(const TransInfo *t, short around)
|
|||
return ((around == V3D_AROUND_LOCAL_ORIGINS) &&
|
||||
((t->options & (CTX_OBJECT | CTX_POSE_BONE)) ||
|
||||
/* implicit: (t->flag & T_EDIT) */
|
||||
(ELEM(t->obedit_type, OB_MESH, OB_CURVE, OB_MBALL, OB_ARMATURE, OB_GPENCIL)) ||
|
||||
(ELEM(t->obedit_type, OB_MESH, OB_CURVES_LEGACY, OB_MBALL, OB_ARMATURE, OB_GPENCIL)) ||
|
||||
(t->spacetype == SPACE_GRAPH) ||
|
||||
(t->options & (CTX_MOVIECLIP | CTX_MASK | CTX_PAINT_CURVE | CTX_SEQUENCER_IMAGE))));
|
||||
}
|
||||
|
|
|
@ -628,7 +628,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
|
|||
"Proportional Falloff",
|
||||
"Falloff type for proportional editing mode");
|
||||
/* Abusing id_curve :/ */
|
||||
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE);
|
||||
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE_LEGACY);
|
||||
RNA_def_float(ot->srna,
|
||||
"proportional_size",
|
||||
1,
|
||||
|
|
|
@ -350,7 +350,7 @@ bool BIF_createTransformOrientation(bContext *C,
|
|||
else if (obedit->type == OB_ARMATURE) {
|
||||
ts = createBoneSpace(C, reports, name, overwrite);
|
||||
}
|
||||
else if (obedit->type == OB_CURVE) {
|
||||
else if (obedit->type == OB_CURVES_LEGACY) {
|
||||
ts = createCurveSpace(C, reports, name, overwrite);
|
||||
}
|
||||
}
|
||||
|
@ -984,7 +984,7 @@ int getTransformOrientation_ex(ViewLayer *view_layer,
|
|||
negate_v3(plane);
|
||||
|
||||
} /* end editmesh */
|
||||
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = obedit->data;
|
||||
Nurb *nu = NULL;
|
||||
int a;
|
||||
|
|
|
@ -86,7 +86,7 @@ int BIF_snappingSupported(Object *obedit)
|
|||
int status = 0;
|
||||
|
||||
/* only support object mesh, armature, curves */
|
||||
if (obedit == NULL || ELEM(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL)) {
|
||||
if (obedit == NULL || ELEM(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVES_LEGACY, OB_LATTICE, OB_MBALL)) {
|
||||
status = 1;
|
||||
}
|
||||
|
||||
|
@ -583,7 +583,7 @@ static short snap_mode_from_scene(TransInfo *t)
|
|||
/* All obedit types will match. */
|
||||
const int obedit_type = t->obedit_type;
|
||||
if ((t->options & (CTX_GPENCIL_STROKES | CTX_CURSOR | CTX_OBMODE_XFORM_OBDATA)) ||
|
||||
ELEM(obedit_type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL, -1)) {
|
||||
ELEM(obedit_type, OB_MESH, OB_ARMATURE, OB_CURVES_LEGACY, OB_LATTICE, OB_MBALL, -1)) {
|
||||
r_snap_mode = ts->snap_mode;
|
||||
if ((r_snap_mode & SCE_SNAP_MODE_INCREMENT) && (ts->snap_flag & SCE_SNAP_ABS_GRID) &&
|
||||
(t->mode == TFM_TRANSLATION)) {
|
||||
|
@ -617,7 +617,7 @@ static short snap_select_type_get(TransInfo *t)
|
|||
* When we're moving the origins, allow snapping onto our own geometry (see T69132). */
|
||||
}
|
||||
else if ((obedit_type != -1) &&
|
||||
ELEM(obedit_type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL)) {
|
||||
ELEM(obedit_type, OB_MESH, OB_ARMATURE, OB_CURVES_LEGACY, OB_LATTICE, OB_MBALL)) {
|
||||
/* Edit mode */
|
||||
/* Temporary limited to edit mode meshes, armature, curves, metaballs. */
|
||||
|
||||
|
|
|
@ -1054,7 +1054,7 @@ static void raycast_obj_fn(SnapObjectContext *sctx,
|
|||
dt->r_hit_list);
|
||||
break;
|
||||
}
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_SURF:
|
||||
case OB_FONT: {
|
||||
if (!is_object_active) {
|
||||
|
@ -2743,7 +2743,7 @@ static void snap_obj_fn(SnapObjectContext *sctx,
|
|||
dt->r_no,
|
||||
dt->r_index);
|
||||
break;
|
||||
case OB_CURVE:
|
||||
case OB_CURVES_LEGACY:
|
||||
retval = snapCurve(
|
||||
sctx, params, ob_eval, obmat, dt->dist_px, dt->r_loc, dt->r_no, dt->r_index);
|
||||
break; /* Use ATTR_FALLTHROUGH if we want to snap to the generated mesh. */
|
||||
|
@ -3117,7 +3117,7 @@ static short transform_snap_context_project_view3d_mixed_impl(
|
|||
sctx->runtime.has_occlusion_plane = false;
|
||||
|
||||
/* By convention we only snap to the original elements of a curve. */
|
||||
if (has_hit && ob_eval->type != OB_CURVE) {
|
||||
if (has_hit && ob_eval->type != OB_CURVES_LEGACY) {
|
||||
/* Compute the new clip_pane but do not add it yet. */
|
||||
float new_clipplane[4];
|
||||
BLI_ASSERT_UNIT_V3(no);
|
||||
|
|
|
@ -45,7 +45,7 @@ void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit)
|
|||
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
||||
BM_mesh_normals_update(em->bm);
|
||||
}
|
||||
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = obedit->data;
|
||||
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
|
||||
Nurb *nu = nurbs->first;
|
||||
|
@ -181,7 +181,8 @@ static void set_mapped_co(void *vuserdata, int index, const float co[3], const f
|
|||
|
||||
bool ED_transverts_check_obedit(const Object *obedit)
|
||||
{
|
||||
return (ELEM(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL));
|
||||
return (
|
||||
ELEM(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVES_LEGACY, OB_MBALL));
|
||||
}
|
||||
|
||||
void ED_transverts_create_from_obedit(TransVertStore *tvs, const Object *obedit, const int mode)
|
||||
|
@ -351,7 +352,7 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, const Object *obedit,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
|
||||
else if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
|
||||
Curve *cu = obedit->data;
|
||||
int totmalloc = 0;
|
||||
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
|
||||
|
|
|
@ -219,7 +219,7 @@ static void add_this_collection(Collection *c,
|
|||
return;
|
||||
}
|
||||
FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (c, ob, mode) {
|
||||
if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
|
||||
if (ob->lineart.usage != OBJECT_LRT_EXCLUDE) {
|
||||
DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_GEOMETRY, "Line Art Modifier");
|
||||
DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_TRANSFORM, "Line Art Modifier");
|
||||
|
|
|
@ -2193,7 +2193,7 @@ static void lineart_main_load_geometries(
|
|||
mul_m4db_m4db_m4fl_uniq(obi->model_view_proj, rb->view_projection, ob->obmat);
|
||||
mul_m4db_m4db_m4fl_uniq(obi->model_view, rb->view, ob->obmat);
|
||||
|
||||
if (!ELEM(use_ob->type, OB_MESH, OB_MBALL, OB_CURVE, OB_SURF, OB_FONT)) {
|
||||
if (!ELEM(use_ob->type, OB_MESH, OB_MBALL, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue