Armature drawing fixes;

- Dashed line to parent bone was drawn to wrong bone in Rest Position
- Dashed line had selection color of parent, not of own bone.
This commit is contained in:
Ton Roosendaal
2005-07-09 14:08:09 +00:00
parent c8f195d00c
commit 30f89a6db7
2 changed files with 18 additions and 17 deletions

View File

@@ -982,14 +982,13 @@ void where_is_pose (Object *ob)
if(bone) {
Mat4CpyMat4(pchan->pose_mat, bone->arm_mat);
VECCOPY(pchan->pose_head, bone->arm_head);
VECCOPY(pchan->pose_tail, pchan->pose_head);
VECCOPY(pchan->pose_tail, bone->arm_tail);
}
}
}
else {
Mat4Invert(ob->imat, ob->obmat); // imat is needed
//#if 0
/* 1. construct the PoseChains, clear flags */
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
pchan->flag &= ~POSE_DONE;

View File

@@ -1398,28 +1398,30 @@ static void draw_pose_channels(Object *ob)
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
bone= pchan->bone;
if(bone) {
// Draw a line from our root to the parent's tip
if (bone->parent && !(bone->flag & (BONE_IK_TOPARENT|BONE_HIDDEN)) ){
if (arm->flag & ARM_POSEMODE) glLoadName (-1);
setlinestyle(3);
glBegin(GL_LINES);
glVertex3fv(pchan->pose_head);
glVertex3fv(pchan->parent->pose_tail);
glEnd();
setlinestyle(0);
}
if(!(bone->flag & BONE_HIDDEN)) {
glPushMatrix();
glMultMatrixf(pchan->pose_mat);
if (index!= -1) { // set color for points */
if (bone->flag & BONE_ACTIVE) cpack (B_CYAN_A);
else if (bone->flag & BONE_SELECTED) cpack (B_CYAN);
else cpack (B_AQUA);
}
// Draw a line from our root to the parent's tip
if (bone->parent && !(bone->flag & BONE_IK_TOPARENT) ){
if (arm->flag & ARM_POSEMODE) glLoadName (-1);
setlinestyle(3);
glBegin(GL_LINES);
glVertex3fv(pchan->pose_head);
glVertex3fv(pchan->parent->pose_tail);
glEnd();
setlinestyle(0);
}
glPushMatrix();
glMultMatrixf(pchan->pose_mat);
/* catch exception for bone with hidden parent */
flag= bone->flag;
if(bone->parent && (bone->parent->flag & BONE_HIDDEN))