From 9ca562765b3b765aeee7eb487eded0093c5be935 Mon Sep 17 00:00:00 2001 From: Chris Want Date: Tue, 28 Jan 2003 05:16:41 +0000 Subject: Added x-ray bones support (sgefant ended up 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 | 4 ++-- source/blender/src/editarmature.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index af80a69046f..95dc6d8689e 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -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, diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index e5f85407292..6e2fbde6fe7 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -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); -- cgit v1.2.3