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)
This commit is contained in:
@@ -75,7 +75,7 @@ typedef struct bArmature {
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
ARM_RESTPOSBIT = 0,
|
ARM_RESTPOSBIT = 0,
|
||||||
ARM_UNUSED1BIT, /* Free for use */
|
ARM_DRAWXRAYBIT,
|
||||||
ARM_DRAWAXESBIT,
|
ARM_DRAWAXESBIT,
|
||||||
ARM_DRAWNAMESBIT,
|
ARM_DRAWNAMESBIT,
|
||||||
ARM_POSEBIT,
|
ARM_POSEBIT,
|
||||||
@@ -84,7 +84,7 @@ enum {
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
ARM_RESTPOS = 0x00000001,
|
ARM_RESTPOS = 0x00000001,
|
||||||
ARM_UNUSED1 = 0x00000002, /* Free for use */
|
ARM_DRAWXRAY = 0x00000002,
|
||||||
ARM_DRAWAXES = 0x00000004,
|
ARM_DRAWAXES = 0x00000004,
|
||||||
ARM_DRAWNAMES = 0x00000008,
|
ARM_DRAWNAMES = 0x00000008,
|
||||||
ARM_POSEMODE = 0x00000010,
|
ARM_POSEMODE = 0x00000010,
|
||||||
|
@@ -1148,6 +1148,10 @@ void draw_armature(Object *ob)
|
|||||||
if (!(ob->lay & G.vd->lay))
|
if (!(ob->lay & G.vd->lay))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (arm->flag & ARM_DRAWXRAY) {
|
||||||
|
if(G.zbuf) glDisable(GL_DEPTH_TEST);
|
||||||
|
}
|
||||||
|
|
||||||
/* If we're in editmode, draw the Global edit data */
|
/* If we're in editmode, draw the Global edit data */
|
||||||
if(ob==G.obedit || (G.obedit && ob->data==G.obedit->data)) {
|
if(ob==G.obedit || (G.obedit && ob->data==G.obedit->data)) {
|
||||||
cpack (0x000000);
|
cpack (0x000000);
|
||||||
@@ -1232,6 +1236,10 @@ void draw_armature(Object *ob)
|
|||||||
|
|
||||||
arm->flag &= ~ARM_POSEMODE;
|
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)
|
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_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_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_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);
|
uiBlockSetCol(block, BUTGREY);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user