[Bf-blender-cvs] [f20cd49c308] blender-v2.81-release: Fix bones without parents missing head vertex
Campbell Barton
noreply at git.blender.org
Tue Oct 29 17:39:26 CET 2019
Commit: f20cd49c30834401e438dbd0675b6d41ab4d25c5
Author: Campbell Barton
Date: Wed Oct 30 03:18:48 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rBf20cd49c30834401e438dbd0675b6d41ab4d25c5
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.
===================================================================
M source/blender/draw/intern/draw_armature.c
===================================================================
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) {
More information about the Bf-blender-cvs
mailing list