Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorChris Want <cwant@ualberta.ca>2003-01-28 08:16:41 +0300
committerChris Want <cwant@ualberta.ca>2003-01-28 08:16:41 +0300
commit9ca562765b3b765aeee7eb487eded0093c5be935 (patch)
treeb0933060c7970c52193c0b6a13821e7fb5f36469 /source
parente36159ce85c6b6cb9393b3a2c4f04d45901b94e8 (diff)
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)
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesdna/DNA_armature_types.h4
-rw-r--r--source/blender/src/editarmature.c9
2 files changed, 11 insertions, 2 deletions
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);