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
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-01-30 11:10:47 +0300
committerJoshua Leung <aligorith@gmail.com>2008-01-30 11:10:47 +0300
commit7d1bc94cad1d00929a77d7bba396c65788bd3ded (patch)
tree5989d1388b0c6f0a14bd3d3c0d481c379c2123f2 /source/blender/src/drawarmature.c
parente7f814b1a30269a5cf10ae6a701ff3b07d49cbf5 (diff)
== Custom Bone Shape Drawing - 'Wireframe' Option ==
In production rigs, such as those for Peach and Plumiferos, custom bone shapes are often simple wireframe shapes (formed with a single line). These are only visible when the armature's drawtype is Wire, which means that this drawtype must be used for the display of those bones. On the other hand, 'normal' bones must also be drawn as wireframes. I've added a small toggle beside the field for the name of the object to use. This is marked 'W' (this is not great, but it'll have to do for now). When activated, that bone's custom bone shape will always draw as a wireframe. As a result, the armature's drawtype doesn't have to be set to 'Wire' to see these bones.
Diffstat (limited to 'source/blender/src/drawarmature.c')
-rw-r--r--source/blender/src/drawarmature.c23
1 files changed, 14 insertions, 9 deletions
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) {