Transform: remove recently added ival2, use editbones temp data

This commit is contained in:
Campbell Barton 2014-02-27 09:47:37 +11:00
parent 8af2ed80a4
commit f72acc38dd
Notes: blender-bot 2023-02-14 06:23:08 +01:00
Referenced by commit 2e0a33745d, Revert editbone roll correction changes.
4 changed files with 9 additions and 7 deletions

View File

@ -59,7 +59,10 @@ typedef struct EditBone {
struct EditBone *parent; /* Editbones have a one-way link (i.e. children refer
* to parents. This is converted to a two-way link for
* normal bones when leaving editmode. */
void *temp; /* Used to store temporary data */
union { /* Used to store temporary data */
void *temp;
float temp_f;
};
char name[64]; /* MAXBONENAME */
float roll; /* Roll along axis. We'll ultimately use the axis/angle method

View File

@ -258,7 +258,6 @@ typedef struct TransData {
float iloc[3]; /* Initial location */
float *val; /* Value pointer for special transforms */
float ival; /* Old value */
float ival2; /* Another old value (for bone roll we need two different "old values" :/ ). */
float center[3]; /* Individual data center */
float mtx[3][3]; /* Transformation matrix from data space to global space */
float smtx[3][3]; /* Transformation matrix from global space to data space */

View File

@ -1074,12 +1074,12 @@ static void createTransArmatureVerts_init_roll_fix(TransData *td, EditBone *ebo)
if (fabsf(dot_v3v3(vec, z_axis)) > 0.999999f) {
/* If nearly aligned with Z axis, do not alter roll. See T38843. */
td->ival = ebo->roll;
ebo->temp_f = ebo->roll;
}
else {
td->ival = ebo->roll - ED_rollBoneToVector(ebo, z_axis, false);
ebo->temp_f = ebo->roll - ED_rollBoneToVector(ebo, z_axis, false);
}
td->ival2 = ebo->roll;
td->ival = ebo->roll;
}
static void createTransArmatureVerts(TransInfo *t)

View File

@ -823,10 +823,10 @@ static void recalcData_objects(TransInfo *t)
if (fabsf(dot_v3v3(vec, z_axis)) > 0.999999f) {
/* If our bone is Z-aligned, do not alter roll. See T38843. */
ebo->roll = td->ival2;
ebo->roll = td->ival;
}
else {
ebo->roll = td->ival + ED_rollBoneToVector(ebo, z_axis, false);
ebo->roll = ebo->temp_f + ED_rollBoneToVector(ebo, z_axis, false);
}
}
}