diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 4ae94675ea7..fc17ba62b44 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -155,7 +155,8 @@ typedef enum eBone_Flag { BONE_UNKEYED = (1<<13), /* set to prevent destruction of its unkeyframed pose (after transform) */ BONE_HINGE_CHILD_TRANSFORM = (1<<14), /* set to prevent hinge child bones from influencing the transform center */ BONE_NO_SCALE = (1<<15), /* No parent scale */ - BONE_HIDDEN_PG = (1<<16) /* hidden bone when drawing PoseChannels (for ghost drawing) */ + BONE_HIDDEN_PG = (1<<16), /* hidden bone when drawing PoseChannels (for ghost drawing) */ + BONE_DRAWWIRE = (1<<17) /* bone should be drawn as OB_WIRE, regardless of draw-types of view+armature */ } eBone_Flag; #endif diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 901e708bcda..59f51da965e 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -4355,9 +4355,11 @@ static void editing_panel_pose_bones(Object *ob, bArmature *arm) MEM_freeN(menustr); ob_arm_bone_pchan_lock(ob, arm, curBone, pchan); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, REDRAWVIEW3D, "OB:", 220,by,110,19, &pchan->custom, "Object that defines custom draw type for this Bone"); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, REDRAWVIEW3D, "OB:", 220,by,90,19, &pchan->custom, "Object that defines custom draw type for this Bone"); ob_arm_bone_pchan_lock(ob, arm, curBone, NULL); + uiDefButBitI(block, TOG, BONE_DRAWWIRE, B_ARM_RECALCDATA, "W", 309,by,21,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Custom shape of this Bone should always be drawn as a wireframe"); + /* Segment, ease in/out buttons */ uiBlockBeginAlign(block); uiDefButS(block, NUM, B_ARM_RECALCDATA, "Segm: ", -10,by-19,117,19, &curBone->segments, 1.0, 32.0, 0.0, 0.0, "Subdivisions for B-bones"); diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c index f7bbfffe153..5cf421dd961 100644 --- a/source/blender/src/drawarmature.c +++ b/source/blender/src/drawarmature.c @@ -1521,13 +1521,13 @@ static void draw_pose_channels(Base *base, int dt) GLfloat tmp; float smat[4][4], imat[4][4]; int index= -1; - int do_dashed= 1; + int do_dashed= 3; short flag, constflag; /* hacky... prevent outline select from drawing dashed helplines */ glGetFloatv(GL_LINE_WIDTH, &tmp); - if (tmp > 1.1) do_dashed= 0; - if (G.vd->flag & V3D_HIDE_HELPLINES) do_dashed= 0; + if (tmp > 1.1) do_dashed &= ~1; + if (G.vd->flag & V3D_HIDE_HELPLINES) do_dashed &= ~2; /* precalc inverse matrix for drawing screen aligned */ if (arm->drawtype==ARM_ENVELOPE) { @@ -1584,8 +1584,13 @@ static void draw_pose_channels(Base *base, int dt) /* set color-set to use */ set_pchan_colorset(ob, pchan); - if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) - draw_custom_bone(pchan->custom, OB_SOLID, arm->flag, flag, index, bone->length); + if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) { + /* BONE_DRAWWIRE case is here too, as sometimes wire overlay won't be done */ + if (pchan->bone->flag & BONE_DRAWWIRE) + draw_custom_bone(pchan->custom, OB_WIRE, arm->flag, flag, index, bone->length); + else + draw_custom_bone(pchan->custom, OB_SOLID, arm->flag, flag, index, bone->length); + } else if (arm->drawtype==ARM_LINE) ; /* nothing in solid */ else if (arm->drawtype==ARM_ENVELOPE) @@ -1674,16 +1679,16 @@ static void draw_pose_channels(Base *base, int dt) /* extra draw service for pose mode */ constflag= pchan->constflag; - if(pchan->flag & (POSE_ROT|POSE_LOC|POSE_SIZE)) + if (pchan->flag & (POSE_ROT|POSE_LOC|POSE_SIZE)) constflag |= PCHAN_HAS_ACTION; - if(pchan->flag & POSE_STRIDE) + if (pchan->flag & POSE_STRIDE) constflag |= PCHAN_HAS_STRIDE; /* set color-set to use */ set_pchan_colorset(ob, pchan); - if (pchan->custom && !(arm->flag & ARM_NO_CUSTOM)) { - if (dt < OB_SOLID) + if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) { + if ((dt < OB_SOLID) || (pchan->bone->flag & BONE_DRAWWIRE)) draw_custom_bone(pchan->custom, OB_WIRE, arm->flag, flag, index, bone->length); } else if (arm->drawtype==ARM_ENVELOPE) {