Orange: Made dashed parent-offset lines option for drawing Poses.

Was too ugly! :)
This commit is contained in:
Ton Roosendaal
2005-12-18 20:57:04 +00:00
parent 0c76f64554
commit 2986d03e77
3 changed files with 14 additions and 10 deletions

View File

@@ -95,6 +95,7 @@ typedef struct bArmature {
#define ARM_DONT_USE 0x080
#define ARM_MIRROR_EDIT 0x100
#define ARM_AUTO_IK 0x200
#define ARM_NO_PARLINES 0x400
/* armature->drawtype */
#define ARM_OCTA 0

View File

@@ -2789,18 +2789,20 @@ static void editing_panel_armature_type(Object *ob, bArmature *arm)
uiDefButI(block, ROW, REDRAWVIEW3D, "B-Bone", 155, 100,70,20, &arm->drawtype, 0, ARM_B_BONE, 0, 0, "Draw bones as boxes, showing subdivision and b-splines");
uiDefButI(block, ROW, REDRAWVIEW3D, "Envelope", 225, 100,85,20, &arm->drawtype, 0, ARM_ENVELOPE, 0, 0, "Draw bones as extruded spheres, showing deformation influence volume");
uiDefButBitI(block, TOG, ARM_DRAWAXES, REDRAWVIEW3D, "Draw Axes", 10, 80,80,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
uiDefButBitI(block, TOG, ARM_DRAWNAMES, REDRAWVIEW3D, "Draw Names", 90,80,80,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
uiDefButS(block, NUM, REDRAWVIEW3D, "Ghost: ", 170,80,80,20, &arm->ghostep, 0.0f, 30.0f, 0, 0, "Draw Ghosts around current frame, for current Action");
uiDefButS(block, NUM, REDRAWVIEW3D, "Step: ", 250,80,60,20, &arm->ghostsize, 1.0f, 20.0f, 0, 0, "How many frames between Ghost instances");
uiDefButBitI(block, TOG, ARM_DRAWAXES, REDRAWVIEW3D, "Draw Axes", 10, 80,100,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
uiDefButBitI(block, TOG, ARM_DRAWNAMES, REDRAWVIEW3D, "Draw Names", 110,80,100,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
uiDefButBitI(block, TOGN, ARM_NO_PARLINES, REDRAWVIEW3D, "Draw Offset", 210,80,100,20, &arm->flag, 0, 0, 0, 0, "Draw offsets to parent bones with dashed line");
uiDefButS(block, NUM, REDRAWVIEW3D, "Ghost: ", 10,60,150,20, &arm->ghostep, 0.0f, 30.0f, 0, 0, "Draw Ghosts around current frame, for current Action");
uiDefButS(block, NUM, REDRAWVIEW3D, "Step: ", 160,60,150,20, &arm->ghostsize, 1.0f, 20.0f, 0, 0, "How many frames between Ghost instances");
uiBlockEndAlign(block);
uiDefBut(block, LABEL, 0, "Deform Options", 10,60,150,20, 0, 0, 0, 0, 0, "");
uiDefBut(block, LABEL, 0, "Deform Options", 10,40,150,20, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiDefButBitS(block, TOG, ARM_DEF_VGROUP, B_ARM_RECALCDATA, "Vertex Groups", 10, 40,150,20, &arm->deformflag, 0, 0, 0, 0, "Enable VertexGroups defining deform (not for Modifiers)");
uiDefButBitS(block, TOG, ARM_DEF_ENVELOPE, B_ARM_RECALCDATA, "Envelopes", 160,40,150,20, &arm->deformflag, 0, 0, 0, 0, "Enable Bone Envelopes defining deform (not for Modifiers)");
uiDefButBitI(block, TOG, ARM_RESTPOS, B_ARM_RECALCDATA,"Rest Position", 10,20,150,20, &arm->flag, 0, 0, 0, 0, "Show armature rest position, no posing possible");
uiDefButBitI(block, TOG, ARM_DELAYDEFORM, REDRAWVIEW3D, "Delay Deform", 160,20,150,20, &arm->flag, 0, 0, 0, 0, "Don't deform children when manipulating bones in pose mode");
uiDefButBitS(block, TOG, ARM_DEF_VGROUP, B_ARM_RECALCDATA, "Vertex Groups", 10, 20,150,20, &arm->deformflag, 0, 0, 0, 0, "Enable VertexGroups defining deform (not for Modifiers)");
uiDefButBitS(block, TOG, ARM_DEF_ENVELOPE, B_ARM_RECALCDATA, "Envelopes", 160,20,150,20, &arm->deformflag, 0, 0, 0, 0, "Enable Bone Envelopes defining deform (not for Modifiers)");
uiDefButBitI(block, TOG, ARM_RESTPOS, B_ARM_RECALCDATA,"Rest Position", 10,0,150,20, &arm->flag, 0, 0, 0, 0, "Show armature rest position, no posing possible");
uiDefButBitI(block, TOG, ARM_DELAYDEFORM, REDRAWVIEW3D, "Delay Deform", 160,0,150,20, &arm->flag, 0, 0, 0, 0, "Don't deform children when manipulating bones in pose mode");
}

View File

@@ -1327,6 +1327,7 @@ static void draw_pose_channels(Base *base, int dt)
/* hacky... prevent outline select from drawing dashed helplines */
glGetFloatv(GL_LINE_WIDTH, &tmp);
if(tmp > 1.1) do_dashed= 0;
if(arm->flag & ARM_NO_PARLINES) do_dashed= 0;
/* precalc inverse matrix for drawing screen aligned */
if(arm->drawtype==ARM_ENVELOPE) {
@@ -1416,7 +1417,7 @@ static void draw_pose_channels(Base *base, int dt)
if(bone && !(bone->flag & BONE_HIDDEN_P)) {
if(bone->layer & arm->layer) {
if (do_dashed && bone->parent) {
// Draw a line from our root to the parent's tip
/* Draw a line from our root to the parent's tip */
if(!(bone->flag & BONE_CONNECTED) ){
if (arm->flag & ARM_POSEMODE) {
glLoadName (index & 0xFFFF); // object tag, for bordersel optim