Added x-ray bones support (sgefant ended up
authorChris Want <cwant@ualberta.ca>
Tue, 28 Jan 2003 05:16:41 +0000 (05:16 +0000)
committerChris Want <cwant@ualberta.ca>
Tue, 28 Jan 2003 05:16:41 +0000 (05:16 +0000)
doing the bulk of the work when he added the button).
The new x-ray button is added in the edit buttons when
the armature is selected. (suggested by ztonzy)

source/blender/makesdna/DNA_armature_types.h
source/blender/src/editarmature.c

index af80a69046f5092ed9aa3fd74762497f849a680b..95dc6d8689e201cdb58ac950a88b84a401278b3f 100644 (file)
@@ -75,7 +75,7 @@ typedef struct bArmature {
 
 enum {
                ARM_RESTPOSBIT  =       0,
-               ARM_UNUSED1BIT,                                 /* Free for use */
+               ARM_DRAWXRAYBIT,
                ARM_DRAWAXESBIT,
                ARM_DRAWNAMESBIT,
                ARM_POSEBIT,
@@ -84,7 +84,7 @@ enum {
 
 enum {
                ARM_RESTPOS             =       0x00000001,
-               ARM_UNUSED1             =       0x00000002,     /*      Free for use */
+               ARM_DRAWXRAY    =       0x00000002,
                ARM_DRAWAXES    =       0x00000004,
                ARM_DRAWNAMES   =       0x00000008,
                ARM_POSEMODE    =       0x00000010,
index e5f8540729208104eadadb4536ab448204a26188..6e2fbde6fe7ba96d84b3922d408c6af6b506a54c 100644 (file)
@@ -1148,6 +1148,10 @@ void draw_armature(Object *ob)
        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)) {
                cpack (0x000000);
@@ -1232,6 +1236,10 @@ void draw_armature(Object *ob)
 
                arm->flag &= ~ARM_POSEMODE; 
        }
+
+       if (arm->flag & ARM_DRAWXRAY) {
+               if(G.zbuf) glEnable(GL_DEPTH_TEST);
+       }
 }
 
 static void draw_boneverti (float x, float y, float z, float size, int flag)
@@ -1729,6 +1737,7 @@ void armaturebuts(void)
        uiDefButI(block, TOG|BIT|ARM_RESTPOSBIT,REDRAWVIEW3D, "Rest Pos", bx,by,97,20, &arm->flag, 0, 0, 0, 0, "Disable all animation for this object");
        uiDefButI(block, TOG|BIT|ARM_DRAWAXESBIT,REDRAWVIEW3D, "Draw Axes", bx,by-46,97,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
        uiDefButI(block, TOG|BIT|ARM_DRAWNAMESBIT,REDRAWVIEW3D, "Draw Names", bx,by-69,97,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
+       uiDefButI(block, TOG|BIT|ARM_DRAWXRAYBIT,REDRAWVIEW3D, "X-Ray", bx,by-92,97,20, &arm->flag, 0, 0, 0, 0, "Draw armature in front of shaded objects");
 
        uiBlockSetCol(block, BUTGREY);