Commit: 88f1c283a773bb76334d2d6a849d4e45c5c95373
Author: Brecht Van Lommel
Date:   Mon Feb 24 19:05:07 2014 +0100
https://developer.blender.org/rB88f1c283a773bb76334d2d6a849d4e45c5c95373

Tweak to T38766 fix: cycles now support setting viewport alpha for a material.

===================================================================

M       intern/cycles/blender/addon/ui.py
M       source/blender/gpu/intern/gpu_draw.c

===================================================================

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index cb50db2..a313826 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1001,8 +1001,9 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, 
Panel):
 
         split = layout.split()
 
-        col = split.column()
+        col = split.column(align=True)
         col.prop(mat, "diffuse_color", text="Viewport Color")
+        col.prop(mat, "alpha")
 
         col = split.column(align=True)
         col.label()
diff --git a/source/blender/gpu/intern/gpu_draw.c 
b/source/blender/gpu/intern/gpu_draw.c
index 164d0c0..40ee745 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1423,7 +1423,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D 
*rv3d, Scene *scene, O
         * and only transparent in the second 'alpha' pass.
         * - object transparency off: for glsl we draw both in a single pass, 
and
         * for solid we don't use transparency at all. */
-       GMS.use_alpha_pass = (do_alpha_after != NULL) && !new_shading_nodes;
+       GMS.use_alpha_pass = (do_alpha_after != NULL);
        GMS.is_alpha_pass = (v3d->transp != FALSE);
        if (GMS.use_alpha_pass)
                *do_alpha_after = false;
@@ -1485,7 +1485,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D 
*rv3d, Scene *scene, O
                                /* fixed function opengl materials */
                                gpu_material_to_fixed(&GMS.matbuf[a], ma, 
gamma, ob, new_shading_nodes);
 
-                               if (GMS.use_alpha_pass && (ma->mode & 
MA_TRANSP)) {
+                               if (GMS.use_alpha_pass && ((ma->mode & 
MA_TRANSP) || (new_shading_nodes && ma->alpha != 1.0f))) {
                                        GMS.matbuf[a].diff[3]= ma->alpha;
                                        alphablend = (ma->alpha == 1.0f)? 
GPU_BLEND_SOLID: GPU_BLEND_ALPHA;
                                }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to