Cleanup of Armature 3d drawing.
authorTon Roosendaal <ton@blender.org>
Tue, 12 Jul 2005 15:47:53 +0000 (15:47 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 12 Jul 2005 15:47:53 +0000 (15:47 +0000)
- In Solid drawmode, bones get drawn solid too now. Including Outline-
  selection color, if that's set.
  Disable it by setting Object-buttons "drawtype" for the Armature.
  Color used for solid bones is in Theme editor.
- EditMode armature now follows (Mesh edit) theme colors (Vertex, Edge)
- PoseMode armature has ThemeColor for selection, and draws three extra
  colors now;
   - blue shade for bones with action Ipos
   - yellow for bones with IK
   - green for bones with a constraint
- "X ray" now only works for PoseMode... needs review, can be done better
- "Draw Names" option uses theme color too, also indicates selection.

Fixes;

- In Armature EditMode, the deformed Mesh goes to rest-position
- Border select didn't clear 'active' flag in Bones in PoseMode
- Mouse-click select didn't work when a dashed line was close to Bone

source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/lattice.c
source/blender/include/BIF_editarmature.h
source/blender/include/BIF_resources.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/src/drawobject.c
source/blender/src/editarmature.c
source/blender/src/editview.c
source/blender/src/resources.c
source/blender/src/usiblender.c

index 31f07d9e1b3ea84dcfe6a1dc6247b3de3490ba0e..41fee9e3899f27ff787e5f4e9a55b77cf572d8f0 100644 (file)
@@ -448,13 +448,13 @@ void extract_pose_from_action(bPose *pose, bAction *act, float ctime)
                return;
 
        /* Copy the data from the action into the pose */
-       for (achan=act->chanbase.first; achan; achan=achan->next){
-               act->achan= achan;  // for ipos
-
-               ipo = achan->ipo;
-               if (ipo) {
-                       pchan= get_pose_channel(pose, achan->name);
-                       if(pchan) {
+       for (pchan= pose->chanbase.first; pchan; pchan=pchan->next) {
+               achan= get_named_actionchannel(act, pchan->name);
+               pchan->flag= 0;
+               if(achan) {
+                       ipo = achan->ipo;
+                       if (ipo) {
+                               act->achan= achan;  // for ipos
                                act->pchan= pchan;  // for ipos
                                
                                /* Evaluates and sets the internal ipo value */
index db5dee45d5d1e43f6578332004a6fa3f9871d3b6..6e3dde28a539407413ba2098e880ca324e86605d 100644 (file)
@@ -642,7 +642,7 @@ static int _object_deform(Object *ob, int applyflag)
                return 1;
        }
        else if(ob->parent->type==OB_ARMATURE) {
-               if (ob->partype != PARSKEL){
+               if (ob->partype != PARSKEL || ob->parent==G.obedit){
                        return 0;
                }
                
index 77540c46eb50131933dfe690d8be6d0c396f9db7..056888e33f6a3f31fca82542dd6780945d7fe872 100644 (file)
@@ -81,7 +81,7 @@ void  clear_armature(struct Object *ob, char mode);
 void   delete_armature(void);
 void   deselectall_armature(void);
 void   deselectall_posearmature (int test);
-void   draw_armature(struct Object *ob);
+void   draw_armature(struct Object *ob, int dt);
 void   extrude_armature(void);
 void   free_editArmature(void);
 void   join_armature(void);
index 2f194a5811835c14ff1d31cd39c831a7a1b95f0b..70aa35a03d22d603bb07a74f2fe60031b19f7bb5 100644 (file)
@@ -434,7 +434,10 @@ enum {
        TH_SYNTAX_V,
        TH_SYNTAX_C,
        TH_SYNTAX_L,
-       TH_SYNTAX_N
+       TH_SYNTAX_N,
+       
+       TH_BONE_SOLID,
+       TH_BONE_POSE
        
 };
 /* XXX WARNING: previous is saved in file, so do not change order! */
index 9e4480431e31c215cffad280b605ccb9e820c949..f88d298e5ee6e4364303eac37a7b5f704cefe897 100644 (file)
@@ -136,11 +136,11 @@ enum      {
        POSE_KEY                =       0x1000
 };
 
-/* Pose Channel constflag (constraint) */
+/* Pose Channel constflag (constraint detection) */
 #define PCHAN_HAS_IK           1
-#define PCHAN_HAS_TRACK                2
-#define PCHAN_HAS_CONST                4
-
+#define PCHAN_HAS_CONST                2
+       /* only used for drawing Posemode, not stored in channel */
+#define PCHAN_HAS_ACTION       4
 
 #endif
 
index f86d087cc115752bbb6253062da1b651f7e77103..9f2e069173c142329a90d16211bb87845005452a 100644 (file)
@@ -86,6 +86,7 @@ typedef struct ThemeSpace {
        char face[4], face_select[4];   // solid faces
        char face_dot[4];       // selected color
        char normal[4];
+       char bone_solid[4], bone_pose[4];
        
        char vertex_size, facedot_size;
        char bpad[2];
index e1c813de3f069a74fca142e53b1915ab999e4b1c..d87f4826f0dfc171c1c6e0461b9f3568ac786643 100644 (file)
@@ -46,6 +46,7 @@
 
 #include "MTC_matrixops.h"
 
+#include "DNA_armature_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_curve_types.h"
 #include "DNA_constraint_types.h" // for drawing constraint
@@ -3338,6 +3339,15 @@ static void drawSolidSelect(Object *ob)
        } else if (ob->type==OB_MBALL) {
                drawDispListwire(&ob->disp);
        }
+       else if(ob->type==OB_ARMATURE) {
+               if(ob!=G.obpose) {
+                       bArmature *arm= ob->data;
+                       int oldflag= arm->flag;
+                       arm->flag &= ~ARM_DRAWXRAY;
+                       draw_armature(ob, OB_WIRE);     // patch needed for xray option...
+                       arm->flag= oldflag;
+               }
+       }
 
        glLineWidth(1.0);
        glDepthMask(1);
@@ -3704,7 +3714,7 @@ void draw_object(Base *base)
                drawlattice(ob);
                break;
        case OB_ARMATURE:
-               draw_armature (ob);
+               draw_armature (ob, dt);
                break;
        default:
                drawaxes(1.0);
index 4663b799b4245aa0e3379d50aa769d6dfba2585a..56fd7406fd6a39132180ae1ff8636ce7d17dfd4c 100644 (file)
 #include "blendef.h"
 #include "nla.h"
 
-/*  >>>>> FIXME: ARG!  Colours should be defined in a header somewhere! */
-/*     Note, these came from drawobject.c  They really should be in a nice header file somewhere */
-#define B_YELLOW_A     0xBBFFFF
-#define B_YELLOW       0x77FFFF
-#define B_PURPLE       0xFF70FF
-
-#define B_CYAN_A       0xFFFF88
-#define B_CYAN         0xFFFF00
-#define        B_AQUA          0xFFBB55
-
 extern float centre[3], centroid[3];   /* Originally defined in editobject.c */
 
 /*     Macros  */
@@ -482,7 +472,7 @@ void join_armature(void)
 /* used by posemode as well editmode */
 static void * get_nearest_bone (int findunsel)
 {
-       void            *firstunSel=NULL, *data;
+       void            *firstunSel=NULL, *firstSel=NULL, *data;
        unsigned int buffer[MAXPICKBUF];
        short           hits;
        int              i, takeNext=0;
@@ -495,7 +485,7 @@ static void * get_nearest_bone (int findunsel)
        
        glInitNames();
        hits= view3d_opengl_select(buffer, MAXPICKBUF, 0, 0, 0, 0);
-       
+
        /* See if there are any selected bones in this group */
        if (hits){
                for (i=0; i< hits; i++){
@@ -524,9 +514,11 @@ static void * get_nearest_bone (int findunsel)
                                        data = ebone;
                                }
                                
-                               if (sel)
+                               if (sel) {
+                                       if(!firstSel) firstSel= data;
                                        takeNext=1;
-                               else{
+                               }
+                               else {
                                        if (!firstunSel)
                                                firstunSel=data;
                                        if (takeNext)
@@ -537,14 +529,8 @@ static void * get_nearest_bone (int findunsel)
                
                if (firstunSel)
                        return firstunSel;
-               
-               else{
-                       
-                       if (G.obedit)
-                               return BLI_findlink(&G.edbo, buffer[3] & ~(BONESEL_ANY));
-                       else
-                               return get_indexed_bone(OBACT, buffer[3] & ~(BONESEL_ANY));
-               }
+               else 
+                       return firstSel;
        }
        
        return NULL;
@@ -1139,364 +1125,6 @@ void undo_push_armature(char *name)
 
 
 /* **************** END EditMode stuff ********************** */
-/* *************** Armature drawing ******************* */
-
-static void draw_bonevert(void)
-{
-       static GLuint displist=0;
-       
-       if(displist==0) {
-               GLUquadricObj   *qobj;
-               
-               displist= glGenLists(1);
-               glNewList(displist, GL_COMPILE_AND_EXECUTE);
-                               
-               glPushMatrix();
-               
-               qobj    = gluNewQuadric(); 
-               gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); 
-               gluDisk( qobj, 0.0,  0.05, 16, 1);
-               
-               glRotatef (90, 0, 1, 0);
-               gluDisk( qobj, 0.0,  0.05, 16, 1);
-               
-               glRotatef (90, 1, 0, 0);
-               gluDisk( qobj, 0.0,  0.05, 16, 1);
-               
-               gluDeleteQuadric(qobj);  
-               
-               glPopMatrix();
-               glEndList();
-       }
-       else glCallList(displist);
-}
-
-static void draw_bone_octahedral()
-{
-       static GLuint displist=0;
-       
-       if(displist==0) {
-               float vec[6][3];        
-               
-               displist= glGenLists(1);
-               glNewList(displist, GL_COMPILE_AND_EXECUTE);
-
-               vec[0][0]= vec[0][1]= vec[0][2]= 0.0;
-               vec[5][0]= vec[5][2]= 0.0; vec[5][1]= 1.0;
-               
-               vec[1][0]= 0.1; vec[1][2]= 0.1; vec[1][1]= 0.1;
-               vec[2][0]= 0.1; vec[2][2]= -0.1; vec[2][1]= 0.1;
-               vec[3][0]= -0.1; vec[3][2]= -0.1; vec[3][1]= 0.1;
-               vec[4][0]= -0.1; vec[4][2]= 0.1; vec[4][1]= 0.1;
-               
-               /*      Section 1, sides */
-               glBegin(GL_LINE_LOOP);
-               glVertex3fv(vec[0]);
-               glVertex3fv(vec[1]);
-               glVertex3fv(vec[5]);
-               glVertex3fv(vec[3]);
-               glVertex3fv(vec[0]);
-               glVertex3fv(vec[4]);
-               glVertex3fv(vec[5]);
-               glVertex3fv(vec[2]);
-               glEnd();
-               
-               /*      Section 1, square */
-               glBegin(GL_LINE_LOOP);
-               glVertex3fv(vec[1]);
-               glVertex3fv(vec[2]);
-               glVertex3fv(vec[3]);
-               glVertex3fv(vec[4]);
-               glEnd();
-               
-               glEndList();
-       }
-       else glCallList(displist);
-}      
-
-static void draw_bone_solid_octahedral(void)
-{
-       static GLuint displist=0;
-       
-       if(displist==0) {
-               float vec[6][3];        
-               
-               displist= glGenLists(1);
-               glNewList(displist, GL_COMPILE_AND_EXECUTE);
-               
-               vec[0][0]= vec[0][1]= vec[0][2]= 0.0;
-               vec[5][0]= vec[5][2]= 0.0; vec[5][1]= 1.0;
-               
-               vec[1][0]= 0.1; vec[1][2]= 0.1; vec[1][1]= 0.1;
-               vec[2][0]= 0.1; vec[2][2]= -0.1; vec[2][1]= 0.1;
-               vec[3][0]= -0.1; vec[3][2]= -0.1; vec[3][1]= 0.1;
-               vec[4][0]= -0.1; vec[4][2]= 0.1; vec[4][1]= 0.1;
-               
-               
-               glBegin(GL_TRIANGLES);
-               /* bottom */
-               glVertex3fv(vec[0]);glVertex3fv(vec[1]);glVertex3fv(vec[2]);
-               
-               glVertex3fv(vec[0]);glVertex3fv(vec[2]);glVertex3fv(vec[3]);
-               
-               glVertex3fv(vec[0]);glVertex3fv(vec[3]);glVertex3fv(vec[4]);
-
-               glVertex3fv(vec[0]);glVertex3fv(vec[4]);glVertex3fv(vec[1]);
-               /* top */
-               glVertex3fv(vec[5]);glVertex3fv(vec[1]);glVertex3fv(vec[2]);
-               
-               glVertex3fv(vec[5]);glVertex3fv(vec[2]);glVertex3fv(vec[3]);
-               
-               glVertex3fv(vec[5]);glVertex3fv(vec[3]);glVertex3fv(vec[4]);
-               
-               glVertex3fv(vec[5]);glVertex3fv(vec[4]);glVertex3fv(vec[1]);
-               
-               glEnd();
-               
-               glEndList();
-       }
-       else glCallList(displist);
-}      
-
-
-static void draw_bone (int armflag, int boneflag, int constflag, unsigned int id, char *name, float length)
-{
-       float   pointsize;
-       
-       /*      Draw a 3d octahedral bone, we use normalized space based on length,
-           for glDisplayLists */
-       
-       /* pointsize todo! */
-       pointsize = length;
-       if (length<0.1)
-               pointsize=0.1;
-       
-       glScalef(length, length, length);
-       
-       if (id!=-1) glLoadName((GLuint) id );
-       
-       /*      Draw root point if we have no IK parent */
-       if (!(boneflag & BONE_IK_TOPARENT)){
-               if (id != -1)
-                       glLoadName (id | BONESEL_ROOT);
-               
-               if (armflag & ARM_EDITMODE) {
-                       if (boneflag & BONE_ROOTSEL) cpack (B_YELLOW);
-                       else cpack (B_PURPLE);
-               }
-               draw_bonevert();
-       }
-       
-       /*      Draw tip point (for selection only ) */
-       
-       if (id != -1)
-               glLoadName (id | BONESEL_TIP);
-       
-       if (armflag & ARM_EDITMODE) {
-               if (boneflag & BONE_TIPSEL) cpack (B_YELLOW);
-               else cpack (B_PURPLE);
-       }
-       
-       glTranslatef(0.0, 1.0, 0.0);
-       draw_bonevert();
-       
-       /*      Draw additional axes */
-       if (armflag & ARM_DRAWAXES){
-               drawaxes(0.25f);
-       }
-       
-       glTranslatef(0.0, -1.0, 0.0);
-       
-       if (id != -1) {
-               if (armflag & ARM_POSEMODE)
-                       glLoadName((GLuint) id);
-               else{
-                       glLoadName ((GLuint) id|BONESEL_BONE);
-               }
-       }
-       
-       /* colors */
-       if (armflag & ARM_EDITMODE){
-               if (boneflag & BONE_ACTIVE) cpack (B_YELLOW_A);
-               else if (boneflag & BONE_SELECTED) cpack (B_YELLOW);
-               else cpack (B_PURPLE);
-       }
-       else if (armflag & ARM_POSEMODE){
-       
-               if(constflag) {
-                       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-                       glEnable(GL_BLEND);
-                       if(constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 50);
-                       else glColor4ub(0, 255, 120, 50);
-                       draw_bone_solid_octahedral();
-                       glDisable(GL_BLEND);
-               }
-               
-               if (boneflag & BONE_ACTIVE) cpack (B_CYAN_A);
-               else if (boneflag & BONE_SELECTED) cpack (B_CYAN);
-               else cpack (B_AQUA);
-       }               
-       draw_bone_octahedral();
-       
-       /*      Draw the bone name */
-       if (armflag & ARM_DRAWNAMES) {
-               // patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing
-               if((G.f & G_PICKSEL) == 0) {
-                       glRasterPos3f(0,  0.5,  0);
-                       BMF_DrawString(G.font, " ");
-                       BMF_DrawString(G.font, name);
-               }
-       }
-}
-
-
-/* assumes object is Armature with pose */
-static void draw_pose_channels(Object *ob)
-{
-       bPoseChannel *pchan;
-       Bone *bone;
-       bArmature *arm= ob->data;
-       short flag;
-       int index= -1;
-       
-       if (arm->flag & ARM_POSEMODE) index= 0;
-       
-       for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
-               bone= pchan->bone;
-               if(bone) {
-                       if(!(bone->flag & BONE_HIDDEN)) {
-                               
-                               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))
-                                       bone->flag &= ~BONE_IK_TOPARENT;
-                               
-                               draw_bone(arm->flag, flag, pchan->constflag, index, bone->name, bone->length);
-                               
-                               glPopMatrix();
-                       }
-                       if (index!= -1) index++;
-               }
-       }
-       
-}
-
-/* called from drawobject.c */
-void draw_armature(Object *ob)
-{
-       bArmature       *arm;
-       
-       if (ob==NULL) return;
-       
-       arm= ob->data; 
-       if (arm==NULL) return;
-
-       if (!(ob->lay & G.vd->lay))
-               return;
-
-       if (arm->flag & ARM_DRAWXRAY) {
-               if(G.zbuf) glDisable(GL_DEPTH_TEST);
-       }
-
-       /* If we're in editmode, draw the Global edit data */
-       if(ob==G.obedit || (G.obedit && ob->data==G.obedit->data)) {
-               EditBone        *eBone;
-               unsigned int    index;
-               float           delta[3],offset[3];
-               float           mat[3][3], bmat[4][4];
-               float   length;
-               cpack (0);
-               
-               if(ob==G.obedit) arm->flag |= ARM_EDITMODE;
-               for (eBone=G.edbo.first, index=0; eBone; eBone=eBone->next, index++){
-                       if (ob==G.obedit) cpack (B_PURPLE);
-                       else cpack (0);
-                       
-                       glPushMatrix();
-                       
-                       /*      Compose the parent transforms (i.e. their translations) */
-                       VECCOPY (offset,eBone->head);
-
-                       glTranslatef (offset[0],offset[1],offset[2]);
-                       
-                       delta[0]=eBone->tail[0]-eBone->head[0]; 
-                       delta[1]=eBone->tail[1]-eBone->head[1]; 
-                       delta[2]=eBone->tail[2]-eBone->head[2];
-                       
-                       length = sqrt (delta[0]*delta[0] + delta[1]*delta[1] +delta[2]*delta[2]);
-                       
-                       vec_roll_to_mat3(delta, eBone->roll, mat);
-                       Mat4CpyMat3(bmat, mat);
-                               
-                       glMultMatrixf (bmat);
-                       draw_bone (arm->flag, eBone->flag, 0, index, eBone->name, length);
-
-                       glPopMatrix();
-                       
-                       if (eBone->parent) {
-                               glLoadName (-1);
-                               setlinestyle(3);
-                               
-                               glBegin(GL_LINES);
-                               glVertex3fv(eBone->parent->tail);
-                               glVertex3fv(eBone->head);
-                               glEnd();
-
-                               setlinestyle(0);
-                       }
-               }
-               arm->flag &= ~ARM_EDITMODE;
-               cpack (B_YELLOW);
-               
-       }
-       else{
-               /*      Draw Pose */
-               if(ob->pose) {
-                       if (G.obpose == ob) arm->flag |= ARM_POSEMODE;
-                       draw_pose_channels(ob);
-                       arm->flag &= ~ARM_POSEMODE; 
-               }
-
-#if 0  /* Depreciated interactive ik goal drawing */
-                               if (arm->chainbase.first){
-                                       glPushMatrix();
-                                       glTranslatef(((PoseChain*)arm->chainbase.first)->goal[0],
-                                               ((PoseChain*)arm->chainbase.first)->goal[1],
-                                               ((PoseChain*)arm->chainbase.first)->goal[2]);
-                                       drawaxes(1.0);
-                                       glPopMatrix();
-                               }
-#endif
-       }
-
-       if (arm->flag & ARM_DRAWXRAY) {
-               if(G.zbuf) glEnable(GL_DEPTH_TEST);
-       }
-}
-
-/* *************** END Armature drawing ******************* */
 /* *************** Adding stuff in editmode *************** */
 
 static void add_bone_input (Object *ob)
index 26760c502529368bab38447fd43e48e61dc7b527..9e6e45816448b93614f73aa6a1f8e030966b7e9e 100644 (file)
@@ -1258,7 +1258,7 @@ void borderselect(void)
                                        else{   
                                                if (index != -1){
                                                        bone = get_indexed_bone(G.obpose, index &~(BONESEL_TIP|BONESEL_ROOT));
-                                                       bone->flag &= ~BONE_SELECTED;
+                                                       bone->flag &= ~(BONE_ACTIVE|BONE_SELECTED);
                                                        select_actionchannel_by_name(G.obpose->action, bone->name, 0);
                                                }
                                        }
index c6f3d6c8ec484ec96a5877886518932be2658524..c7d0f62b2a16609ccc45468abf436efe0b7a8139 100644 (file)
@@ -509,6 +509,10 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
                                cp= &ts->facedot_size; break;
                        case TH_NORMAL:
                                cp= ts->normal; break;
+                       case TH_BONE_SOLID:
+                               cp= ts->bone_solid; break;
+                       case TH_BONE_POSE:
+                               cp= ts->bone_pose; break;
 
                        case TH_SYNTAX_B:
                                cp= ts->syntaxb; break;
@@ -601,6 +605,10 @@ void BIF_InitTheme(void)
        SETCOL(btheme->tv3d.face_dot, 255, 138, 48, 255);
        btheme->tv3d.facedot_size= 4;
        
+       SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255);
+       SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 100);              // alpha 100 is not meant editable, used for wire+action draw
+       
+       
        /* space buttons */
        /* to have something initialized */
        btheme->tbuts= btheme->tv3d;
@@ -759,6 +767,8 @@ char *BIF_ThemeColorsPup(int spacetype)
                        sprintf(str, "Face Dot Selected %%x%d|", TH_FACE_DOT); strcat(cp, str);
                        sprintf(str, "Face Dot Size %%x%d|", TH_FACEDOT_SIZE); strcat(cp, str);
                        sprintf(str, "Normal %%x%d", TH_NORMAL); strcat(cp, str);
+                       sprintf(str, "Bone Solid %%x%d", TH_BONE_SOLID); strcat(cp, str);
+                       sprintf(str, "Bone Pose %%x%d", TH_BONE_POSE); strcat(cp, str);
                }
                else if(spacetype==SPACE_IPO) {
                        sprintf(str, "Panel %%x%d|", TH_PANEL); strcat(cp, str);
index d9a414294517df2119c699ac8f34551f80134f1d..5ce57cfbe2f48954de3b0caa921e5ac4e4330bc0 100644 (file)
@@ -225,6 +225,17 @@ static void init_userdef_file(void)
                        }
                }
        }
+       if (G.main->versionfile <= 237) {
+               bTheme *btheme;
+               /* bone colors */
+               for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+                       /* check for alpha==0 is safe, then color was never set */
+                       if(btheme->tv3d.bone_solid[3]==0) {
+                               SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255);
+                               SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 100);
+                       }
+               }
+       }
        
        if (U.undosteps==0) U.undosteps=32;