Fix T64827 (part two): "Batch-Generate Previews" fails with certain files
authorPhilipp Oeser <info@graphics-engineer.com>
Mon, 15 Jul 2019 09:53:57 +0000 (11:53 +0200)
committerPhilipp Oeser <info@graphics-engineer.com>
Mon, 15 Jul 2019 14:38:59 +0000 (16:38 +0200)
Some values (not properly handled by do_versions?) could cause
'rna_backup_restore()' to throw an error resulting in the whole preview
generation not being saved to the .blend file.

I've checked folowwing demo files:
- race_spaceship.blend
- wasp_bot.blend

Here the offending seetings were:
- `UnitSettings` (`length_unit`, ...)
- `FFmpegSettings` (`ffmpeg_preset`, ...)

For now, these are now excluded in `exclude_props`

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5255

release/scripts/modules/bl_previews_utils/bl_previews_render.py

index 8d1a782bc545288215138e9aad7d370c2df63c9b..124b8de8eaf40d75d369c049f32a15d113746efc 100644 (file)
@@ -83,7 +83,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern):
         if engine == '__SCENE':
             backup_scene, backup_world, backup_camera, backup_light, backup_camera_data, backup_light_data = [()] * 6
             scene = bpy.context.window.scene
-            exclude_props = {('world',), ('camera',), ('tool_settings',), ('preview',)}
+            exclude_props = {('world',), ('camera',), ('tool_settings',), ('preview',), ('render','ffmpeg'), ('unit_settings',)}
             backup_scene = tuple(rna_backup_gen(scene, exclude_props=exclude_props))
             world = scene.world
             camera = scene.camera