[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39873] branches/cycles/intern/cycles/ blender/addon/enums.py: Cycles UI:

Thomas Dinges blender at dingto.org
Fri Sep 2 14:46:38 CEST 2011


Revision: 39873
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39873
Author:   dingto
Date:     2011-09-02 12:46:37 +0000 (Fri, 02 Sep 2011)
Log Message:
-----------
Cycles UI:
* If only CUDA or OpenCL is available, show the available one in the device button.

Modified Paths:
--------------
    branches/cycles/intern/cycles/blender/addon/enums.py

Modified: branches/cycles/intern/cycles/blender/addon/enums.py
===================================================================
--- branches/cycles/intern/cycles/blender/addon/enums.py	2011-09-02 12:33:29 UTC (rev 39872)
+++ branches/cycles/intern/cycles/blender/addon/enums.py	2011-09-02 12:46:37 UTC (rev 39873)
@@ -16,9 +16,24 @@
 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 
+from cycles import engine
+
+def get_gpu_device():
+    available_devices = engine.available_devices()
+    cuda = 'cuda' in available_devices
+    opencl = 'opencl' in available_devices
+    if cuda and opencl:
+        gpu_string = "GPU"
+    elif cuda and not opencl:
+        gpu_string = "GPU (CUDA)"
+    else:
+        gpu_string = "GPU (OpenCL)"
+    
+    return gpu_string
+
 devices = (
 ("CPU", "CPU", "Processor"),
-("GPU", "GPU", "Graphics card"))
+("GPU", get_gpu_device(), "Graphics card"))
 
 gpu_type = (
 ("CUDA", "CUDA", "NVidia only"),




More information about the Bf-blender-cvs mailing list