diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-09-07 00:07:21 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-09-07 01:44:20 +0300 |
commit | 963a266faf1739ae3a89bc9f9b35050f9e0f436e (patch) | |
tree | 18dc2d357f1df0b9001d216a9f7a1a61fab47bfd | |
parent | 44aaee573adbd3dd7dc247d7c4dc0ea4011b8d0b (diff) |
EEVEE: Fix tests crashing if file is in edit mode
-rwxr-xr-x | tests/python/eevee_render_tests.py | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/tests/python/eevee_render_tests.py b/tests/python/eevee_render_tests.py index 6719971837a..a7130136d0a 100755 --- a/tests/python/eevee_render_tests.py +++ b/tests/python/eevee_render_tests.py @@ -35,19 +35,25 @@ def setup(): # mat.use_screen_refraction = True mat.use_sss_translucency = True - # Simple probe setup - bpy.ops.object.lightprobe_add(type='CUBEMAP', location=(0.5, 0, 1.5)) - cubemap = bpy.context.selected_objects[0] - cubemap.scale = (2.5,2.5,1.0) - cubemap.data.falloff = 0 - cubemap.data.clip_start = 2.4 - - bpy.ops.object.lightprobe_add(type='GRID', location=(0, 0, 0.25)) - grid = bpy.context.selected_objects[0] - grid.scale = (1.735,1.735,1.735) - grid.data.grid_resolution_x = 3 - grid.data.grid_resolution_y = 3 - grid.data.grid_resolution_z = 2 + cubemap = None + grid = None + # Does not work in edit mode + try: + # Simple probe setup + bpy.ops.object.lightprobe_add(type='CUBEMAP', location=(0.5, 0, 1.5)) + cubemap = bpy.context.selected_objects[0] + cubemap.scale = (2.5,2.5,1.0) + cubemap.data.falloff = 0 + cubemap.data.clip_start = 2.4 + + bpy.ops.object.lightprobe_add(type='GRID', location=(0, 0, 0.25)) + grid = bpy.context.selected_objects[0] + grid.scale = (1.735,1.735,1.735) + grid.data.grid_resolution_x = 3 + grid.data.grid_resolution_y = 3 + grid.data.grid_resolution_z = 2 + except: + pass try: # Try to only include the plane in reflections |