Fix Cycles device backwards compatibility error if device type is unavailable.
This commit is contained in:
parent
57141ea30e
commit
411836d97c
Notes:
blender-bot
2023-11-20 12:14:32 +01:00
Referenced by issue #50616, Blender / Cycles / Material list Crash - When dealing with image sequences longer than 63 images long on Windows Referenced by issue #50108, INCOMPATIBILITY with keyboard on screen (virtual keyboard) Referenced by issue #50097, Blender Crashes when zooming in the node editor Referenced by issue #50099, Blender crashes during render Referenced by issue #50106, The object is shown even though outside of distance culling area. Referenced by issue #50001, Time required for rendering in cycle increased in the latest build.
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue