Commit: 8ed818e0a1b4e6355413607bda3a01970294f91d
Author: Thomas Dinges
Date:   Sun Aug 24 14:54:48 2014 +0200
Branches: master
https://developer.blender.org/rB8ed818e0a1b4e6355413607bda3a01970294f91d

Cycles: Remove Volume Nodes GPU warning and gray out Sampling Method button 
when using GPU.

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

M       intern/cycles/blender/addon/ui.py
M       source/blender/editors/space_node/drawnode.c

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

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index 057b592..6f9e95d 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -929,7 +929,9 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
 
         col = split.column()
         col.label(text="Volume:")
-        col.prop(cworld, "volume_sampling", text="")
+        sub = col.column()
+        sub.active = use_cpu(context)
+        sub.prop(cworld, "volume_sampling", text="")
         col.prop(cworld, "homogeneous_volume", text="Homogeneous")
 
 
@@ -1031,7 +1033,9 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, 
Panel):
 
         col = split.column()
         col.label(text="Volume:")
-        col.prop(cmat, "volume_sampling", text="")
+        sub = col.column()
+        sub.active = use_cpu(context)
+        sub.prop(cmat, "volume_sampling", text="")
         col.prop(cmat, "homogeneous_volume", text="Homogeneous")
 
 
diff --git a/source/blender/editors/space_node/drawnode.c 
b/source/blender/editors/space_node/drawnode.c
index 7c2b8f8..89cbbb5 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -954,18 +954,6 @@ static void node_shader_buts_subsurface(uiLayout *layout, 
bContext *C, PointerRN
 }
 
 
-static void node_shader_buts_volume(uiLayout *layout, bContext *C, PointerRNA 
*UNUSED(ptr))
-{
-       /* Volume does not work on GPU yet */
-       PointerRNA scene = CTX_data_pointer_get(C, "scene");
-       if (scene.data) {
-               PointerRNA cscene = RNA_pointer_get(&scene, "cycles");
-
-               if (cscene.data && (RNA_enum_get(&cscene, "device") == 1 && 
U.compute_device_type != 0))
-                       uiItemL(layout, IFACE_("Volumes not supported on GPU"), 
ICON_ERROR);
-       }
-}
-
 static void node_shader_buts_toon(uiLayout *layout, bContext *UNUSED(C), 
PointerRNA *ptr)
 {
        uiItemR(layout, ptr, "component", 0, "", ICON_NONE);
@@ -1122,12 +1110,6 @@ static void node_shader_set_butfunc(bNodeType *ntype)
                case SH_NODE_SUBSURFACE_SCATTERING:
                        ntype->draw_buttons = node_shader_buts_subsurface;
                        break;
-               case SH_NODE_VOLUME_SCATTER:
-                       ntype->draw_buttons = node_shader_buts_volume;
-                       break;
-               case SH_NODE_VOLUME_ABSORPTION:
-                       ntype->draw_buttons = node_shader_buts_volume;
-                       break;
                case SH_NODE_BSDF_TOON:
                        ntype->draw_buttons = node_shader_buts_toon;
                        break;

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

Reply via email to