Two armature fixes;

- PoseMode selection accidentally always selected first bone as well (on
  multiple clicks)
- Hinge Bone didn't have correct inverse matrix in transform, for local
  rotations.
This commit is contained in:
Ton Roosendaal
2005-08-13 18:55:24 +00:00
parent e1584df90b
commit 184e4fdaae
2 changed files with 47 additions and 41 deletions

View File

@@ -462,48 +462,50 @@ static void *get_bone_from_selectbuffer(Base *base, unsigned int *buffer, short
for (i=0; i< hits; i++){
hitresult = buffer[3+(i*4)];
if (!(hitresult & BONESEL_NOSEL)) {
/* Determine which points are selected */
hitresult &= ~(BONESEL_ANY);
/* Determine what the current bone is */
if (G.obedit==NULL) {
/* no singular posemode, so check for correct object */
if(base->selcol == (hitresult & 0xFFFF)) {
bone = get_indexed_bone(ob, hitresult);
if (findunsel)
sel = (bone->flag & BONE_SELECTED);
else
sel = !(bone->flag & BONE_SELECTED);
data = bone;
}
else {
data= NULL;
sel= 0;
}
}
else{
ebone = BLI_findlink(&G.edbo, hitresult);
if (findunsel)
sel = (ebone->flag & BONE_SELECTED);
else
sel = !(ebone->flag & BONE_SELECTED);
if (!(hitresult & BONESEL_NOSEL)) { // -1
if(hitresult & BONESEL_ANY) { // to avoid including objects in selection
data = ebone;
}
if(data) {
if (sel) {
if(!firstSel) firstSel= data;
takeNext=1;
hitresult &= ~(BONESEL_ANY);
/* Determine what the current bone is */
if (G.obedit==NULL) {
/* no singular posemode, so check for correct object */
if(base->selcol == (hitresult & 0xFFFF)) {
bone = get_indexed_bone(ob, hitresult);
if (findunsel)
sel = (bone->flag & BONE_SELECTED);
else
sel = !(bone->flag & BONE_SELECTED);
data = bone;
}
else {
data= NULL;
sel= 0;
}
}
else {
if (!firstunSel)
firstunSel=data;
if (takeNext)
return data;
else{
ebone = BLI_findlink(&G.edbo, hitresult);
if (findunsel)
sel = (ebone->flag & BONE_SELECTED);
else
sel = !(ebone->flag & BONE_SELECTED);
data = ebone;
}
if(data) {
if (sel) {
if(!firstSel) firstSel= data;
takeNext=1;
}
else {
if (!firstunSel)
firstunSel=data;
if (takeNext)
return data;
}
}
}
}

View File

@@ -428,7 +428,11 @@ static int add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tra
/* proper way to get the parent transform + own transform */
Mat3CpyMat4(omat, ob->obmat);
if(pchan->parent) {
Mat3CpyMat4(pmat, pchan->parent->pose_mat);
if(pchan->bone->flag & BONE_HINGE)
Mat3CpyMat4(pmat, pchan->parent->bone->arm_mat);
else
Mat3CpyMat4(pmat, pchan->parent->pose_mat);
Mat3MulSerie(td->mtx, pchan->bone->bone_mat, pmat, omat, 0,0,0,0,0); // dang mulserie swaps args
}
else {