Curves: don't use 'charidx' for regular curves
Code attempted to sync them with materials, but its not needed (and wasn't reliable).
This commit is contained in:
@@ -4422,9 +4422,6 @@ void BKE_curve_material_index_remove(Curve *cu, int index)
|
||||
for (nu = cu->nurb.first; nu; nu = nu->next) {
|
||||
if (nu->mat_nr && nu->mat_nr >= index) {
|
||||
nu->mat_nr--;
|
||||
if (curvetype == OB_CURVE) {
|
||||
nu->charidx--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4446,9 +4443,6 @@ void BKE_curve_material_index_clear(Curve *cu)
|
||||
|
||||
for (nu = cu->nurb.first; nu; nu = nu->next) {
|
||||
nu->mat_nr = 0;
|
||||
if (curvetype == OB_CURVE) {
|
||||
nu->charidx = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4475,9 +4469,6 @@ int BKE_curve_material_index_validate(Curve *cu)
|
||||
for (nu = cu->nurb.first; nu; nu = nu->next) {
|
||||
if (nu->mat_nr > max_idx) {
|
||||
nu->mat_nr = 0;
|
||||
if (curvetype == OB_CURVE) {
|
||||
nu->charidx = 0;
|
||||
}
|
||||
is_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3532,7 +3532,7 @@ static void direct_link_curve(FileData *fd, Curve *cu)
|
||||
nu->bp = newdataadr(fd, nu->bp);
|
||||
nu->knotsu = newdataadr(fd, nu->knotsu);
|
||||
nu->knotsv = newdataadr(fd, nu->knotsv);
|
||||
if (cu->vfont == NULL) nu->charidx= nu->mat_nr;
|
||||
if (cu->vfont == NULL) nu->charidx = 0;
|
||||
|
||||
if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
|
||||
switch_endian_knots(nu);
|
||||
|
||||
@@ -203,7 +203,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
if (nurbs) {
|
||||
for (nu = nurbs->first; nu; nu = nu->next)
|
||||
if (isNurbsel(nu))
|
||||
nu->mat_nr = nu->charidx = ob->actcol - 1;
|
||||
nu->mat_nr = ob->actcol - 1;
|
||||
}
|
||||
}
|
||||
else if (ob->type == OB_FONT) {
|
||||
|
||||
@@ -157,6 +157,7 @@ typedef struct Nurb {
|
||||
short tilt_interp; /* KEY_LINEAR, KEY_CARDINAL, KEY_BSPLINE */
|
||||
short radius_interp;
|
||||
|
||||
/* only used for dynamically generated Nurbs created from OB_FONT's */
|
||||
int charidx;
|
||||
} Nurb;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user