More fixes thanks to irc testing;

- On exit editmode and after deleting bones, a pointer in PoseChannels
  was not set NULL correctly, causing potential crashes.
- Action Window: select on 'ipo key' (little icon) didn't select/deselect
  the associated bone (old bug!)
- After unlinking an Action, the blue color in bones was not cleared

Also:

- Improved selection in editmode, doing it in 2 stages. Makes it a lot more
  accurate.
This commit is contained in:
2005-07-17 19:08:04 +00:00
parent a229931ce6
commit 141e577353
4 changed files with 21 additions and 6 deletions

View File

@@ -731,6 +731,8 @@ static int rebuild_pose_bone(bPose *pose, Bone *bone, bPoseChannel *parchan, int
/* for quick detecting of next bone in chain */
if(bone->flag & BONE_IK_TOPARENT)
pchan->child= get_pose_channel(pose, bone->name);
else
pchan->child= NULL;
}
return counter;

View File

@@ -247,10 +247,12 @@ void select_actionchannel_by_name (bAction *act, char *name, int select)
if (select){
chan->flag |= ACHAN_SELECTED;
hilight_channel (act, chan, 1);
select_poseelement_by_name(chan->name, 1);
}
else{
chan->flag &= ~ACHAN_SELECTED;
hilight_channel (act, chan, 0);
select_poseelement_by_name(chan->name, 0);
}
return;
}
@@ -567,6 +569,7 @@ static void mouse_action(int selectmode)
act->achan = chan;
chan->flag |= ACHAN_SELECTED;
hilight_channel (act, chan, 1);
select_poseelement_by_name(chan->name, 1);
}
if (conchan)

View File

@@ -525,7 +525,7 @@ static int select_bonechildren_by_name (Bone *bone, char *name, int select)
if (select)
bone->flag |= BONE_SELECTED;
else
bone->flag &= ~BONE_SELECTED;
bone->flag &= ~(BONE_SELECTED|BONE_ACTIVE);
return 1;
}
@@ -537,7 +537,7 @@ static int select_bonechildren_by_name (Bone *bone, char *name, int select)
return 0;
}
/* called in editction.c */
/* called in editaction.c */
void select_bone_by_name (bArmature *arm, char *name, int select)
{
Bone *bone;
@@ -721,13 +721,17 @@ static EditBone * get_nearest_editbonepoint (int findunsel, int *selmask)
unsigned int buffer[MAXPICKBUF];
unsigned int hitresult, besthitresult=BONESEL_NOSEL;
int i, mindep= 4;
short hits;
short hits, mval[2];
persp(PERSP_VIEW);
glInitNames();
hits= view3d_opengl_select(buffer, MAXPICKBUF, 0, 0, 0, 0);
getmouseco_areawin(mval);
hits= view3d_opengl_select(buffer, MAXPICKBUF, mval[0]-5, mval[1]-5, mval[0]+5, mval[1]+5);
if(hits==0)
hits= view3d_opengl_select(buffer, MAXPICKBUF, mval[0]-12, mval[1]-12, mval[0]+12, mval[1]+12);
/* See if there are any selected bones in this group */
if (hits) {

View File

@@ -934,8 +934,14 @@ void do_global_buttons(unsigned short event)
if (act)
act->id.us--;
ob->action=NULL;
if(ob->pose) { // clear flag, also used for draw colors
bPoseChannel *pchan;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next)
pchan->flag= 0;
}
BIF_undo_push("Unlink Action");
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWIPO, 0);