diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-05 14:47:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-05 14:47:43 +0300 |
commit | cce1d178b8ea9ac948ca7be4017a28b57dda6785 (patch) | |
tree | a7ee66ea8208f7cf71dd7aa649cd4eafe99184e9 /source/blender/editors/space_view3d/drawarmature.c | |
parent | 52a2b8285202cec6d5b03e5e0e6488e53018d473 (diff) |
obscure feature: Display Custom Bone Shape at another bones transform.
Brecht and I took a fair bit of convincing on this one however Cessen was jumping through hoops to do without this feature.
Having the shape being an external mesh deformed by its own armature, which were both hidden but in the same layer *(so the depgraph would update them).
Without this some of the bones in the rig also dont make much sense when animating with.
Diffstat (limited to 'source/blender/editors/space_view3d/drawarmature.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index d8c2fb9d43e..c59c5cddb3f 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1622,8 +1622,14 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, if ( (bone) && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)) ) { if (bone->layer & arm->layer) { + int use_custom = (pchan->custom) && !(arm->flag & ARM_NO_CUSTOM); glPushMatrix(); - glMultMatrixf(pchan->pose_mat); + + if(use_custom && pchan->custom_tx) { + glMultMatrixf(pchan->custom_tx->pose_mat); + } else { + glMultMatrixf(pchan->pose_mat); + } /* catch exception for bone with hidden parent */ flag= bone->flag; @@ -1637,7 +1643,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* set color-set to use */ set_pchan_colorset(ob, pchan); - if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) { + if (use_custom) { /* if drawwire, don't try to draw in solid */ if (pchan->bone->flag & BONE_DRAWWIRE) draw_wire= 1; @@ -1687,7 +1693,12 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, if (pchan->custom) { if ((dt < OB_SOLID) || (bone->flag & BONE_DRAWWIRE)) { glPushMatrix(); - glMultMatrixf(pchan->pose_mat); + + if(pchan->custom_tx) { + glMultMatrixf(pchan->custom_tx->pose_mat); + } else { + glMultMatrixf(pchan->pose_mat); + } /* prepare colors */ if (arm->flag & ARM_POSEMODE) |