[Bf-blender-cvs] [411836d] master: Fix Cycles device backwards compatibility error if device type is unavailable.

Brecht Van Lommel noreply at git.blender.org
Wed Nov 23 00:13:18 CET 2016


Commit: 411836d97c0338a7003c64d317d66ce38c559be0
Author: Brecht Van Lommel
Date:   Wed Nov 23 00:03:06 2016 +0100
Branches: master
https://developer.blender.org/rB411836d97c0338a7003c64d317d66ce38c559be0

Fix Cycles device backwards compatibility error if device type is unavailable.

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

M	intern/cycles/blender/addon/version_update.py

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

diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py
index 136080e..b2a7455 100644
--- a/intern/cycles/blender/addon/version_update.py
+++ b/intern/cycles/blender/addon/version_update.py
@@ -176,12 +176,18 @@ def do_versions(self):
         prop = bpy.context.user_preferences.addons[__package__].preferences
         system = bpy.context.user_preferences.system
         if not prop.is_property_set("compute_device_type"):
-            if system.legacy_compute_device_type == 1:
-                prop.compute_device_type = 'OPENCL'
-            elif system.legacy_compute_device_type == 2:
-                prop.compute_device_type = 'CUDA'
-            else:
-                prop.compute_device_type = 'NONE'
+            # Device might not currently be available so this can fail
+            try:
+                if system.legacy_compute_device_type == 1:
+                    prop.compute_device_type = 'OPENCL'
+                elif system.legacy_compute_device_type == 2:
+                    prop.compute_device_type = 'CUDA'
+                else:
+                    prop.compute_device_type = 'NONE'
+            except:
+                pass
+
+            # Init device list for UI
             prop.get_devices()
 
     # We don't modify startup file because it assumes to




More information about the Bf-blender-cvs mailing list