forked from bartvdbraak/blender
RESCUE COMMIT!
Yesterday's commit from Brecht broke armature editmode, damaging armatures in a way you cannot rescue. This rewinds the main changes. After commit I'll try to find the error...
This commit is contained in:
parent
31fd60f94c
commit
823e71e757
@ -873,7 +873,8 @@ void vec_roll_to_mat3(float *vec, float roll, float mat[][3])
|
|||||||
if (Inpf(axis,axis) > 0.0000000000001) {
|
if (Inpf(axis,axis) > 0.0000000000001) {
|
||||||
/* if nor is *not* a multiple of target ... */
|
/* if nor is *not* a multiple of target ... */
|
||||||
Normalise (axis);
|
Normalise (axis);
|
||||||
theta= NormalizedVecAngle2(target, nor);
|
theta=(float) acos (Inpf (target,nor));
|
||||||
|
// theta= NormalizedVecAngle2(target, nor);
|
||||||
|
|
||||||
/* Make Bone matrix*/
|
/* Make Bone matrix*/
|
||||||
VecRotToMat3(axis, theta, bMatrix);
|
VecRotToMat3(axis, theta, bMatrix);
|
||||||
|
@ -3799,6 +3799,7 @@ static void do_chroma_key(bNode *node, float *out, float *in)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
x= z= 0.0f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ void make_boneList(ListBase* list, ListBase *bones, EditBone *parent)
|
|||||||
Mat3Inv(imat, postmat);
|
Mat3Inv(imat, postmat);
|
||||||
Mat3MulMat3(difmat, imat, premat);
|
Mat3MulMat3(difmat, imat, premat);
|
||||||
|
|
||||||
eBone->roll = atan2(difmat[2][0], difmat[2][2]);
|
eBone->roll = atan(difmat[2][0]/difmat[2][2]);
|
||||||
if (difmat[0][0]<0.0) eBone->roll +=M_PI;
|
if (difmat[0][0]<0.0) eBone->roll +=M_PI;
|
||||||
|
|
||||||
/* rest of stuff copy */
|
/* rest of stuff copy */
|
||||||
@ -216,7 +216,7 @@ static void fix_bonelist_roll (ListBase *bonelist, ListBase *editbonelist)
|
|||||||
printmatrix4 ("difmat", difmat);
|
printmatrix4 ("difmat", difmat);
|
||||||
printf ("Roll = %f\n", (-atan2(difmat[2][0], difmat[2][2]) * (180.0/M_PI)));
|
printf ("Roll = %f\n", (-atan2(difmat[2][0], difmat[2][2]) * (180.0/M_PI)));
|
||||||
#endif
|
#endif
|
||||||
curBone->roll = -atan2(difmat[2][0], difmat[2][2]);
|
curBone->roll = -atan(difmat[2][0]/difmat[2][2]);
|
||||||
if (difmat[0][0]<0.0) curBone->roll +=M_PI;
|
if (difmat[0][0]<0.0) curBone->roll +=M_PI;
|
||||||
|
|
||||||
/* and set restposition again */
|
/* and set restposition again */
|
||||||
@ -429,7 +429,7 @@ int join_armature(void)
|
|||||||
Mat4Invert (imat, premat);
|
Mat4Invert (imat, premat);
|
||||||
Mat4MulMat4 (difmat, postmat, imat);
|
Mat4MulMat4 (difmat, postmat, imat);
|
||||||
|
|
||||||
curbone->roll -=atan2(difmat[2][0], difmat[2][2]);
|
curbone->roll -=atan(difmat[2][0]/difmat[2][2]);
|
||||||
|
|
||||||
if (difmat[0][0]<0)
|
if (difmat[0][0]<0)
|
||||||
curbone->roll +=M_PI;
|
curbone->roll +=M_PI;
|
||||||
@ -1129,7 +1129,7 @@ void auto_align_armature(void)
|
|||||||
Mat3Inv(imat, targetmat);
|
Mat3Inv(imat, targetmat);
|
||||||
Mat3MulMat3(diffmat, imat, curmat);
|
Mat3MulMat3(diffmat, imat, curmat);
|
||||||
|
|
||||||
ebone->roll = atan2(diffmat[2][0], diffmat[2][2]);
|
ebone->roll = atan(diffmat[2][0]/diffmat[2][2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user