From 411836d97c0338a7003c64d317d66ce38c559be0 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 23 Nov 2016 00:03:06 +0100 Subject: Fix Cycles device backwards compatibility error if device type is unavailable. --- intern/cycles/blender/addon/version_update.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'intern') diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index 136080efadc..b2a745500a1 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 -- cgit v1.2.3