[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [62191] trunk/lib/tests/modeling: Update bevel regression tests for 2.8 and new features.
Howard Trickey
howard.trickey at gmail.com
Mon Feb 11 13:23:29 CET 2019
Revision: 62191
https://developer.blender.org/rBL62191
Author: howardt
Date: 2019-02-11 13:23:29 +0100 (Mon, 11 Feb 2019)
Log Message:
-----------
Update bevel regression tests for 2.8 and new features.
Modified Paths:
--------------
trunk/lib/tests/modeling/bevel_regression.blend
trunk/lib/tests/modeling/mesh_ops_test.py
Modified: trunk/lib/tests/modeling/bevel_regression.blend
===================================================================
(Binary files differ)
Modified: trunk/lib/tests/modeling/mesh_ops_test.py
===================================================================
--- trunk/lib/tests/modeling/mesh_ops_test.py 2019-02-06 14:24:00 UTC (rev 62190)
+++ trunk/lib/tests/modeling/mesh_ops_test.py 2019-02-11 12:23:29 UTC (rev 62191)
@@ -208,7 +208,6 @@
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]
@@ -218,12 +217,8 @@
return False
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='DESELECT')
- 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.context.view_layer.objects.active = otest
+ otest.select_set(True)
bpy.ops.object.duplicate()
otestdup = bpy.context.active_object
smode = DoMeshSelect(t.select, verbose=verbose)
@@ -254,7 +249,7 @@
return True
mtest = otestdup.data
mexpected = oexpected.data
- cmpret = mtest.unit_test_compare(mexpected)
+ cmpret = mtest.unit_test_compare(mesh=mexpected)
success = (cmpret == 'Same')
if success:
if verbose:
@@ -264,29 +259,26 @@
print('Fail', cmpret)
if cleanup:
bpy.ops.object.delete()
- if is28:
- otest.select_set(action='SELECT')
- bpy.context.view_layer.objects.active = otest
- else:
- otest.select = True
- bpy.context.scene.objects.active = otest
+ otest.select_set(state=True, view_layer=None)
+ bpy.context.view_layer.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'
+ oexpected.name = oexpected.name + '_pendingdelete'
otestdup.location = oexpected.location
- otestdup.layers = oexpected.layers
- bpy.context.scene.layers = oexpected.layers
- bpy.context.scene.objects.active = oexpected
+ expected_collections = oexpected.users_collection
+ testdup_collections = otestdup.users_collection
+ # should be exactly 1 collection each for otestdup and oexpected
+ tcoll = testdup_collections[0]
+ ecoll = expected_collections[0]
+ ecoll.objects.link(otestdup)
+ tcoll.objects.unlink(otestdup)
+ bpy.context.view_layer.objects.active = oexpected
bpy.ops.object.select_all(action='DESELECT')
- oexpected.select = True
+ oexpected.select_set(state=True, view_layer=None)
bpy.ops.object.delete()
otestdup.name = t.expected_obj
- bpy.context.scene.objects.active = otest
- bpy.context.scene.layers = otest.layers
+ bpy.context.view_layer.objects.active = otest
return success
More information about the Bf-blender-cvs
mailing list