Transform: remove recently added ival2, use editbones temp data

This commit is contained in:
2014-02-27 09:47:37 +11:00
parent 8af2ed80a4
commit f72acc38dd
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 struct EditBone *parent; /* Editbones have a one-way link (i.e. children refer
* to parents. This is converted to a two-way link for * to parents. This is converted to a two-way link for
* normal bones when leaving editmode. */ * 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 */ char name[64]; /* MAXBONENAME */
float roll; /* Roll along axis. We'll ultimately use the axis/angle method 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 iloc[3]; /* Initial location */
float *val; /* Value pointer for special transforms */ float *val; /* Value pointer for special transforms */
float ival; /* Old value */ 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 center[3]; /* Individual data center */
float mtx[3][3]; /* Transformation matrix from data space to global space */ float mtx[3][3]; /* Transformation matrix from data space to global space */
float smtx[3][3]; /* Transformation matrix from global space to data 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 (fabsf(dot_v3v3(vec, z_axis)) > 0.999999f) {
/* If nearly aligned with Z axis, do not alter roll. See T38843. */ /* If nearly aligned with Z axis, do not alter roll. See T38843. */
td->ival = ebo->roll; ebo->temp_f = ebo->roll;
} }
else { 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) 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 (fabsf(dot_v3v3(vec, z_axis)) > 0.999999f) {
/* If our bone is Z-aligned, do not alter roll. See T38843. */ /* If our bone is Z-aligned, do not alter roll. See T38843. */
ebo->roll = td->ival2; ebo->roll = td->ival;
} }
else { else {
ebo->roll = td->ival + ED_rollBoneToVector(ebo, z_axis, false); ebo->roll = ebo->temp_f + ED_rollBoneToVector(ebo, z_axis, false);
} }
} }
} }