Commit: e3e81f60a80a1ff60ee62736e6ce3fd445d6308f Author: Himanshi Kalra Date: Wed Aug 26 10:37:53 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBe3e81f60a80a1ff60ee62736e6ce3fd445d6308f
Updating test files to use MeshTest Class in ModifierTest =================================================================== M tests/python/modifiers.py M tests/python/physics_cloth.py M tests/python/physics_dynamic_paint.py M tests/python/physics_ocean.py M tests/python/physics_particle_instance.py M tests/python/physics_particle_system.py M tests/python/physics_softbody.py =================================================================== diff --git a/tests/python/modifiers.py b/tests/python/modifiers.py index c0378e5457f..4f775cb6c5d 100644 --- a/tests/python/modifiers.py +++ b/tests/python/modifiers.py @@ -26,7 +26,7 @@ from random import shuffle, seed import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import ModifierTest, ModifierSpec +from modules.mesh_test import ModifierTest, ModifierSpec, MeshTest seed(0) @@ -86,248 +86,260 @@ def main(): # List of 'Generate' modifiers on a cube ############################### # 0 - # ["testCube", "expectedCube", get_generate_modifiers_list("testCube")], - ["CubeRandom", "testCubeRandom", "expectedCubeRandom", - get_generate_modifiers_list("testCubeRandom", randomize=True)], - ["CubeMaskFirst", "testCubeMaskFirst", "expectedCubeMaskFirst", mask_first_list], - - ["CollapseDecimate", "testCollapseDecimate", "expectedCollapseDecimate", - [ModifierSpec("subdivision", 'SUBSURF', {"levels": 2}), - ModifierSpec('decimate', 'DECIMATE', - {'decimate_type': 'COLLAPSE', 'ratio': 0.25, 'use_collapse_triangulate': True})]], - ["PlanarDecimate", "testPlanarDecimate", "expectedPlanarDecimate", - [ModifierSpec("subdivision", 'SUBSURF', {"levels": 2}), - ModifierSpec('decimate', 'DECIMATE', {'decimate_type': 'DISSOLVE', 'angle_limit': math.radians(30)})]], - ["UnsubdivideDecimate", "testUnsubdivideDecimate", "expectedUnsubdivideDecimate", - [ModifierSpec("subdivision", 'SUBSURF', {"levels": 2}), - ModifierSpec('decimate', 'DECIMATE', {'decimate_type': 'UNSUBDIV', 'iterations': 2})]], + # MeshTest("testCube", "expectedCube", get_generate_modifiers_list("testCube")), + MeshTest("CubeRandom", "testCubeRandom", "expectedCubeRandom", + get_generate_modifiers_list("testCubeRandom", randomize=True)), + MeshTest("CubeMaskFirst", "testCubeMaskFirst", "expectedCubeMaskFirst", mask_first_list), + + MeshTest("CollapseDecimate", "testCollapseDecimate", "expectedCollapseDecimate", + [ModifierSpec("subdivision", 'SUBSURF', {"levels": 2}), + ModifierSpec('decimate', 'DECIMATE', + {'decimate_type': 'COLLAPSE', 'ratio': 0.25, 'use_collapse_triangulate': True})]), + MeshTest("PlanarDecimate", "testPlanarDecimate", "expectedPlanarDecimate", + [ModifierSpec("subdivision", 'SUBSURF', {"levels": 2}), + ModifierSpec('decimate', 'DECIMATE', + {'decimate_type': 'DISSOLVE', 'angle_limit': math.radians(30)})]), + MeshTest("UnsubdivideDecimate", "testUnsubdivideDecimate", "expectedUnsubdivideDecimate", + [ModifierSpec("subdivision", 'SUBSURF', {"levels": 2}), + ModifierSpec('decimate', 'DECIMATE', {'decimate_type': 'UNSUBDIV', 'iterations': 2})]), # 5 - ["RadialBisectMirror", "testRadialBisectMirror", "expectedRadialBisectMirror", - [ModifierSpec('mirror1', 'MIRROR', {'use_bisect_axis': (True, False, False)}), - ModifierSpec('mirror2', 'MIRROR', {'use_bisect_axis': (True, False, False), - 'mirror_object': bpy.data.objects["testRadialBisectMirrorHelper"]}), - ModifierSpec('mirror3', 'MIRROR', {'use_axis': (False, True, False), 'use_bisect_axis': (False, True, False), - 'use_bisect_flip_axis': (False, True, False), - 'mirror_object': bpy.data.objects["testRadialBisectMirrorHelper"]})]], - ["T58411Mirror", "regressT58411Mirror", "expectedT58411Mirror", - [ModifierSpec('mirror', 'MIRROR', {}), - ModifierSpec('bevel', 'BEVEL', {'segments': 2, 'limit_method': 'WEIGHT'}), - ModifierSpec('subd', 'SUBSURF', {'levels': 1})]], - - ["BasicScrew", "testBasicScrew", "expectedBasicScrew", - [ModifierSpec('mirror', 'MIRROR', {'mirror_object': bpy.data.objects["testBasicScrewHelper"]}), - ModifierSpec("screw", 'SCREW', {'angle': math.radians(400), 'steps': 20, 'iterations': 2, 'screw_offset': 2, - 'use_normal_calculate': True})]], - ["ObjectScrew", "testObjectScrew", "expectedObjectScrew", - [ModifierSpec('mirror', 'MIRROR', {'mirror_object': bpy.data.objects["testObjectScrewHelper2"]}), - ModifierSpec("screw", 'SCREW', - {"angle": math.radians(600), 'steps': 32, 'iterations': 1, 'use_object_screw_offset': True, - 'use_normal_calculate': True, 'object': bpy.data.objects["testObjectScrewHelper1"]})]], + MeshTest("RadialBisectMirror", "testRadialBisectMirror", "expectedRadialBisectMirror", + [ModifierSpec('mirror1', 'MIRROR', {'use_bisect_axis': (True, False, False)}), + ModifierSpec('mirror2', 'MIRROR', {'use_bisect_axis': (True, False, False), + 'mirror_object': bpy.data.objects[ + "testRadialBisectMirrorHelper"]}), + ModifierSpec('mirror3', 'MIRROR', + {'use_axis': (False, True, False), 'use_bisect_axis': (False, True, False), + 'use_bisect_flip_axis': (False, True, False), + 'mirror_object': bpy.data.objects["testRadialBisectMirrorHelper"]})]), + MeshTest("T58411Mirror", "regressT58411Mirror", "expectedT58411Mirror", + [ModifierSpec('mirror', 'MIRROR', {}), + ModifierSpec('bevel', 'BEVEL', {'segments': 2, 'limit_method': 'WEIGHT'}), + ModifierSpec('subd', 'SUBSURF', {'levels': 1})]), + + MeshTest("BasicScrew", "testBasicScrew", "expectedBasicScrew", + [ModifierSpec('mirror', 'MIRROR', {'mirror_object': bpy.data.objects["testBasicScrewHelper"]}), + ModifierSpec("screw", 'SCREW', + {'angle': math.radians(400), 'steps': 20, 'iterations': 2, 'screw_offset': 2, + 'use_normal_calculate': True})]), + MeshTest("ObjectScrew", "testObjectScrew", "expectedObjectScrew", + [ModifierSpec('mirror', 'MIRROR', {'mirror_object': bpy.data.objects["testObjectScrewHelper2"]}), + ModifierSpec("screw", 'SCREW', + {"angle": math.radians(600), 'steps': 32, 'iterations': 1, + 'use_object_screw_offset': True, + 'use_normal_calculate': True, 'object': bpy.data.objects["testObjectScrewHelper1"]})]), # 9 - ["MergedScrewWeld", "testMergedScrewWeld", "expectedMergedScrewWeld", - [ModifierSpec("screw", 'SCREW', {'angle': math.radians(360), 'steps': 12, 'iterations': 1, 'screw_offset': 1, - 'use_normal_calculate': True, 'use_merge_vertices': True}), - ModifierSpec("weld", 'WELD', {"merge_threshold": 0.001})]], - ["T72380Weld", "regressT72380Weld", "expectedT72380Weld", - [ModifierSpec('vedit', 'VERTEX_WEIGHT_EDIT', - {'vertex_group': 'Group', 'use_remove': True, 'remove_threshold': 1}), - ModifierSpec("weld", 'WELD', {"merge_threshold": 0.2, "vertex_group": "Group"})]], - ["T72792Weld", "regressT72792Weld", "expectedT72792Weld", - [ModifierSpec('array', 'ARRAY', {'fit_type': 'FIXED_COUNT', 'count': 2}), - ModifierSpec("weld", 'WELD', {"merge_threshold": 0.1, "vertex_group": "Group"})]], + MeshTest("MergedScrewWeld", "testMergedScrewWeld", "expectedMergedScrewWeld", + [ModifierSpec("screw", 'SCREW', + {'angle': math.radians(360), 'steps': 12, 'iterations': 1, 'screw_offset': 1, + 'use_normal_calculate': True, 'use_merge_vertices': True}), + ModifierSpec("weld", 'WELD', {"merge_threshold": 0.001})]), + MeshTest("T72380Weld", "regressT72380Weld", "expectedT72380Weld", + [ModifierSpec('vedit', 'VERTEX_WEIGHT_EDIT', + {'vertex_group': 'Group', 'use_remove': True, 'remove_threshold': 1}), + ModifierSpec("weld", 'WELD', {"merge_threshold": 0.2, "vertex_group": "Group"})]), + MeshTest("T72792Weld", "regressT72792Weld", "expectedT72792Weld", + [ModifierSpec('array', 'ARRAY', {'fit_type': 'FIXED_COUNT', 'count': 2}), + ModifierSpec("weld", 'WELD', {"merge_threshold": 0.1, "vertex_group": "Group"})]), ############################################ # One 'Generate' modifier on primitive meshes ############################################# # 12 - ["CubeArray", "testCubeArray", "expectedCubeArray", - [ModifierSpec('array', 'ARRAY', {})]], - ["CapArray", "testCapArray", "expectedCapArray", - [ModifierSpec('array', 'ARRAY', - {'fit_type': 'FIT_LENGTH', 'fit_length': 2.0, 'start_cap': bpy.data.objects["testCapStart"], - 'end_cap': bpy.data.objects["testCapEnd"]})]], - ["CurveArray", "testCurveArray", "expectedCurveArray", - [ModifierSpec('array', 'ARRAY', {'fit_type': 'FIT_CURVE', 'curve': bpy.data.objects["testCurveArrayHelper"], - 'use_relative_offset': False, 'use_constant_offset': True, - 'constant_offset_displace': (0.5, 0, 0)})]], - ["RadialArray", "testRadialArray", "expectedRadialArray", - [ModifierSpec('array', 'ARRAY', {'fit_type': 'FIXED_COUNT', 'count': 3, 'use_merge_vertices': True, - 'use_merge_vertices_cap': True, 'use_relative_offset': False, - 'use_object_offset': True, - 'offset_object': bpy.data.objects["testRadialArrayHelper"]})]], - - ["CylinderB @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs