[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [62069] trunk/lib/tests/modeling/mesh_ops_test.py: Update mesh_ops_test.py, used in regression testing, for 2.8
Howard Trickey
howard.trickey at gmail.com
Fri May 25 13:57:27 CEST 2018
Revision: 62069
https://developer.blender.org/rBL62069
Author: howardt
Date: 2018-05-25 13:57:26 +0200 (Fri, 25 May 2018)
Log Message:
-----------
Update mesh_ops_test.py, used in regression testing, for 2.8
Made it work with both 2.79 and 2.8.
Modified Paths:
--------------
trunk/lib/tests/modeling/mesh_ops_test.py
Modified: trunk/lib/tests/modeling/mesh_ops_test.py
===================================================================
--- trunk/lib/tests/modeling/mesh_ops_test.py 2018-05-18 14:51:05 UTC (rev 62068)
+++ trunk/lib/tests/modeling/mesh_ops_test.py 2018-05-25 11:57:26 UTC (rev 62069)
@@ -208,6 +208,7 @@
if verbose:
print("Run test:", t)
+ is28 = bpy.app.version[1] >= 80
objs = bpy.data.objects
if t.test_obj in objs:
otest = objs[t.test_obj]
@@ -217,8 +218,12 @@
return False
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='DESELECT')
- bpy.context.scene.objects.active = otest
- otest.select = True
+ if is28:
+ bpy.context.view_layer.objects.active = otest
+ otest.select_set(action='SELECT')
+ else:
+ bpy.context.scene.objects.active = otest
+ otest.select = True
bpy.ops.object.duplicate()
otestdup = bpy.context.active_object
smode = DoMeshSelect(t.select, verbose=verbose)
@@ -259,11 +264,18 @@
print('Fail', cmpret)
if cleanup:
bpy.ops.object.delete()
- otest.select = True
- bpy.context.scene.objects.active = otest
+ if is28:
+ otest.select_set(action='SELECT')
+ bpy.context.view_layer.objects.active = otest
+ else:
+ otest.select = True
+ bpy.context.scene.objects.active = otest
elif update_expected:
if verbose:
print('Updating expected object', t.expected_obj)
+ if is28:
+ print('Update does not yet work for 2.8')
+ return success
# oexpected.name = oexpected.name + '_pendingdelete'
otestdup.location = oexpected.location
otestdup.layers = oexpected.layers
More information about the Bf-blender-cvs
mailing list