Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/addon/version_update.py
| Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | if bpy.context.preferences.version <= (2, 78, 1): | ||||
| else: | else: | ||||
| prop.compute_device_type = 'NONE' | prop.compute_device_type = 'NONE' | ||||
| except: | except: | ||||
| pass | pass | ||||
| # Init device list for UI | # Init device list for UI | ||||
| prop.get_devices(prop.compute_device_type) | prop.get_devices(prop.compute_device_type) | ||||
| # We don't modify startup file because it assumes to | |||||
| # have all the default values only. | |||||
| if not bpy.data.is_saved: | |||||
| return | |||||
| # Map of versions used by libraries. | # Map of versions used by libraries. | ||||
| library_versions = {} | library_versions = {} | ||||
| library_versions[bpy.data.version] = [None] | library_versions[bpy.data.version] = [None] | ||||
| for library in bpy.data.libraries: | for library in bpy.data.libraries: | ||||
| library_versions.setdefault(library.version, []).append(library) | library_versions.setdefault(library.version, []).append(library) | ||||
| # Do versioning per library, since they might have different versions. | # Do versioning per library, since they might have different versions. | ||||
| max_need_versioning = (2, 80, 41) | max_need_versioning = (2, 80, 58) | ||||
| for version, libraries in library_versions.items(): | for version, libraries in library_versions.items(): | ||||
| if version > max_need_versioning: | if version > max_need_versioning: | ||||
| continue | continue | ||||
| # Scenes | # Scenes | ||||
| for scene in bpy.data.scenes: | for scene in bpy.data.scenes: | ||||
| if scene.library not in libraries: | if scene.library not in libraries: | ||||
| continue | continue | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | for version, libraries in library_versions.items(): | ||||
| cscene.aa_samples = 4 | cscene.aa_samples = 4 | ||||
| if not cscene.is_property_set("preview_aa_samples"): | if not cscene.is_property_set("preview_aa_samples"): | ||||
| cscene.preview_aa_samples = 4 | cscene.preview_aa_samples = 4 | ||||
| if not cscene.is_property_set("blur_glossy"): | if not cscene.is_property_set("blur_glossy"): | ||||
| cscene.blur_glossy = 0.0 | cscene.blur_glossy = 0.0 | ||||
| if not cscene.is_property_set("sample_clamp_indirect"): | if not cscene.is_property_set("sample_clamp_indirect"): | ||||
| cscene.sample_clamp_indirect = 0.0 | cscene.sample_clamp_indirect = 0.0 | ||||
| # Lamps | # Lights | ||||
| for light in bpy.data.lights: | for light in bpy.data.lights: | ||||
| if light.library not in libraries: | if light.library not in libraries: | ||||
| continue | continue | ||||
| if version <= (2, 76, 5): | if version <= (2, 76, 5): | ||||
| clight = light.cycles | clight = light.cycles | ||||
| # MIS | # MIS | ||||
| ▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines | |||||