[Bf-blender-cvs] [963a266faf1] master: EEVEE: Fix tests crashing if file is in edit mode

Clément Foucault noreply at git.blender.org
Sat Sep 7 00:44:50 CEST 2019


Commit: 963a266faf1739ae3a89bc9f9b35050f9e0f436e
Author: Clément Foucault
Date:   Fri Sep 6 23:07:21 2019 +0200
Branches: master
https://developer.blender.org/rB963a266faf1739ae3a89bc9f9b35050f9e0f436e

EEVEE: Fix tests crashing if file is in edit mode

===================================================================

M	tests/python/eevee_render_tests.py

===================================================================

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



More information about the Bf-blender-cvs mailing list