def main(): tests = [ MeshTest('Cubecube_intersect_union', 'Cubecube', 'Cubecube_result_1', [OperatorSpecEditMode('intersect_boolean', {'operation': 'UNION', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), MeshTest('Cubecube_intersect_intersect', 'Cubecube', 'Cubecube_result_2', [OperatorSpecEditMode('intersect_boolean', {'operation': 'INTERSECT', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), MeshTest('Cubecube_intersect_difference', 'Cubecube', 'Cubecube_result_3', [OperatorSpecEditMode('intersect_boolean', {'operation': 'DIFFERENCE', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), MeshTest('Cubecube_intersect_cut', 'Cubecube', 'Cubecube_result_4', [OperatorSpecEditMode('intersect', {'separate_mode': 'CUT', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), MeshTest('Cubecube_intersect_all', 'Cubecube', 'Cubecube_result_5', [OperatorSpecEditMode('intersect', {'separate_mode': 'ALL', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), MeshTest('Cubecube_intersect_none', 'Cubecube', 'Cubecube_result_6', [OperatorSpecEditMode('intersect', {'separate_mode': 'NONE', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), MeshTest('Cubecube_intersect_select_none', 'Cubecube', 'Cubecube_result_7', [OperatorSpecEditMode('intersect', {'mode': 'SELECT', 'separate_mode': 'NONE', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, )]), MeshTest('Cubecone_intersect_union', 'Cubecone', 'Cubecone_result_1', [OperatorSpecEditMode('intersect_boolean', {'operation': 'UNION', 'solver': 'FAST'}, 'FACE', {6, 7, 8, 9, 10}, )]), MeshTest('Cubecones_intersect_union', 'Cubecones', 'Cubecones_result_1', [OperatorSpecEditMode('intersect_boolean', {'operation': 'UNION', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), ] operator_test = RunTest(tests) command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": operator_test.do_compare = True operator_test.run_all_tests() break elif cmd == "--run-test": name = command[i + 1] operator_test.do_compare = False operator_test.run_test(name) break
def main(): tests = [ # bisect SpecMeshTest("CubeBisect", "testCubeBisect", "expectedCubeBisect", [OperatorSpecEditMode("bisect", {"plane_co": (0, 0, 0), "plane_no": (0, 1, 1), "clear_inner": True, "use_fill": True}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), # blend from shape SpecMeshTest("CubeBlendFromShape", "testCubeBlendFromShape", "expectedCubeBlendFromShape", [OperatorSpecEditMode("blend_from_shape", {"shape": "Key 1"}, 'FACE', {0, 1, 2, 3, 4, 5})]), # bridge edge loops SpecMeshTest("CubeBridgeEdgeLoop", "testCubeBrigeEdgeLoop", "expectedCubeBridgeEdgeLoop", [OperatorSpecEditMode("bridge_edge_loops", {}, "FACE", {0, 1})]), # decimate SpecMeshTest("MonkeyDecimate", "testMonkeyDecimate", "expectedMonkeyDecimate", [OperatorSpecEditMode("decimate", {"ratio": 0.1}, "FACE", {i for i in range(500)})]), # delete SpecMeshTest("CubeDeleteVertices", "testCubeDeleteVertices", "expectedCubeDeleteVertices", [OperatorSpecEditMode("delete", {}, "VERT", {3})]), SpecMeshTest("CubeDeleteFaces", "testCubeDeleteFaces", "expectedCubeDeleteFaces", [OperatorSpecEditMode("delete", {}, "FACE", {0})]), SpecMeshTest("CubeDeleteEdges", "testCubeDeleteEdges", "expectedCubeDeleteEdges", [OperatorSpecEditMode("delete", {}, "EDGE", {0, 1, 2, 3})]), # delete edge loop SpecMeshTest("MonkeyDeleteEdgeLoopVertices", "testMokneyDeleteEdgeLoopVertices", "expectedMonkeyDeleteEdgeLoopVertices", [OperatorSpecEditMode("delete_edgeloop", {}, "VERT", MONKEY_LOOP_VERT)]), SpecMeshTest("MonkeyDeleteEdgeLoopEdges", "testMokneyDeleteEdgeLoopEdges", "expectedMonkeyDeleteEdgeLoopEdges", [OperatorSpecEditMode("delete_edgeloop", {}, "EDGE", MONKEY_LOOP_EDGE)]), # delete loose SpecMeshTest("CubeDeleteLooseVertices", "testCubeDeleteLooseVertices", "expectedCubeDeleteLooseVertices", [OperatorSpecEditMode("delete_loose", {"use_verts": True, "use_edges": False, "use_faces": False}, "VERT", {i for i in range(12)})]), SpecMeshTest("CubeDeleteLooseEdges", "testCubeDeleteLooseEdges", "expectedCubeDeleteLooseEdges", [OperatorSpecEditMode("delete_loose", {"use_verts": False, "use_edges": True, "use_faces": False}, "EDGE", {i for i in range(14)})]), SpecMeshTest("CubeDeleteLooseFaces", "testCubeDeleteLooseFaces", "expectedCubeDeleteLooseFaces", [OperatorSpecEditMode("delete_loose", {"use_verts": False, "use_edges": False, "use_faces": True}, "FACE", {i for i in range(7)})]), # dissolve degenerate SpecMeshTest("CubeDissolveDegenerate", "testCubeDissolveDegenerate", "expectedCubeDissolveDegenerate", [OperatorSpecEditMode("dissolve_degenerate", {}, "VERT", {i for i in range(8)})]), # dissolve edges SpecMeshTest("CylinderDissolveEdges", "testCylinderDissolveEdges", "expectedCylinderDissolveEdges", [OperatorSpecEditMode("dissolve_edges", {}, "EDGE", {0, 5, 6, 9})]), # dissolve faces SpecMeshTest("CubeDissolveFaces", "testCubeDissolveFaces", "expectedCubeDissolveFaces", [OperatorSpecEditMode("dissolve_faces", {}, "VERT", {5, 34, 47, 49, 83, 91, 95})]), # dissolve verts SpecMeshTest("CubeDissolveVerts", "testCubeDissolveVerts", "expectedCubeDissolveVerts", [OperatorSpecEditMode("dissolve_verts", {}, "VERT", {16, 20, 22, 23, 25})]), # duplicate SpecMeshTest("ConeDuplicateVertices", "testConeDuplicateVertices", "expectedConeDuplicateVertices", [OperatorSpecEditMode("duplicate", {}, "VERT", {i for i in range(33)} - {23})]), SpecMeshTest("ConeDuplicateOneVertex", "testConeDuplicateOneVertex", "expectedConeDuplicateOneVertex", [OperatorSpecEditMode("duplicate", {}, "VERT", {23})]), SpecMeshTest("ConeDuplicateFaces", "testConeDuplicateFaces", "expectedConeDuplicateFaces", [OperatorSpecEditMode("duplicate", {}, "FACE", {6, 9})]), SpecMeshTest("ConeDuplicateEdges", "testConeDuplicateEdges", "expectedConeDuplicateEdges", [OperatorSpecEditMode("duplicate", {}, "EDGE", {i for i in range(64)})]), # edge collapse SpecMeshTest("CylinderEdgeCollapse", "testCylinderEdgeCollapse", "expectedCylinderEdgeCollapse", [OperatorSpecEditMode("edge_collapse", {}, "EDGE", {1, 9, 4})]), # edge face add SpecMeshTest("CubeEdgeFaceAddFace", "testCubeEdgeFaceAddFace", "expectedCubeEdgeFaceAddFace", [OperatorSpecEditMode("edge_face_add", {}, "VERT", {1, 3, 4, 5, 7})]), SpecMeshTest("CubeEdgeFaceAddEdge", "testCubeEdgeFaceAddEdge", "expectedCubeEdgeFaceAddEdge", [OperatorSpecEditMode("edge_face_add", {}, "VERT", {4, 5})]), # edge rotate SpecMeshTest("CubeEdgeRotate", "testCubeEdgeRotate", "expectedCubeEdgeRotate", [OperatorSpecEditMode("edge_rotate", {}, "EDGE", {1})]), # edge split SpecMeshTest("CubeEdgeSplit", "testCubeEdgeSplit", "expectedCubeEdgeSplit", [OperatorSpecEditMode("edge_split", {}, "EDGE", {2, 5, 8, 11, 14, 17, 20, 23})]), # edge ring select - Cannot be tested. Need user input. # SpecMeshTest("CubeEdgeRingSelect", "testCubeEdgeRingSelect", "expectedCubeEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "EDGE", {5, 20, 25, 26})]), # SpecMeshTest("EmptyMeshEdgeRingSelect", "testGridEdgeRingSelect", "expectedGridEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "VERT", {65, 66, 67})]), # SpecMeshTest("EmptyMeshEdgeRingSelect", "testEmptyMeshdgeRingSelect", "expectedEmptyMeshEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "VERT", {})]), # edges select sharp SpecMeshTest("CubeEdgesSelectSharp", "testCubeEdgeSelectSharp", "expectedCubeEdgeSelectSharp", [OperatorSpecEditMode("edges_select_sharp", {}, "EDGE", {20})]), SpecMeshTest("SphereEdgesSelectSharp", "testSphereEdgesSelectSharp", "expectedSphereEdgeSelectSharp", [OperatorSpecEditMode("edges_select_sharp", {"sharpness": 0.25}, "EDGE", {288})]), SpecMeshTest("HoledSphereEdgesSelectSharp", "testHoledSphereEdgesSelectSharp", "expectedHoledSphereEdgeSelectSharp", [OperatorSpecEditMode("edges_select_sharp", {"sharpness": 0.18}, "VERT", {})]), SpecMeshTest("EmptyMeshEdgesSelectSharp", "testEmptyMeshEdgeSelectSharp", "expectedEmptyMeshEdgeSelectSharp", [OperatorSpecEditMode("edges_select_sharp", {}, "VERT", {})]), # face make planar SpecMeshTest("MonkeyFaceMakePlanar", "testMonkeyFaceMakePlanar", "expectedMonkeyFaceMakePlanar", [OperatorSpecEditMode("face_make_planar", {}, "FACE", {i for i in range(500)})]), # face split by edges SpecMeshTest("PlaneFaceSplitByEdges", "testPlaneFaceSplitByEdges", "expectedPlaneFaceSplitByEdges", [OperatorSpecEditMode("face_split_by_edges", {}, "VERT", {i for i in range(6)})]), # faces select linked flat SpecMeshTest("CubeFacesSelectLinkedFlat", "testCubeFaceSelectLinkedFlat", "expectedCubeFaceSelectLinkedFlat", [OperatorSpecEditMode("faces_select_linked_flat", {}, "FACE", {7})]), SpecMeshTest("PlaneFacesSelectLinkedFlat", "testPlaneFaceSelectLinkedFlat", "expectedPlaneFaceSelectLinkedFlat", [OperatorSpecEditMode("faces_select_linked_flat", {}, "VERT", {1})]), SpecMeshTest("EmptyMeshFacesSelectLinkedFlat", "testEmptyMeshFaceSelectLinkedFlat", "expectedEmptyMeshFaceSelectLinkedFlat", [OperatorSpecEditMode("faces_select_linked_flat", {}, "VERT", {})]), # fill SpecMeshTest("IcosphereFill", "testIcosphereFill", "expectedIcosphereFill", [OperatorSpecEditMode("fill", {}, "EDGE", {20, 21, 22, 23, 24, 45, 46, 47, 48, 49})]), SpecMeshTest("IcosphereFillUseBeautyFalse", "testIcosphereFillUseBeautyFalse", "expectedIcosphereFillUseBeautyFalse", [OperatorSpecEditMode("fill", {"use_beauty": False}, "EDGE", {20, 21, 22, 23, 24, 45, 46, 47, 48, 49})]), # fill grid SpecMeshTest("PlaneFillGrid", "testPlaneFillGrid", "expectedPlaneFillGrid", [OperatorSpecEditMode("fill_grid", {}, "EDGE", {1, 2, 3, 4, 5, 7, 9, 10, 11, 12, 13, 15})]), SpecMeshTest("PlaneFillGridSimpleBlending", "testPlaneFillGridSimpleBlending", "expectedPlaneFillGridSimpleBlending", [OperatorSpecEditMode("fill_grid", {"use_interp_simple": True}, "EDGE", {1, 2, 3, 4, 5, 7, 9, 10, 11, 12, 13, 15})]), # fill holes SpecMeshTest("SphereFillHoles", "testSphereFillHoles", "expectedSphereFillHoles", [OperatorSpecEditMode("fill_holes", {"sides": 9}, "VERT", {i for i in range(481)})]), # face shade smooth (not a real test) SpecMeshTest("CubeShadeSmooth", "testCubeShadeSmooth", "expectedCubeShadeSmooth", [OperatorSpecEditMode("faces_shade_smooth", {}, "VERT", {i for i in range(8)})]), # faces shade flat (not a real test) SpecMeshTest("CubeShadeFlat", "testCubeShadeFlat", "expectedCubeShadeFlat", [OperatorSpecEditMode("faces_shade_flat", {}, "FACE", {i for i in range(6)})]), # hide SpecMeshTest("HideFace", "testCubeHideFace", "expectedCubeHideFace", [OperatorSpecEditMode("hide", {}, "FACE", {3})]), SpecMeshTest("HideEdge", "testCubeHideEdge", "expectedCubeHideEdge", [OperatorSpecEditMode("hide", {}, "EDGE", {1})]), SpecMeshTest("HideVertex", "testCubeHideVertex", "expectedCubeHideVertex", [OperatorSpecEditMode("hide", {}, "VERT", {0})]), # inset faces SpecMeshTest("CubeInset", "testCubeInset", "expectedCubeInset", [OperatorSpecEditMode("inset", {"thickness": 0.2}, "VERT", {5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95})]), SpecMeshTest("CubeInsetEvenOffsetFalse", "testCubeInsetEvenOffsetFalse", "expectedCubeInsetEvenOffsetFalse", [OperatorSpecEditMode("inset", {"thickness": 0.2, "use_even_offset": False}, "VERT", {5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95})]), SpecMeshTest("CubeInsetDepth", "testCubeInsetDepth", "expectedCubeInsetDepth", [OperatorSpecEditMode("inset", {"thickness": 0.2, "depth": 0.2}, "VERT", {5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95})]), SpecMeshTest("GridInsetRelativeOffset", "testGridInsetRelativeOffset", "expectedGridInsetRelativeOffset", [OperatorSpecEditMode("inset", {"thickness": 0.4, "use_relative_offset": True}, "FACE", {35, 36, 37, 45, 46, 47, 55, 56, 57})]), # loop multi select SpecMeshTest("MokeyLoopMultiSelect", "testMonkeyLoopMultiSelect", "expectedMonkeyLoopMultiSelect", [OperatorSpecEditMode("loop_multi_select", {}, "VERT", {355, 359, 73, 301, 302})]), SpecMeshTest("HoledGridLoopMultiSelect", "testGridLoopMultiSelect", "expectedGridLoopMultiSelect", [OperatorSpecEditMode("loop_multi_select", {}, "VERT", {257, 169, 202, 207, 274, 278, 63})]), SpecMeshTest("EmptyMeshLoopMultiSelect", "testEmptyMeshLoopMultiSelect", "expectedEmptyMeshLoopMultiSelect", [OperatorSpecEditMode("loop_multi_select", {}, "VERT", {})]), # mark seam SpecMeshTest("CubeMarkSeam", "testCubeMarkSeam", "expectedCubeMarkSeam", [OperatorSpecEditMode("mark_seam", {}, "EDGE", {1})]), # select all SpecMeshTest("CircleSelectAll", "testCircleSelectAll", "expectedCircleSelectAll", [OperatorSpecEditMode("select_all", {}, "VERT", {1})]), SpecMeshTest("IsolatedVertsSelectAll", "testIsolatedVertsSelectAll", "expectedIsolatedVertsSelectAll", [OperatorSpecEditMode("select_all", {}, "VERT", {})]), SpecMeshTest("EmptyMeshSelectAll", "testEmptyMeshSelectAll", "expectedEmptyMeshSelectAll", [OperatorSpecEditMode("select_all", {}, "VERT", {})]), # select axis - Cannot be tested. Needs active vert selection # SpecMeshTest("MonkeySelectAxisX", "testMonkeySelectAxisX", "expectedMonkeySelectAxisX", # [OperatorSpecEditMode("select_axis", {"axis": "X"}, "VERT", {13})]), # SpecMeshTest("MonkeySelectAxisY", "testMonkeySelectAxisY", "expectedMonkeySelectAxisY", # [OperatorSpecEditMode("select_axis", {"axis": "Y", "sign": "NEG"}, "FACE", {317})]), # SpecMeshTest("MonkeySelectAxisXYZ", "testMonkeySelectAxisXYZ", "expectedMonkeySelectAxisXYZ", # [OperatorSpecEditMode("select_axis", {"axis": "X", "sign": "NEG"}, "FACE", {317}), # OperatorSpecEditMode("select_axis", {"axis": "Y", "sign": "POS"}, "FACE", {}), # OperatorSpecEditMode("select_axis", {"axis": "Z", "sign": "NEG"}, "FACE", {})]), # select faces by sides SpecMeshTest("CubeSelectFacesBySide", "testCubeSelectFacesBySide", "expectedCubeSelectFacesBySide", [OperatorSpecEditMode("select_face_by_sides", {"number": 4}, "FACE", {})]), SpecMeshTest("CubeSelectFacesBySideGreater", "testCubeSelectFacesBySideGreater", "expectedCubeSelectFacesBySideGreater", [OperatorSpecEditMode("select_face_by_sides", {"number": 4, "type": "GREATER", "extend": True}, "FACE", {})]), SpecMeshTest("CubeSelectFacesBySideLess", "testCubeSelectFacesBySideLess", "expectedCubeSelectFacesBySideLess", [OperatorSpecEditMode("select_face_by_sides", {"number": 4, "type": "GREATER", "extend": True}, "FACE", {})]), # select interior faces SpecMeshTest("CubeSelectInteriorFaces", "testCubeSelectInteriorFaces", "expectedCubeSelectInteriorFaces", [OperatorSpecEditMode("select_face_by_sides", {"number": 4}, "FACE", {})]), SpecMeshTest("HoledCubeSelectInteriorFaces", "testHoledCubeSelectInteriorFaces", "expectedHoledCubeSelectInteriorFaces", [OperatorSpecEditMode("select_face_by_sides", {"number": 4}, "FACE", {})]), SpecMeshTest("EmptyMeshSelectInteriorFaces", "testEmptyMeshSelectInteriorFaces", "expectedEmptyMeshSelectInteriorFaces", [OperatorSpecEditMode("select_face_by_sides", {"number": 4}, "FACE", {})]), # select less SpecMeshTest("MonkeySelectLess", "testMonkeySelectLess", "expectedMonkeySelectLess", [OperatorSpecEditMode("select_less", {}, "VERT", {2, 8, 24, 34, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 68, 69, 70, 71, 74, 75, 78, 80, 81, 82, 83, 90, 91, 93, 95, 97, 99, 101, 109, 111, 115, 117, 119, 121, 123, 125, 127, 129, 130, 131, 132, 133, 134, 135, 136, 138, 141, 143, 145, 147, 149, 151, 153, 155, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 181, 182, 184, 185, 186, 187, 188, 189, 190, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 206, 207, 208, 210, 216, 217, 218, 219, 220, 221, 222, 229, 230, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 263, 267, 269, 271, 275, 277, 289, 291, 293, 295, 309, 310, 311, 312, 316, 317, 318, 319, 320, 323, 325, 327, 329, 331, 341, 347, 349, 350, 351, 354, 356, 359, 361, 363, 365, 367, 369, 375, 379, 381, 382, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 423, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 495, 496, 497, 498, 499, 502, 505})]), SpecMeshTest("HoledCubeSelectLess", "testHoledCubeSelectLess", "expectedHoledCubeSelectLess", [OperatorSpecEditMode("select_face_by_sides", {}, "FACE", {})]), SpecMeshTest("EmptyMeshSelectLess", "testEmptyMeshSelectLess", "expectedEmptyMeshSelectLess", [OperatorSpecEditMode("select_face_by_sides", {}, "VERT", {})]), # select linked SpecMeshTest("PlanesSelectLinked", "testPlanesSelectLinked", "expectedPlanesSelectedLinked", [OperatorSpecEditMode("select_linked", {}, "VERT", {7})]), SpecMeshTest("CubesSelectLinked", "testCubesSelectLinked", "expectedCubesSelectLinked", [OperatorSpecEditMode("select_linked", {}, "VERT", {11})]), SpecMeshTest("EmptyMeshSelectLinked", "testEmptyMeshSelectLinked", "expectedEmptyMeshSelectLinked", [OperatorSpecEditMode("select_linked", {}, "VERT", {})]), # select nth (checkered deselect) SpecMeshTest("CircleSelect2nd", "testCircleSelect2nd", "expectedCircleSelect2nd", [OperatorSpecEditMode("select_nth", {}, "VERT", {i for i in range(32)})]), # Subdivide edgering - Not currently functional, operator returns inconsistently #SpecMeshTest("SubdivideEdgeringSurface", "testCylinderSubdivideEdgering", "expectedCylinderSubdivideEdgeringSurface", # [OperatorSpecEditMode("subdivide_edgering", {"number_cuts": 5, "interpolation": 'SURFACE', "profile_shape_factor": 0.1}, "EDGE", {0, (i for i in range(96) if (i % 3))})]), #SpecMeshTest("SubdivideEdgeringPath", "testCylinderSubdivideEdgering", "expectedCylinderSubdivideEdgeringPath", # [OperatorSpecEditMode("subdivide_edgering", {"number_cuts": 5, "interpolation": 'PATH', "profile_shape_factor": 0.1}, "EDGE", {0, (i for i in range(96) if (i % 3))})]), #SpecMeshTest("SubdivideEdgeringLinear", "testCylinderSubdivideEdgering", "expectedCylinderSubdivideEdgeringLinear", # [OperatorSpecEditMode("subdivide_edgering", {"number_cuts": 5, "interpolation": 'LINEAR', "profile_shape_factor": 0.1}, "EDGE", {0, (i for i in range(96) if (i % 3))})]), # Symmetry Snap SpecMeshTest("SymmetrySnap", "testPlaneSymmetrySnap", "expectedPlaneSymmetrySnap", [OperatorSpecEditMode("symmetry_snap", {"direction": 'POSITIVE_X', "threshold": 1, "factor": 0.75, "use_center": False}, "VERT", {i for i in range(5)})]), SpecMeshTest("SymmetrySnapCenter", "testPlaneSymmetrySnap", "expectedPlaneSymmetrySnapCenter", [OperatorSpecEditMode("symmetry_snap", {"direction": 'NEGATIVE_X', "threshold": 1, "factor": 0.75, "use_center": True}, "VERT", {i for i in range(5)})]), # Tris to Quads SpecMeshTest("TrisToQuads", "testPlanesTrisToQuad", "expectedPlanesTrisToQuad", [OperatorSpecEditMode("tris_convert_to_quads", {"face_threshold":0.174533, "shape_threshold":0.174533, "uvs":True, "vcols":True, "seam":True, "sharp":True, "materials":True}, "VERT", {i for i in range(32)})]), # unsubdivide # normal case SpecMeshTest("CubeFaceUnsubdivide", "testCubeUnsubdivide", "expectedCubeUnsubdivide", [OperatorSpecEditMode("unsubdivide", {}, "FACE", {i for i in range(6)})]), # UV Manipulation SpecMeshTest("UVRotate", "testCubeUV", "expectedCubeUVRotate", [OperatorSpecEditMode("uvs_rotate", {}, "FACE", {2})]), SpecMeshTest("UVRotateCCW", "testCubeUV", "expectedCubeUVRotateCCW", [OperatorSpecEditMode("uvs_rotate", {"use_ccw": True}, "FACE", {2})]), SpecMeshTest("UVReverse", "testCubeUV", "expectedCubeUVReverse", [OperatorSpecEditMode("uvs_reverse", {}, "FACE", {2})]), SpecMeshTest("UVAdd", "testCubeUV", "expectedCubeUVAdd", [OperatorSpecEditMode("uv_texture_add", {}, "FACE", {})]), SpecMeshTest("UVRemove", "testCubeUV", "expectedCubeUVRemove", [OperatorSpecEditMode("uv_texture_remove", {}, "FACE", {})]), # Vert Connect Concave SpecMeshTest("VertexConnectConcave", "testPlaneVertConnectConcave", "expectedPlaneVertConnectConcave", [OperatorSpecEditMode("vert_connect_concave", {}, "FACE", {0})]), SpecMeshTest("VertexConnectConcaveConvexPentagon", "testPentagonVertConnectConcave", "expectedPentagonVertConnectConcave", [OperatorSpecEditMode("vert_connect_concave", {}, "FACE", {0})]), SpecMeshTest("VertexConnectConcaveQuad", "testPlaneVertConnectConcaveQuad", "expectedPlaneVertConnectConcaveQuad", [OperatorSpecEditMode("vert_connect_concave", {}, "FACE", {0})]), # Vert Connect Nonplanar SpecMeshTest("VertexConnectNonplanar", "testPlaneVertConnectNonplanar", "expectedPlaneVertConnectNonplanar", [OperatorSpecEditMode("vert_connect_nonplanar", {"angle_limit": 0.17453292}, "VERT", {i for i in range(9)})]), SpecMeshTest("VertexConnectNonplanarNgon", "testPlaneVertConnectNonplanarNgon", "expectedPlaneVertConnectNonplanarNgon", [OperatorSpecEditMode("vert_connect_nonplanar", {"angle_limit": 0.218166}, "VERT", {i for i in range(6)})]), # T87259 - test cases SpecMeshTest("CubeEdgeUnsubdivide", "testCubeEdgeUnsubdivide", "expectedCubeEdgeUnsubdivide", [OperatorSpecEditMode("unsubdivide", {}, "EDGE", {i for i in range(6)})]), SpecMeshTest("UVSphereUnsubdivide", "testUVSphereUnsubdivide", "expectedUVSphereUnsubdivide", [OperatorSpecEditMode("unsubdivide", {'iterations': 9}, "FACE", {i for i in range(512)})]), # vert connect path # Tip: It works only if there is an already existing face or more than 2 vertices. SpecMeshTest( "PlaneVertConnectPath", "testPlaneVertConnectPath", "expectedPlaneVertConnectPath", [OperatorSpecEditMode( "vert_connect_path", {}, "VERT", (0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14), select_history=True, )], ), # Vertex Colors SpecMeshTest( "VertexColorAdd", "testCubeColorAdd", "expectedCubeColorAdd", [OperatorSpecEditMode("vertex_color_add", {}, "VERT", {})], ), SpecMeshTest( "VertexColorRemove", "testCubeColorRemove", "expectedCubeColorRemove", [OperatorSpecEditMode("vertex_color_remove", {}, "VERT", {})], ), SpecMeshTest( "VertexColorSculptAdd", "testCubeSculptAdd", "expectedCubeSculptAdd", [OperatorSpecEditMode("sculpt_vertex_color_add", {}, "VERT", {})], ), SpecMeshTest( "VertexColorSculptRemove", "testCubeSculptRemove", "expectedCubeSculptRemove", [OperatorSpecEditMode("sculpt_vertex_color_remove", {}, "VERT", {})], ), # Laplacian Smooth SpecMeshTest( "LaplacianSmoothDefault", "testSphereLaplacianSmoothDefault", "expectedSphereLaplacianSmoothDefault", [OperatorSpecEditMode("vertices_smooth_laplacian", {"preserve_volume": False}, "VERT", {i for i in range(482)})], ), SpecMeshTest( "LaplacianSmoothHighValues", "testSphereLaplacianSmoothHigh", "expectedSphereLaplacianSmoothHigh", [OperatorSpecEditMode("vertices_smooth_laplacian", {"preserve_volume": False, "repeat": 100, "lambda_factor": 10.0}, "VERT", {i for i in range(482)})], ), SpecMeshTest( "LaplacianSmoothBorder", "testCubeLaplacianSmoothBorder", "expectedCubeLaplacianSmoothBorder", [OperatorSpecEditMode("vertices_smooth_laplacian", {"preserve_volume": False, "lambda_border": 1.0}, "VERT", {i for i in range(25)})], ), SpecMeshTest( "LaplacianSmoothHighBorder", "testCubeLaplacianSmoothHighBorder", "expectedCubeLaplacianSmoothHighBorder", [OperatorSpecEditMode("vertices_smooth_laplacian", {"preserve_volume": False, "lambda_border": 100.0}, "VERT", {i for i in range(25)})], ), SpecMeshTest( "LaplacianSmoothPreserveVolume", "testSphereLaplacianSmoothPreserveVol", "expectedSphereLaplacianSmoothPreserveVol", [OperatorSpecEditMode("vertices_smooth_laplacian", {"preserve_volume": True}, "VERT", {i for i in range(482)})], ), # wireframe SpecMeshTest( "WireFrameDefault", "testCubeWireframeDefault", "expectedCubeWireframeDefault", [OperatorSpecEditMode("wireframe", {}, "FACE", {i for i in range(6)})], ), SpecMeshTest( "WireFrameAlt", "testCubeWireframeAlt", "expectedCubeWireframeAlt", [OperatorSpecEditMode( "wireframe", { "use_boundary": False, "use_even_offset": False, "use_relative_offset": True, "use_replace": False, "thickness": 0.3, "offset": 0.3, "use_crease": True, "crease_weight": 0.01, }, "FACE", {i for i in range(6)})], ), ] operators_test = RunTest(tests) command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": operators_test.do_compare = True operators_test.run_all_tests() break elif cmd == "--run-test": operators_test.do_compare = False name = command[i + 1] operators_test.run_test(name) break
def main(): tests = [ # bisect MeshTest("CubeBisect", "testCubeBisect", "expectedCubeBisect", [ OperatorSpecEditMode( "bisect", { "plane_co": (0, 0, 0), "plane_no": (0, 1, 1), "clear_inner": True, "use_fill": True }, 'FACE', {0, 1, 2, 3, 4, 5}, ) ]), # blend from shape MeshTest( "CubeBlendFromShape", "testCubeBlendFromShape", "expectedCubeBlendFromShape", [ OperatorSpecEditMode("blend_from_shape", {"shape": "Key 1"}, 'FACE', {0, 1, 2, 3, 4, 5}) ]), # bridge edge loops MeshTest( "CubeBridgeEdgeLoop", "testCubeBrigeEdgeLoop", "expectedCubeBridgeEdgeLoop", [OperatorSpecEditMode("bridge_edge_loops", {}, "FACE", {0, 1})]), # decimate MeshTest("MonkeyDecimate", "testMonkeyDecimate", "expectedMonkeyDecimate", [ OperatorSpecEditMode("decimate", {"ratio": 0.1}, "FACE", {i for i in range(500)}) ]), # delete MeshTest("CubeDeleteVertices", "testCubeDeleteVertices", "expectedCubeDeleteVertices", [OperatorSpecEditMode("delete", {}, "VERT", {3})]), MeshTest("CubeDeleteFaces", "testCubeDeleteFaces", "expectedCubeDeleteFaces", [OperatorSpecEditMode("delete", {}, "FACE", {0})]), MeshTest("CubeDeleteEdges", "testCubeDeleteEdges", "expectedCubeDeleteEdges", [OperatorSpecEditMode("delete", {}, "EDGE", {0, 1, 2, 3})]), # delete edge loop MeshTest("MonkeyDeleteEdgeLoopVertices", "testMokneyDeleteEdgeLoopVertices", "expectedMonkeyDeleteEdgeLoopVertices", [ OperatorSpecEditMode("delete_edgeloop", {}, "VERT", MONKEY_LOOP_VERT) ]), MeshTest("MonkeyDeleteEdgeLoopEdges", "testMokneyDeleteEdgeLoopEdges", "expectedMonkeyDeleteEdgeLoopEdges", [ OperatorSpecEditMode("delete_edgeloop", {}, "EDGE", MONKEY_LOOP_EDGE) ]), # delete loose MeshTest("CubeDeleteLooseVertices", "testCubeDeleteLooseVertices", "expectedCubeDeleteLooseVertices", [ OperatorSpecEditMode("delete_loose", { "use_verts": True, "use_edges": False, "use_faces": False }, "VERT", {i for i in range(12)}) ]), MeshTest("CubeDeleteLooseEdges", "testCubeDeleteLooseEdges", "expectedCubeDeleteLooseEdges", [ OperatorSpecEditMode("delete_loose", { "use_verts": False, "use_edges": True, "use_faces": False }, "EDGE", {i for i in range(14)}) ]), MeshTest("CubeDeleteLooseFaces", "testCubeDeleteLooseFaces", "expectedCubeDeleteLooseFaces", [ OperatorSpecEditMode("delete_loose", { "use_verts": False, "use_edges": False, "use_faces": True }, "FACE", {i for i in range(7)}) ]), # dissolve degenerate MeshTest("CubeDissolveDegenerate", "testCubeDissolveDegenerate", "expectedCubeDissolveDegenerate", [ OperatorSpecEditMode("dissolve_degenerate", {}, "VERT", {i for i in range(8)}) ]), # dissolve edges MeshTest( "CylinderDissolveEdges", "testCylinderDissolveEdges", "expectedCylinderDissolveEdges", [OperatorSpecEditMode("dissolve_edges", {}, "EDGE", {0, 5, 6, 9}) ]), # dissolve faces MeshTest("CubeDissolveFaces", "testCubeDissolveFaces", "expectedCubeDissolveFaces", [ OperatorSpecEditMode("dissolve_faces", {}, "VERT", {5, 34, 47, 49, 83, 91, 95}) ]), # dissolve verts MeshTest("CubeDissolveVerts", "testCubeDissolveVerts", "expectedCubeDissolveVerts", [ OperatorSpecEditMode("dissolve_verts", {}, "VERT", {16, 20, 22, 23, 25}) ]), # duplicate MeshTest("ConeDuplicateVertices", "testConeDuplicateVertices", "expectedConeDuplicateVertices", [ OperatorSpecEditMode("duplicate", {}, "VERT", {i for i in range(33)} - {23}) ]), MeshTest("ConeDuplicateOneVertex", "testConeDuplicateOneVertex", "expectedConeDuplicateOneVertex", [OperatorSpecEditMode("duplicate", {}, "VERT", {23})]), MeshTest("ConeDuplicateFaces", "testConeDuplicateFaces", "expectedConeDuplicateFaces", [OperatorSpecEditMode("duplicate", {}, "FACE", {6, 9})]), MeshTest("ConeDuplicateEdges", "testConeDuplicateEdges", "expectedConeDuplicateEdges", [ OperatorSpecEditMode("duplicate", {}, "EDGE", {i for i in range(64)}) ]), # edge collapse MeshTest( "CylinderEdgeCollapse", "testCylinderEdgeCollapse", "expectedCylinderEdgeCollapse", [OperatorSpecEditMode("edge_collapse", {}, "EDGE", {1, 9, 4})]), # edge face add MeshTest("CubeEdgeFaceAddFace", "testCubeEdgeFaceAddFace", "expectedCubeEdgeFaceAddFace", [ OperatorSpecEditMode("edge_face_add", {}, "VERT", {1, 3, 4, 5, 7}) ]), MeshTest("CubeEdgeFaceAddEdge", "testCubeEdgeFaceAddEdge", "expectedCubeEdgeFaceAddEdge", [OperatorSpecEditMode("edge_face_add", {}, "VERT", {4, 5})]), # edge rotate MeshTest("CubeEdgeRotate", "testCubeEdgeRotate", "expectedCubeEdgeRotate", [OperatorSpecEditMode("edge_rotate", {}, "EDGE", {1})]), # edge split MeshTest("CubeEdgeSplit", "testCubeEdgeSplit", "expectedCubeEdgeSplit", [ OperatorSpecEditMode("edge_split", {}, "EDGE", {2, 5, 8, 11, 14, 17, 20, 23}) ]), ### 25 # edge ring select - Cannot be tested. Need user input. # MeshTest("CubeEdgeRingSelect", "testCubeEdgeRingSelect", "expectedCubeEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "EDGE", {5, 20, 25, 26})]), # MeshTest("EmptyMeshEdgeRingSelect", "testGridEdgeRingSelect", "expectedGridEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "VERT", {65, 66, 67})]), # MeshTest("EmptyMeshEdgeRingSelect", "testEmptyMeshdgeRingSelect", "expectedEmptyMeshEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "VERT", {})]), # face make planar MeshTest("MonkeyFaceMakePlanar", "testMonkeyFaceMakePlanar", "expectedMonkeyFaceMakePlanar", [ OperatorSpecEditMode("face_make_planar", {}, "FACE", {i for i in range(500)}) ]), # face split by edges MeshTest("PlaneFaceSplitByEdges", "testPlaneFaceSplitByEdges", "expectedPlaneFaceSplitByEdges", [ OperatorSpecEditMode("face_split_by_edges", {}, "VERT", {i for i in range(6)}) ]), # faces select linked flat MeshTest("CubeFacesSelectLinkedFlat", "testCubeFaceSelectLinkedFlat", "expectedCubeFaceSelectLinkedFlat", [ OperatorSpecEditMode("faces_select_linked_flat", {}, "FACE", {7}) ]), MeshTest("PlaneFacesSelectLinkedFlat", "testPlaneFaceSelectLinkedFlat", "expectedPlaneFaceSelectLinkedFlat", [ OperatorSpecEditMode("faces_select_linked_flat", {}, "VERT", {1}) ]), MeshTest( "EmptyMeshFacesSelectLinkedFlat", "testEmptyMeshFaceSelectLinkedFlat", "expectedEmptyMeshFaceSelectLinkedFlat", [OperatorSpecEditMode("faces_select_linked_flat", {}, "VERT", {}) ]), # fill MeshTest( "IcosphereFill", "testIcosphereFill", "expectedIcosphereFill", [ OperatorSpecEditMode("fill", {}, "EDGE", {20, 21, 22, 23, 24, 45, 46, 47, 48, 49}) ]), MeshTest( "IcosphereFillUseBeautyFalse", "testIcosphereFillUseBeautyFalse", "expectedIcosphereFillUseBeautyFalse", [ OperatorSpecEditMode("fill", {"use_beauty": False}, "EDGE", {20, 21, 22, 23, 24, 45, 46, 47, 48, 49}) ]), # fill grid MeshTest( "PlaneFillGrid", "testPlaneFillGrid", "expectedPlaneFillGrid", [ OperatorSpecEditMode("fill_grid", {}, "EDGE", {1, 2, 3, 4, 5, 7, 9, 10, 11, 12, 13, 15}) ]), MeshTest("PlaneFillGridSimpleBlending", "testPlaneFillGridSimpleBlending", "expectedPlaneFillGridSimpleBlending", [ OperatorSpecEditMode( "fill_grid", {"use_interp_simple": True}, "EDGE", {1, 2, 3, 4, 5, 7, 9, 10, 11, 12, 13, 15}) ]), # fill holes MeshTest("SphereFillHoles", "testSphereFillHoles", "expectedSphereFillHoles", [ OperatorSpecEditMode("fill_holes", {"sides": 9}, "VERT", {i for i in range(481)}) ]), # inset faces MeshTest("CubeInset", "testCubeInset", "expectedCubeInset", [ OperatorSpecEditMode("inset", {"thickness": 0.2}, "VERT", { 5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95 }) ]), MeshTest("CubeInsetEvenOffsetFalse", "testCubeInsetEvenOffsetFalse", "expectedCubeInsetEvenOffsetFalse", [ OperatorSpecEditMode("inset", { "thickness": 0.2, "use_even_offset": False }, "VERT", { 5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95 }) ]), MeshTest("CubeInsetDepth", "testCubeInsetDepth", "expectedCubeInsetDepth", [ OperatorSpecEditMode("inset", { "thickness": 0.2, "depth": 0.2 }, "VERT", { 5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95 }) ]), MeshTest("GridInsetRelativeOffset", "testGridInsetRelativeOffset", "expectedGridInsetRelativeOffset", [ OperatorSpecEditMode("inset", { "thickness": 0.4, "use_relative_offset": True }, "FACE", {35, 36, 37, 45, 46, 47, 55, 56, 57}) ]), ] operators_test = RunTest(tests) command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": operators_test.do_compare = True operators_test.run_all_tests() break elif cmd == "--run-test": operators_test.do_compare = False name = command[i + 1] operators_test.run_test(name) break
def main(): tests = [ # bisect MeshTest("CubeBisect", "testCubeBisect", "expectedCubeBisect", [ OperatorSpecEditMode( "bisect", { "plane_co": (0, 0, 0), "plane_no": (0, 1, 1), "clear_inner": True, "use_fill": True }, 'FACE', {0, 1, 2, 3, 4, 5}, ) ]), # blend from shape MeshTest( "CubeBlendFromShape", "testCubeBlendFromShape", "expectedCubeBlendFromShape", [ OperatorSpecEditMode("blend_from_shape", {"shape": "Key 1"}, 'FACE', {0, 1, 2, 3, 4, 5}) ]), # bridge edge loops MeshTest( "CubeBridgeEdgeLoop", "testCubeBrigeEdgeLoop", "expectedCubeBridgeEdgeLoop", [OperatorSpecEditMode("bridge_edge_loops", {}, "FACE", {0, 1})]), # decimate MeshTest("MonkeyDecimate", "testMonkeyDecimate", "expectedMonkeyDecimate", [ OperatorSpecEditMode("decimate", {"ratio": 0.1}, "FACE", {i for i in range(500)}) ]), # delete MeshTest("CubeDeleteVertices", "testCubeDeleteVertices", "expectedCubeDeleteVertices", [OperatorSpecEditMode("delete", {}, "VERT", {3})]), MeshTest("CubeDeleteFaces", "testCubeDeleteFaces", "expectedCubeDeleteFaces", [OperatorSpecEditMode("delete", {}, "FACE", {0})]), MeshTest("CubeDeleteEdges", "testCubeDeleteEdges", "expectedCubeDeleteEdges", [OperatorSpecEditMode("delete", {}, "EDGE", {0, 1, 2, 3})]), # delete edge loop MeshTest("MonkeyDeleteEdgeLoopVertices", "testMokneyDeleteEdgeLoopVertices", "expectedMonkeyDeleteEdgeLoopVertices", [ OperatorSpecEditMode("delete_edgeloop", {}, "VERT", MONKEY_LOOP_VERT) ]), MeshTest("MonkeyDeleteEdgeLoopEdges", "testMokneyDeleteEdgeLoopEdges", "expectedMonkeyDeleteEdgeLoopEdges", [ OperatorSpecEditMode("delete_edgeloop", {}, "EDGE", MONKEY_LOOP_EDGE) ]), # delete loose MeshTest("CubeDeleteLooseVertices", "testCubeDeleteLooseVertices", "expectedCubeDeleteLooseVertices", [ OperatorSpecEditMode("delete_loose", { "use_verts": True, "use_edges": False, "use_faces": False }, "VERT", {i for i in range(12)}) ]), MeshTest("CubeDeleteLooseEdges", "testCubeDeleteLooseEdges", "expectedCubeDeleteLooseEdges", [ OperatorSpecEditMode("delete_loose", { "use_verts": False, "use_edges": True, "use_faces": False }, "EDGE", {i for i in range(14)}) ]), MeshTest("CubeDeleteLooseFaces", "testCubeDeleteLooseFaces", "expectedCubeDeleteLooseFaces", [ OperatorSpecEditMode("delete_loose", { "use_verts": False, "use_edges": False, "use_faces": True }, "FACE", {i for i in range(7)}) ]), # dissolve degenerate MeshTest("CubeDissolveDegenerate", "testCubeDissolveDegenerate", "expectedCubeDissolveDegenerate", [ OperatorSpecEditMode("dissolve_degenerate", {}, "VERT", {i for i in range(8)}) ]), # dissolve edges MeshTest( "CylinderDissolveEdges", "testCylinderDissolveEdges", "expectedCylinderDissolveEdges", [OperatorSpecEditMode("dissolve_edges", {}, "EDGE", {0, 5, 6, 9}) ]), # dissolve faces MeshTest("CubeDissolveFaces", "testCubeDissolveFaces", "expectedCubeDissolveFaces", [ OperatorSpecEditMode("dissolve_faces", {}, "VERT", {5, 34, 47, 49, 83, 91, 95}) ]), # dissolve verts MeshTest("CubeDissolveVerts", "testCubeDissolveVerts", "expectedCubeDissolveVerts", [ OperatorSpecEditMode("dissolve_verts", {}, "VERT", {16, 20, 22, 23, 25}) ]), # duplicate MeshTest("ConeDuplicateVertices", "testConeDuplicateVertices", "expectedConeDuplicateVertices", [ OperatorSpecEditMode("duplicate", {}, "VERT", {i for i in range(33)} - {23}) ]), MeshTest("ConeDuplicateOneVertex", "testConeDuplicateOneVertex", "expectedConeDuplicateOneVertex", [OperatorSpecEditMode("duplicate", {}, "VERT", {23})]), MeshTest("ConeDuplicateFaces", "testConeDuplicateFaces", "expectedConeDuplicateFaces", [OperatorSpecEditMode("duplicate", {}, "FACE", {6, 9})]), MeshTest("ConeDuplicateEdges", "testConeDuplicateEdges", "expectedConeDuplicateEdges", [ OperatorSpecEditMode("duplicate", {}, "EDGE", {i for i in range(64)}) ]), # edge collapse MeshTest( "CylinderEdgeCollapse", "testCylinderEdgeCollapse", "expectedCylinderEdgeCollapse", [OperatorSpecEditMode("edge_collapse", {}, "EDGE", {1, 9, 4})]), # edge face add MeshTest("CubeEdgeFaceAddFace", "testCubeEdgeFaceAddFace", "expectedCubeEdgeFaceAddFace", [ OperatorSpecEditMode("edge_face_add", {}, "VERT", {1, 3, 4, 5, 7}) ]), MeshTest("CubeEdgeFaceAddEdge", "testCubeEdgeFaceAddEdge", "expectedCubeEdgeFaceAddEdge", [OperatorSpecEditMode("edge_face_add", {}, "VERT", {4, 5})]), # edge rotate MeshTest("CubeEdgeRotate", "testCubeEdgeRotate", "expectedCubeEdgeRotate", [OperatorSpecEditMode("edge_rotate", {}, "EDGE", {1})]), # edge split MeshTest("CubeEdgeSplit", "testCubeEdgeSplit", "expectedCubeEdgeSplit", [ OperatorSpecEditMode("edge_split", {}, "EDGE", {2, 5, 8, 11, 14, 17, 20, 23}) ]), # edge ring select - Cannot be tested. Need user input. # MeshTest("CubeEdgeRingSelect", "testCubeEdgeRingSelect", "expectedCubeEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "EDGE", {5, 20, 25, 26})]), # MeshTest("EmptyMeshEdgeRingSelect", "testGridEdgeRingSelect", "expectedGridEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "VERT", {65, 66, 67})]), # MeshTest("EmptyMeshEdgeRingSelect", "testEmptyMeshdgeRingSelect", "expectedEmptyMeshEdgeRingSelect", # [OperatorSpecEditMode("edgering_select", {}, "VERT", {})]), # edges select sharp MeshTest( "CubeEdgesSelectSharp", "testCubeEdgeSelectSharp", "expectedCubeEdgeSelectSharp", [OperatorSpecEditMode("edges_select_sharp", {}, "EDGE", {20})]), MeshTest("SphereEdgesSelectSharp", "testSphereEdgesSelectSharp", "expectedSphereEdgeSelectSharp", [ OperatorSpecEditMode("edges_select_sharp", {"sharpness": 0.25}, "EDGE", {288}) ]), MeshTest("HoledSphereEdgesSelectSharp", "testHoledSphereEdgesSelectSharp", "expectedHoledSphereEdgeSelectSharp", [ OperatorSpecEditMode("edges_select_sharp", {"sharpness": 0.18}, "VERT", {}) ]), MeshTest("EmptyMeshEdgesSelectSharp", "testEmptyMeshEdgeSelectSharp", "expectedEmptyMeshEdgeSelectSharp", [OperatorSpecEditMode("edges_select_sharp", {}, "VERT", {})]), # face make planar MeshTest("MonkeyFaceMakePlanar", "testMonkeyFaceMakePlanar", "expectedMonkeyFaceMakePlanar", [ OperatorSpecEditMode("face_make_planar", {}, "FACE", {i for i in range(500)}) ]), # face split by edges MeshTest("PlaneFaceSplitByEdges", "testPlaneFaceSplitByEdges", "expectedPlaneFaceSplitByEdges", [ OperatorSpecEditMode("face_split_by_edges", {}, "VERT", {i for i in range(6)}) ]), # faces select linked flat MeshTest("CubeFacesSelectLinkedFlat", "testCubeFaceSelectLinkedFlat", "expectedCubeFaceSelectLinkedFlat", [ OperatorSpecEditMode("faces_select_linked_flat", {}, "FACE", {7}) ]), MeshTest("PlaneFacesSelectLinkedFlat", "testPlaneFaceSelectLinkedFlat", "expectedPlaneFaceSelectLinkedFlat", [ OperatorSpecEditMode("faces_select_linked_flat", {}, "VERT", {1}) ]), MeshTest( "EmptyMeshFacesSelectLinkedFlat", "testEmptyMeshFaceSelectLinkedFlat", "expectedEmptyMeshFaceSelectLinkedFlat", [OperatorSpecEditMode("faces_select_linked_flat", {}, "VERT", {}) ]), # fill MeshTest( "IcosphereFill", "testIcosphereFill", "expectedIcosphereFill", [ OperatorSpecEditMode("fill", {}, "EDGE", {20, 21, 22, 23, 24, 45, 46, 47, 48, 49}) ]), MeshTest( "IcosphereFillUseBeautyFalse", "testIcosphereFillUseBeautyFalse", "expectedIcosphereFillUseBeautyFalse", [ OperatorSpecEditMode("fill", {"use_beauty": False}, "EDGE", {20, 21, 22, 23, 24, 45, 46, 47, 48, 49}) ]), # fill grid MeshTest( "PlaneFillGrid", "testPlaneFillGrid", "expectedPlaneFillGrid", [ OperatorSpecEditMode("fill_grid", {}, "EDGE", {1, 2, 3, 4, 5, 7, 9, 10, 11, 12, 13, 15}) ]), MeshTest("PlaneFillGridSimpleBlending", "testPlaneFillGridSimpleBlending", "expectedPlaneFillGridSimpleBlending", [ OperatorSpecEditMode( "fill_grid", {"use_interp_simple": True}, "EDGE", {1, 2, 3, 4, 5, 7, 9, 10, 11, 12, 13, 15}) ]), # fill holes MeshTest("SphereFillHoles", "testSphereFillHoles", "expectedSphereFillHoles", [ OperatorSpecEditMode("fill_holes", {"sides": 9}, "VERT", {i for i in range(481)}) ]), # inset faces MeshTest("CubeInset", "testCubeInset", "expectedCubeInset", [ OperatorSpecEditMode("inset", {"thickness": 0.2}, "VERT", { 5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95 }) ]), MeshTest("CubeInsetEvenOffsetFalse", "testCubeInsetEvenOffsetFalse", "expectedCubeInsetEvenOffsetFalse", [ OperatorSpecEditMode("inset", { "thickness": 0.2, "use_even_offset": False }, "VERT", { 5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95 }) ]), MeshTest("CubeInsetDepth", "testCubeInsetDepth", "expectedCubeInsetDepth", [ OperatorSpecEditMode("inset", { "thickness": 0.2, "depth": 0.2 }, "VERT", { 5, 16, 17, 19, 20, 22, 23, 34, 47, 49, 50, 52, 59, 61, 62, 65, 83, 91, 95 }) ]), MeshTest("GridInsetRelativeOffset", "testGridInsetRelativeOffset", "expectedGridInsetRelativeOffset", [ OperatorSpecEditMode("inset", { "thickness": 0.4, "use_relative_offset": True }, "FACE", {35, 36, 37, 45, 46, 47, 55, 56, 57}) ]), # loop multi select MeshTest("MokeyLoopMultiSelect", "testMonkeyLoopMultiSelect", "expectedMonkeyLoopMultiSelect", [ OperatorSpecEditMode("loop_multi_select", {}, "VERT", {355, 359, 73, 301, 302}) ]), MeshTest("HoledGridLoopMultiSelect", "testGridLoopMultiSelect", "expectedGridLoopMultiSelect", [ OperatorSpecEditMode("loop_multi_select", {}, "VERT", {257, 169, 202, 207, 274, 278, 63}) ]), MeshTest("EmptyMeshLoopMultiSelect", "testEmptyMeshLoopMultiSelect", "expectedEmptyMeshLoopMultiSelect", [OperatorSpecEditMode("loop_multi_select", {}, "VERT", {})]), # select all MeshTest("CircleSelectAll", "testCircleSelectAll", "expectedCircleSelectAll", [OperatorSpecEditMode("select_all", {}, "VERT", {1})]), MeshTest("IsolatedVertsSelectAll", "testIsolatedVertsSelectAll", "expectedIsolatedVertsSelectAll", [OperatorSpecEditMode("select_all", {}, "VERT", {})]), MeshTest("EmptyMeshSelectAll", "testEmptyMeshSelectAll", "expectedEmptyMeshSelectAll", [OperatorSpecEditMode("select_all", {}, "VERT", {})]), # select axis - Cannot be tested. Needs active vert selection # MeshTest("MonkeySelectAxisX", "testMonkeySelectAxisX", "expectedMonkeySelectAxisX", # [OperatorSpecEditMode("select_axis", {"axis": "X"}, "VERT", {13})]), # MeshTest("MonkeySelectAxisY", "testMonkeySelectAxisY", "expectedMonkeySelectAxisY", # [OperatorSpecEditMode("select_axis", {"axis": "Y", "sign": "NEG"}, "FACE", {317})]), # MeshTest("MonkeySelectAxisXYZ", "testMonkeySelectAxisXYZ", "expectedMonkeySelectAxisXYZ", # [OperatorSpecEditMode("select_axis", {"axis": "X", "sign": "NEG"}, "FACE", {317}), # OperatorSpecEditMode("select_axis", {"axis": "Y", "sign": "POS"}, "FACE", {}), # OperatorSpecEditMode("select_axis", {"axis": "Z", "sign": "NEG"}, "FACE", {})]), # select faces by sides MeshTest("CubeSelectFacesBySide", "testCubeSelectFacesBySide", "expectedCubeSelectFacesBySide", [ OperatorSpecEditMode("select_face_by_sides", {"number": 4}, "FACE", {}) ]), MeshTest("CubeSelectFacesBySideGreater", "testCubeSelectFacesBySideGreater", "expectedCubeSelectFacesBySideGreater", [ OperatorSpecEditMode("select_face_by_sides", { "number": 4, "type": "GREATER", "extend": True }, "FACE", {}) ]), MeshTest("CubeSelectFacesBySideLess", "testCubeSelectFacesBySideLess", "expectedCubeSelectFacesBySideLess", [ OperatorSpecEditMode("select_face_by_sides", { "number": 4, "type": "GREATER", "extend": True }, "FACE", {}) ]), # select interior faces MeshTest("CubeSelectInteriorFaces", "testCubeSelectInteriorFaces", "expectedCubeSelectInteriorFaces", [ OperatorSpecEditMode("select_face_by_sides", {"number": 4}, "FACE", {}) ]), MeshTest("HoledCubeSelectInteriorFaces", "testHoledCubeSelectInteriorFaces", "expectedHoledCubeSelectInteriorFaces", [ OperatorSpecEditMode("select_face_by_sides", {"number": 4}, "FACE", {}) ]), MeshTest("EmptyMeshSelectInteriorFaces", "testEmptyMeshSelectInteriorFaces", "expectedEmptyMeshSelectInteriorFaces", [ OperatorSpecEditMode("select_face_by_sides", {"number": 4}, "FACE", {}) ]), # select less MeshTest( "MonkeySelectLess", "testMonkeySelectLess", "expectedMonkeySelectLess", [ OperatorSpecEditMode("select_less", {}, "VERT", { 2, 8, 24, 34, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 68, 69, 70, 71, 74, 75, 78, 80, 81, 82, 83, 90, 91, 93, 95, 97, 99, 101, 109, 111, 115, 117, 119, 121, 123, 125, 127, 129, 130, 131, 132, 133, 134, 135, 136, 138, 141, 143, 145, 147, 149, 151, 153, 155, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 181, 182, 184, 185, 186, 187, 188, 189, 190, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 206, 207, 208, 210, 216, 217, 218, 219, 220, 221, 222, 229, 230, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 263, 267, 269, 271, 275, 277, 289, 291, 293, 295, 309, 310, 311, 312, 316, 317, 318, 319, 320, 323, 325, 327, 329, 331, 341, 347, 349, 350, 351, 354, 356, 359, 361, 363, 365, 367, 369, 375, 379, 381, 382, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 423, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 495, 496, 497, 498, 499, 502, 505 }) ]), MeshTest( "HoledCubeSelectLess", "testHoledCubeSelectLess", "expectedHoledCubeSelectLess", [OperatorSpecEditMode("select_face_by_sides", {}, "FACE", {})]), MeshTest( "EmptyMeshSelectLess", "testEmptyMeshSelectLess", "expectedEmptyMeshSelectLess", [OperatorSpecEditMode("select_face_by_sides", {}, "VERT", {})]), # select linked MeshTest("PlanesSelectLinked", "testPlanesSelectLinked", "expectedPlanesSelectedLinked", [OperatorSpecEditMode("select_linked", {}, "VERT", {7})]), MeshTest("CubesSelectLinked", "testCubesSelectLinked", "expectedCubesSelectLinked", [OperatorSpecEditMode("select_linked", {}, "VERT", {11})]), MeshTest("EmptyMeshSelectLinked", "testEmptyMeshSelectLinked", "expectedEmptyMeshSelectLinked", [OperatorSpecEditMode("select_linked", {}, "VERT", {})]), ] operators_test = RunTest(tests) command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": operators_test.do_compare = True operators_test.run_all_tests() break elif cmd == "--run-test": operators_test.do_compare = False name = command[i + 1] operators_test.run_test(name) break
def main(): tests = [ # 0 MeshTest( 'Cube_test_1', 'Cube_test', 'Cube_result_1', [OperatorSpecEditMode('bevel', {'offset': 0.2}, 'EDGE', {10})]), MeshTest('Cube_test_2', 'Cube_test', 'Cube_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'offset_type': 'WIDTH' }, 'EDGE', {10, 7}, ) ]), MeshTest('Cube_test_3', 'Cube_test', 'Cube_result_3', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'offset_type': 'DEPTH' }, 'EDGE', {8, 10, 7}, ) ]), MeshTest('Cube_test_4', 'Cube_test', 'Cube_result_4', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 2 }, 'EDGE', {10}, ) ]), MeshTest('Cube_test_5', 'Cube_test', 'Cube_result_5', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 3 }, 'EDGE', {10, 7}, ) ]), # 5 MeshTest('Cube_test_6', 'Cube_test', 'Cube_result_6', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 4 }, 'EDGE', {8, 10, 7}, ) ]), MeshTest('Cube_test_7', 'Cube_test', 'Cube_result_7', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 5, 'profile': 0.2 }, 'EDGE', {0, 10, 4, 7}, ) ]), MeshTest('Cube_test_8', 'Cube_test', 'Cube_result_8', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 5, 'profile': 0.25 }, 'EDGE', {8, 10, 7}, ) ]), MeshTest('Cube_test_9', 'Cube_test', 'Cube_result_9', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 6, 'profile': 0.9 }, 'EDGE', {8, 10, 7}, ) ]), MeshTest('Cube_test_10', 'Cube_test', 'Cube_result_10', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 4, 'profile': 1.0 }, 'EDGE', {10, 7}, ) ]), # 10 MeshTest('Cube_test_11', 'Cube_test', 'Cube_result_11', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 5, 'profile': 1.0 }, 'EDGE', {8, 10, 7}, ) ]), MeshTest("test 12", 'Cube_test', 'Cube_result_12', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 8 }, 'EDGE', {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, ) ]), MeshTest( 'Pyramid4_test_1', 'Pyr4_test', 'Pyr4_result_1', [OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {5}, )]), MeshTest( 'Pyramid4_test_2', 'Pyr4_test', 'Pyr4_result_2', [OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {2, 5}, )]), MeshTest('Pyramid4_test_3', 'Pyr4_test', 'Pyr4_result_3', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {2, 3, 5}, ) ]), # 15 MeshTest('Pyramid4_test_4', 'Pyr4_test', 'Pyr4_result_4', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {1, 2, 3, 5}, ) ]), MeshTest('Pyramid4_test_5', 'Pyr4_test', 'Pyr4_result_5', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {1, 2, 3, 5}, ) ]), MeshTest('Pyramid4_test_6', 'Pyr4_test', 'Pyr4_result_6', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {2, 3}, ) ]), MeshTest('Pyramid4_test_7', 'Pyr4_test', 'Pyr4_result_7', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 4, 'profile': 0.15 }, 'EDGE', {1, 2, 3, 5}, ) ]), MeshTest('Pyramid4_test_8', 'Pyr4_test', 'Pyr4_result_8', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.75, 'segments': 4, 'affect': 'VERTICES' }, 'VERT', {1}, ) ]), # 20 MeshTest('Pyramid4_test_9', 'Pyr4_test', 'Pyr4_result_9', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.75, 'segments': 3, 'affect': 'VERTICES', 'profile': 0.25 }, 'VERT', {1}, ) ]), MeshTest( 'Pyramid6_test_1', 'Pyr6_test', 'Pyr6_result_1', [OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {2, 3}, )]), MeshTest('Pyramid6_test_2', 'Pyr6_test', 'Pyr6_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {8, 2, 3}, ) ]), MeshTest('Pyramid6_test_3', 'Pyr6_test', 'Pyr6_result_3', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 4, 'profile': 0.8 }, 'EDGE', {0, 2, 3, 4, 6, 7, 9, 10, 11}, ) ]), MeshTest('Sept_test_1', 'Sept_test', 'Sept_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.1}, 'EDGE', {8, 9, 3, 11}, ) ]), # 25 MeshTest('Sept_test_2', 'Sept_test', 'Sept_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.1, 'offset_type': 'WIDTH' }, 'EDGE', {8, 9, 11}, ) ]), MeshTest('Saddle_test_1', 'Saddle_test', 'Saddle_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.3, 'segments': 5 }, 'EDGE', {2, 8, 9, 12, 13, 14}, ) ]), MeshTest('Saddle_test_2', 'Saddle_test', 'Saddle_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.6, 'segments': 6, 'affect': 'VERTICES' }, 'VERT', {4}, ) ]), MeshTest('Bent_test', 'Bent_test', 'Bent_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', { 2, 5, 8, 11, 14, 18, 21, 24, 27, 30, 34, 37, 40, 43, 46, 50, 53, 56, 59, 62, 112, 113, 114, 115 }, ) ]), MeshTest('Bentlines_test_1', 'Bentlines_test', 'Bentlines_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {1, 8, 9, 10, 11}, ) ]), # 30 MeshTest('Flaretop_test_1', 'Flaretop_test', 'Flaretop_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 2 }, 'EDGE', {26, 12, 20}, ) ]), MeshTest('Flaretop_test_2', 'Flaretop_test', 'Flaretop_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 2, 'profile': 1.0 }, 'EDGE', {26, 12, 20}, ) ]), MeshTest('Flaretop_test_3', 'Flaretop_test', 'Flaretop_result_3', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.4, 'segments': 4 }, 'FACE', {1, 6, 7, 8, 9, 10, 11, 12}, ) ]), MeshTest('BentL_test', 'BentL_test', 'BentL_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {4, 8, 10, 18, 24}, ) ]), MeshTest('Wires_test_1', 'Wires_test', 'Wires_test_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.3}, 'EDGE', {0, 1, 2, 10}, ) ]), # 35 MeshTest('Wires_test_2', 'Wires_test', 'Wires_test_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.3, 'affect': 'VERTICES' }, 'VERT', {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ) ]), MeshTest('tri_test_1', 'tri', 'tri_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {3, 4, 5}, ) ]), MeshTest('tri_test_2', 'tri', 'tri_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {3, 4, 5}, ) ]), MeshTest('tri_test_3', 'tri', 'tri_result_3', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {3, 4, 5}, ) ]), MeshTest( 'tri_test_4', 'tri', 'tri_result_4', [OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {3, 4}, )]), # 40 MeshTest('tri_test_5', 'tri', 'tri_result_5', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {3, 4}, ) ]), MeshTest('tri_test_6', 'tri', 'tri_result_6', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'affect': 'VERTICES' }, 'VERT', {3}, ) ]), MeshTest('tri_test_7', 'tri', 'tri_result_7', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2, 'affect': 'VERTICES' }, 'VERT', {3}, ) ]), MeshTest('tri_test_8', 'tri', 'tri_result_8', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3, 'affect': 'VERTICES' }, 'VERT', {3}, ) ]), MeshTest('tri_test_9', 'tri', 'tri_result_9', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'affect': 'VERTICES' }, 'VERT', {1}, ) ]), # 45 MeshTest('tri1gap_test_2', 'tri1gap', 'tri1gap_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {3, 4, 5}, ) ]), MeshTest('tri1gap_test_3', 'tri1gap', 'tri1gap_result_3', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {3, 4, 5}, ) ]), MeshTest('tri1gap_test_1', 'tri1gap', 'tri1gap_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {3, 4, 5}, ) ]), MeshTest( 'tri1gap_test_4', 'tri1gap', 'tri1gap_result_4', [OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {3, 4}, )]), MeshTest('tri1gap_test_5', 'tri1gap', 'tri1gap_result_5', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {3, 4}, ) ]), # 50 MeshTest('tri1gap_test_6', 'tri1gap', 'tri1gap_result_6', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {3, 4}, ) ]), MeshTest( 'tri1gap_test_7', 'tri1gap', 'tri1gap_result_7', [OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {3, 5}, )]), MeshTest('tri1gap_test_8', 'tri1gap', 'tri1gap_result_8', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {3, 5}, ) ]), MeshTest('tri1gap_test_9', 'tri1gap', 'tri1gap_result_9', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {3, 5}, ) ]), MeshTest('tri1gap_test_10', 'tri1gap', 'tri1gap_result_10', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'affect': 'VERTICES' }, 'VERT', {3}, ) ]), # 55 MeshTest('tri2gaps_test_1', 'tri2gaps', 'tri2gaps_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {3, 4, 5}, ) ]), MeshTest('tri2gaps_test_2', 'tri2gaps', 'tri2gaps_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {3, 4, 5}, ) ]), MeshTest('tri2gaps_test_3', 'tri2gaps', 'tri2gaps_result_3', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {3, 4, 5}, ) ]), MeshTest( 'tri2gaps_test_4', 'tri2gaps', 'tri2gaps_result_4', [OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {3, 4}, )]), MeshTest('tri2gaps_test_5', 'tri2gaps', 'tri2gaps_result_5', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {3, 4}, ) ]), # 60 MeshTest('tri2gaps_test_6', 'tri2gaps', 'tri2gaps_result_6', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {3, 4}, ) ]), MeshTest('tri3gaps_test_1', 'tri3gaps', 'tri3gaps_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {3, 4, 5}, ) ]), MeshTest('tri3gaps_test_2', 'tri3gaps', 'tri3gaps_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {3, 4, 5}, ) ]), MeshTest('tri3gaps_test_3', 'tri3gaps', 'tri3gaps_result_3', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {3, 4, 5}, ) ]), MeshTest('cube3_test_1', 'cube3', 'cube3_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {32, 33, 34, 35, 24, 25, 26, 27, 28, 29, 30, 31}, ) ]), # 65 MeshTest('cube3_test_2', 'cube3', 'cube3_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {32, 33, 34, 35, 24, 25, 26, 27, 28, 29, 30, 31}, ) ]), MeshTest('cube3_test_3', 'cube3', 'cube3_result_3', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {32, 35}, ) ]), MeshTest('cube3_test_4', 'cube3', 'cube3_result_4', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {24, 35}, ) ]), MeshTest('cube3_test_5', 'cube3', 'cube3_result_5', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2 }, 'EDGE', {24, 32, 35}, ) ]), MeshTest('cube3_test_6', 'cube3', 'cube3_result_6', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {24, 32, 35}, ) ]), # 70 MeshTest('Tray', 'Tray', 'Tray_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.01, 'segments': 2 }, 'EDGE', {0, 1, 6, 7, 12, 14, 16, 17}, ) ]), MeshTest("test 73", 'Bumptop', 'Bumptop_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.1, 'segments': 4 }, 'EDGE', {33, 4, 38, 8, 41, 10, 42, 12, 14, 17, 24, 31}, ) ]), MeshTest('Multisegment_test_1', 'Multisegment_test', 'Multisegment_result_1', [ OperatorSpecEditMode( 'bevel', {'offset': 0.2}, 'EDGE', {16, 14, 15}, ) ]), MeshTest('Window_test', 'Window_test', 'Window_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.05, 'segments': 2 }, 'EDGE', {19, 20, 23, 15}, ) ]), # 75 MeshTest("test 77", 'Cube_hn_test', 'Cube_hn_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'harden_normals': True }, 'EDGE', {8}, ) ]), MeshTest('Blocksteps_test_1', 'Blocksteps_test', 'Blocksteps_result_1', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'miter_outer': 'PATCH' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Blocksteps_test_2', 'Blocksteps_test', 'Blocksteps_result_2', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2, 'miter_outer': 'PATCH' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Blocksteps_test_3', 'Blocksteps_test', 'Blocksteps_result_3', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3, 'miter_outer': 'PATCH' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Blocksteps_test_4', 'Blocksteps_test', 'Blocksteps_result_4', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'miter_outer': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), # 80 MeshTest('Blocksteps_test_5', 'Blocksteps_test', 'Blocksteps_result_5', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2, 'miter_outer': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Blocksteps_test_6', 'Blocksteps_test', 'Blocksteps_result_6', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3, 'miter_outer': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Blocksteps_test_7', 'Blocksteps_test', 'Blocksteps_result_7', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'miter_outer': 'PATCH', 'miter_inner': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest("Blocksteps_test_8", 'Blocksteps_test', 'Blocksteps_result_8', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2, 'miter_outer': 'PATCH', 'miter_inner': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Blocksteps2_test', 'Blocksteps2_test', 'Blocksteps2_result_9', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2, 'miter_outer': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), # 85 MeshTest('Blocksteps3_test', 'Blocksteps3_test', 'Blocksteps3_result_10', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2, 'miter_outer': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Blocksteps4_test_1', 'Blocksteps4_test', 'Blocksteps4_result_11', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 2, 'miter_outer': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Blocksteps4_test_2', 'Blocksteps4_test', 'Blocksteps4_result_12', [ OperatorSpecEditMode( 'bevel', { 'offset': 0.2, 'segments': 3, 'miter_outer': 'ARC' }, 'EDGE', {4, 7, 39, 27, 30, 31}, ) ]), MeshTest('Spike_test', 'Spike_test', 'Spike_result_1', [ OperatorSpecEditMode('bevel', { 'offset': 0.2, 'segments': 3 }, 'EDGE', {1, 7}) ]) ] operator_test = RunTest(tests) command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": operator_test.do_compare = True operator_test.run_all_tests() break elif cmd == "--run-test": name = command[i + 1] operator_test.do_compare = False operator_test.run_test(name) break