diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-05-06 19:29:49 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-06 19:36:47 +0300 |
commit | 48ddb2b98a5d9f77d5589afd137019dc85f1e460 (patch) | |
tree | 11ce871bf547dc713e925f08b5ff47a9281bcf9d /source | |
parent | 1c3f953565cefd7d59499e0ea99c3fea5890357f (diff) |
Armature: Fix bone axes not using bone color.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_armature.c | 1 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 2 | ||||
-rw-r--r-- | source/blender/draw/modes/shaders/armature_axes_vert.glsl | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index 78b8482dad6..c4331f4ebdc 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -988,6 +988,7 @@ static void draw_axes(EditBone *eBone, bPoseChannel *pchan) const float *col = (g_theme.const_color) ? g_theme.const_color : (BONE_FLAG(eBone, pchan) & BONE_SELECTED) ? g_theme.text_hi_color : g_theme.text_color; copy_v4_v4(final_col, col); + final_col[3] = (g_theme.const_color) ? 1.0 : 0.3; /* Mix with axes color. */ drw_shgroup_bone_axes(BONE_VAR(eBone, pchan, disp_mat), final_col); } diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index b2b25410ce4..dc54c4e722f 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -452,7 +452,7 @@ DRWShadingGroup *shgroup_instance_bone_axes(DRWPass *pass) DRWShadingGroup *grp = DRW_shgroup_instance_create(g_shaders.bone_axes, pass, DRW_cache_bone_arrows_get(), - g_formats.instance_bone_outline); + g_formats.instance_color); DRW_shgroup_uniform_vec3(grp, "screenVecs[0]", DRW_viewport_screenvecs_get(), 2); return grp; diff --git a/source/blender/draw/modes/shaders/armature_axes_vert.glsl b/source/blender/draw/modes/shaders/armature_axes_vert.glsl index 3a70c5d8515..fe6edba1316 100644 --- a/source/blender/draw/modes/shaders/armature_axes_vert.glsl +++ b/source/blender/draw/modes/shaders/armature_axes_vert.glsl @@ -9,7 +9,7 @@ in vec3 colorAxis; /* ---- Per instance Attribs ---- */ in mat4 InstanceModelMatrix; -in vec3 color; +in vec4 color; flat out vec4 finalColor; @@ -25,6 +25,6 @@ void main() gl_Position = ViewProjectionMatrix * vec4(wpos + spos, 1.0); - finalColor.rgb = mix(color, colorAxis, 0.9); + finalColor.rgb = mix(colorAxis, color.rgb, color.a); finalColor.a = 1.0; } |