diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-29 19:18:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-29 19:37:50 +0300 |
commit | f20cd49c30834401e438dbd0675b6d41ab4d25c5 (patch) | |
tree | d79f817528b5a387948be61757541b34493e36d6 /source/blender/draw/intern/draw_armature.c | |
parent | 87ac3d14b29d61d74b9aee2296f5b9892e2aa4a0 (diff) |
Fix bones without parents missing head vertex
When the connected was enabled for a parentless bone the head vertex
wasn't displayed and couldn't be selected.
Diffstat (limited to 'source/blender/draw/intern/draw_armature.c')
-rw-r--r-- | source/blender/draw/intern/draw_armature.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index 5cd6a4a1286..e16dfb5004b 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -1350,7 +1350,8 @@ static void draw_points(const EditBone *eBone, bone_hint_color_shade(col_hint_tail, (g_theme.const_color) ? col_solid_tail : col_wire_tail); /* Draw root point if we are not connected to our parent */ - if ((BONE_FLAG(eBone, pchan) & BONE_CONNECTED) == 0) { + if (!(eBone ? (eBone->parent && (eBone->flag & BONE_CONNECTED)) : + (pchan->bone->parent && (pchan->bone->flag & BONE_CONNECTED)))) { if (select_id != -1) { DRW_select_load_id(select_id | BONESEL_ROOT); } @@ -1518,29 +1519,32 @@ static void draw_bone_line(EditBone *eBone, const float *col_head = no_display; const float *col_tail = col_bone; - if (eBone) { - if (eBone->flag & BONE_TIPSEL) { - col_tail = g_theme.vertex_select_color; - } - if (boneflag & BONE_SELECTED) { - col_bone = g_theme.edge_select_color; - } - col_wire = g_theme.wire_color; + if (g_theme.const_color != NULL) { + col_wire = no_display; /* actually shrink the display. */ + col_bone = col_head = col_tail = g_theme.const_color; } - - /* Draw root point if we are not connected to our parent */ - if ((BONE_FLAG(eBone, pchan) & BONE_CONNECTED) == 0) { + else { if (eBone) { - col_head = (eBone->flag & BONE_ROOTSEL) ? g_theme.vertex_select_color : col_bone; - } - else if (pchan) { - col_head = col_bone; + if (eBone->flag & BONE_TIPSEL) { + col_tail = g_theme.vertex_select_color; + } + if (boneflag & BONE_SELECTED) { + col_bone = g_theme.edge_select_color; + } + col_wire = g_theme.wire_color; } - } - if (g_theme.const_color != NULL) { - col_wire = no_display; /* actually shrink the display. */ - col_bone = col_head = col_tail = g_theme.const_color; + /* Draw root point if we are not connected to our parent. */ + if (!(eBone ? (eBone->parent && (eBone->flag & BONE_CONNECTED)) : + (pchan->bone->parent && (pchan->bone->flag & BONE_CONNECTED)))) { + + if (eBone) { + col_head = (eBone->flag & BONE_ROOTSEL) ? g_theme.vertex_select_color : col_bone; + } + else { + col_head = col_bone; + } + } } if (select_id == -1) { |