Tweak for action group -> bone select feature

Set newly selected bone as "active", so that the transform properties show the
correct values for the newly selected bone
This commit is contained in:
Joshua Leung 2013-10-18 14:15:08 +00:00
parent 38c16f9bf4
commit a15818f1f7

@ -75,13 +75,18 @@ void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select)
return; return;
arm = ob->data; arm = ob->data;
/* can only change selection state if bone can be modified */ /* can only change selection state if bone can be modified */
if (PBONE_SELECTABLE(arm, pchan->bone)) { if (PBONE_SELECTABLE(arm, pchan->bone)) {
/* change selection state */ /* change selection state - activate too if selected */
if (select) if (select) {
pchan->bone->flag |= BONE_SELECTED; pchan->bone->flag |= BONE_SELECTED;
else arm->act_bone = pchan->bone;
}
else {
pchan->bone->flag &= ~BONE_SELECTED; pchan->bone->flag &= ~BONE_SELECTED;
arm->act_bone = NULL;
}
// TODO: select and activate corresponding vgroup? // TODO: select and activate corresponding vgroup?
@ -91,6 +96,9 @@ void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select)
if (arm->flag & ARM_HAS_VIZ_DEPS) { if (arm->flag & ARM_HAS_VIZ_DEPS) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
} }
/* send necessary notifiers */
WM_main_add_notifier(NC_GEOM | ND_DATA, ob);
} }
} }