Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/addon/version_update.py
| Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | def custom_bake_remap(scene): | ||||
| elif end == 'COLOR': | elif end == 'COLOR': | ||||
| scene.render.bake.use_pass_direct = False | scene.render.bake.use_pass_direct = False | ||||
| scene.render.bake.use_pass_indirect = False | scene.render.bake.use_pass_indirect = False | ||||
| @persistent | @persistent | ||||
| def do_versions(self): | def do_versions(self): | ||||
| if bpy.context.user_preferences.version <= (2, 78, 1): | if bpy.context.user_preferences.version <= (2, 78, 1): | ||||
| prop = bpy.context.user_preferences.addons[__package__].preferences | prefs = bpy.context.user_preferences.addons[__package__].preferences | ||||
| system = bpy.context.user_preferences.system | system = bpy.context.user_preferences.system | ||||
| if not prop.is_property_set("compute_device_type"): | if not prefs.is_property_set("compute_device_type"): | ||||
| # Device might not currently be available so this can fail | # Device might not currently be available so this can fail | ||||
| try: | try: | ||||
| if system.legacy_compute_device_type == 1: | if system.legacy_compute_device_type == 1: | ||||
| prop.compute_device_type = 'OPENCL' | prefs['compute_device_type'] = 2 | ||||
| elif system.legacy_compute_device_type == 2: | elif system.legacy_compute_device_type == 2: | ||||
| prop.compute_device_type = 'CUDA' | prefs['compute_device_type'] = 1 | ||||
| else: | else: | ||||
| prop.compute_device_type = 'NONE' | prefs['compute_device_type'] = 0 | ||||
| except: | except: | ||||
| pass | pass | ||||
| if bpy.context.user_preferences.version <= (2, 79, 1): | |||||
| # Convert to unified list of GPU devices | |||||
| prefs = bpy.context.user_preferences.addons[__package__].preferences | |||||
| if prefs['compute_device_type'] != 0: | |||||
| if prefs['compute_device_type'] == 2: | |||||
| single_type = 'OPENCL' | |||||
| else: | |||||
| single_type = 'CUDA' | |||||
| for device in prefs.devices: | |||||
| if device.type != single_type: | |||||
| device.use = False | |||||
| prefs.compute_device_type = 'GPU' | |||||
| # Init device list for UI | # Init device list for UI | ||||
| prop.get_devices() | prefs.get_devices() | ||||
| # We don't modify startup file because it assumes to | # We don't modify startup file because it assumes to | ||||
| # have all the default values only. | # have all the default values only. | ||||
| if not bpy.data.is_saved: | if not bpy.data.is_saved: | ||||
| return | return | ||||
| # Clamp Direct/Indirect separation in 270 | # Clamp Direct/Indirect separation in 270 | ||||
| if bpy.data.version <= (2, 70, 0): | if bpy.data.version <= (2, 70, 0): | ||||
| ▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines | |||||