[Bf-blender-cvs] [22c61e80605] master: Tests: Disable tests for non-compiled libraries
Commit: 22c61e80605079141293c749de37cbe85bf2b33b Author: Himanshi Kalra Date: Wed Sep 29 21:12:55 2021 +0530 Branches: master https://developer.blender.org/rB22c61e80605079141293c749de37cbe85bf2b33b Tests: Disable tests for non-compiled libraries This diff disables tests for Boolean, subdivision surface and volume when GMP, Opensubdiv and Openvdb are not compiled respectively. It also changes the existing file structure and adds sub-folders for boolean and subdivison tests. The volume folder only has one test and is as unchanged structure-wise. Reviewed By: JacquesLucke, LazyDodo Differential Revision: https://developer.blender.org/D12448 === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 75f00c3c5cc..2b31b6362e9 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -749,10 +749,26 @@ set(geo_node_tests points utilities vector - volume - ) +if(WITH_GMP) + list(APPEND geo_node_tests mesh/boolean) +else() + MESSAGE(STATUS "Disabling mesh/boolean tests because WITH_GMP is off.") +endif() + +if(WITH_OPENVDB) + list(APPEND geo_node_tests volume) +else() + MESSAGE(STATUS "Disabling volume tests because WITH_OPENVDB is off.") +endif() + +if(WITH_OPENSUBDIV) + list(APPEND geo_node_tests mesh/subdivision_tests) +else() + MESSAGE(STATUS "Disabling mesh/subdivision_tests because WITH_OPENSUBDIV is off.") +endif() + foreach(geo_node_test ${geo_node_tests}) if(EXISTS "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/") file(GLOB files "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/*.blend") ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a866a32ff25] master: Tests: Updated test message for Directory Not Found
Commit: a866a32ff257fd9ff4d543adbddad283a189bbc6 Author: Himanshi Kalra Date: Wed Sep 15 23:04:47 2021 +0530 Branches: master https://developer.blender.org/rBa866a32ff257fd9ff4d543adbddad283a189bbc6 Tests: Updated test message for Directory Not Found === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 79632e49c1f..a1b94abc317 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -766,7 +766,7 @@ foreach(geo_node_test ${geo_node_tests}) ) endforeach() else() -MESSAGE(STATUS "No directory named ${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/ found, disabling test.") +MESSAGE(STATUS "Directory named ${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/ Not Found, disabling test.") endif() endforeach() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [30d3dd4de16] master: Added more Geometry Node tests
Commit: 30d3dd4de160cbebfd1143d188f937d170be50a6 Author: Himanshi Kalra Date: Tue Aug 24 13:22:01 2021 +0530 Branches: master https://developer.blender.org/rB30d3dd4de160cbebfd1143d188f937d170be50a6 Added more Geometry Node tests * Attributes * Utilities * Volume Test folder located in `lib\tests\modeling\geometry_nodes` It contains around 34 new tests. * attribute clamp + other attribute nodes * Curve Primitive nodes * Mesh Primitive nodes * delete geometry * convex hull * subdivision surface * boolean intersect * boolean diff * volume to mesh Reviewed By: zazizizou, JacquesLucke Differential Revision: https://developer.blender.org/D12250 === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 0f9665f0a95..79632e49c1f 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -741,10 +741,17 @@ if(WITH_COMPOSITOR) endif() set(geo_node_tests + attributes + curve_primitives curves geometry + mesh_primitives mesh points + utilities + vector + volume + ) foreach(geo_node_test ${geo_node_tests}) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [875c2ea5b5e] master: Using relative threshold for floats in mesh comparison
Commit: 875c2ea5b5ee8425c3bc969dbaba3fab3ecbaab4 Author: Himanshi Kalra Date: Tue Aug 24 00:49:36 2021 +0530 Branches: master https://developer.blender.org/rB875c2ea5b5ee8425c3bc969dbaba3fab3ecbaab4 Using relative threshold for floats in mesh comparison Changes the threshold comparison from absolute to relative. Removes threshold for MLoopCol comparison. Adds a compare relative threshold function. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12273 === M source/blender/blenkernel/intern/mesh.c M source/blender/blenlib/BLI_math_base.h M source/blender/blenlib/intern/math_base_inline.c === diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index eb8e6aad736..e3650e03c8a 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -466,8 +466,10 @@ static int customdata_compare( int vtot = m1->totvert; for (j = 0; j < vtot; j++, v1++, v2++) { -if (len_squared_v3v3(v1->co, v2->co) > thresh_sq) { - return MESHCMP_VERTCOMISMATCH; +for (int k = 0; k < 3; k++) { + if (compare_threshold_relative(v1->co[k], v2->co[k], thresh)) { +return MESHCMP_VERTCOMISMATCH; + } } /* I don't care about normals, let's just do coordinates. */ } @@ -547,8 +549,7 @@ static int customdata_compare( int ltot = m1->totloop; for (j = 0; j < ltot; j++, lp1++, lp2++) { -if (abs(lp1->r - lp2->r) > thresh || abs(lp1->g - lp2->g) > thresh || -abs(lp1->b - lp2->b) > thresh || abs(lp1->a - lp2->a) > thresh) { +if (lp1->r != lp2->r || lp1->g != lp2->g || lp1->b != lp2->b || lp1->a != lp2->a) { return MESHCMP_LOOPCOLMISMATCH; } } @@ -583,7 +584,7 @@ static int customdata_compare( const float *l2_data = l2->data; for (int i = 0; i < total_length; i++) { -if (fabsf(l1_data[i] - l2_data[i]) > thresh) { +if (compare_threshold_relative(l1_data[i], l2_data[i], thresh)) { return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; } } @@ -594,7 +595,10 @@ static int customdata_compare( const float(*l2_data)[2] = l2->data; for (int i = 0; i < total_length; i++) { -if (len_squared_v2v2(l1_data[i], l2_data[i]) > thresh_sq) { +if (compare_threshold_relative(l1_data[i][0], l2_data[i][0], thresh)) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} +if (compare_threshold_relative(l1_data[i][1], l2_data[i][1], thresh)) { return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; } } @@ -605,7 +609,13 @@ static int customdata_compare( const float(*l2_data)[3] = l2->data; for (int i = 0; i < total_length; i++) { -if (len_squared_v3v3(l1_data[i], l2_data[i]) > thresh_sq) { +if (compare_threshold_relative(l1_data[i][0], l2_data[i][0], thresh)) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} +if (compare_threshold_relative(l1_data[i][1], l2_data[i][1], thresh)) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} +if (compare_threshold_relative(l1_data[i][2], l2_data[i][2], thresh)) { return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; } } @@ -639,7 +649,7 @@ static int customdata_compare( for (int i = 0; i < total_length; i++) { for (j = 0; j < 4; j++) { - if (fabsf(l1_data[i].color[j] - l2_data[i].color[j]) > thresh) { + if (compare_threshold_relative(l1_data[i].color[j], l2_data[i].color[j], thresh)) { return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; } } diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index dbdd28766a5..9b54f780296 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -172,6 +172,9 @@ MINLINE size_t clamp_z(size_t value, size_t min, size_t max); MINLINE int compare_ff(float a, float b, const float max_diff); MINLINE int compare_ff_relative(float a, float b, const float max_diff, const int max_ulps); +MINLINE bool compare_threshold_relative(const float value1, +const float value2, +const float thresh); MINLINE float signf(float f); MINLINE int signum_i_ex(float a, float eps); diff --git a/source/blender/blenlib/intern/math_base_i
[Bf-blender-cvs] [c48a01a88ad] master: Add cutom data color property for mesh comparison
Commit: c48a01a88add5247f08de6f8af8d223ebc4e28c9 Author: Himanshi Kalra Date: Mon Aug 16 12:17:30 2021 +0530 Branches: master https://developer.blender.org/rBc48a01a88add5247f08de6f8af8d223ebc4e28c9 Add cutom data color property for mesh comparison Add color data type comparison for meshes, adding it as part of comparing meshes with geometry nodes applied. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12192 === M source/blender/blenkernel/intern/mesh.c === diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index b32d58de1e2..b1292a1c94d 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -638,6 +638,19 @@ static int customdata_compare( } break; } +case CD_PROP_COLOR: { + const MPropCol *l1_data = l1->data; + const MPropCol *l2_data = l2->data; + + for (int i = 0; i < total_length; i++) { +for (int j = 0; j < 4; j++) { + if (fabsf(l1_data[i].color[j] - l2_data[i].color[j]) > thresh) { +return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; + } +} + } + break; +} default: { break; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e38de11f057] master: Refactor: Custom data comparison in meshes
Commit: e38de11f05710e08bab39019a9a1c28c24c703a8 Author: Himanshi Kalra Date: Tue Aug 10 19:16:36 2021 +0530 Branches: master https://developer.blender.org/rBe38de11f05710e08bab39019a9a1c28c24c703a8 Refactor: Custom data comparison in meshes Added the comparison of non-generic attributes with generic attributes in the same loop to avoid issues with different order in layer->types of the two meshes. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12149 === M source/blender/blenkernel/intern/mesh.c === diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 088026ef945..b04988a8035 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1,4 +1,4 @@ -/* +/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -430,57 +430,159 @@ static int customdata_compare( { const float thresh_sq = thresh * thresh; CustomDataLayer *l1, *l2; - int i1 = 0, i2 = 0, tot, j; + int layer_count1 = 0, layer_count2 = 0, j; + const uint64_t cd_mask_non_generic = CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MPOLY | + CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MDEFORMVERT; + const uint64_t cd_mask_all_attr = CD_MASK_PROP_ALL | cd_mask_non_generic; for (int i = 0; i < c1->totlayer; i++) { -if (ELEM(c1->layers[i].type, - CD_MVERT, - CD_MEDGE, - CD_MPOLY, - CD_MLOOPUV, - CD_MLOOPCOL, - CD_MDEFORMVERT)) { - i1++; +if (CD_TYPE_AS_MASK(c1->layers[i].type) & cd_mask_all_attr) { + layer_count1++; } } for (int i = 0; i < c2->totlayer; i++) { -if (ELEM(c2->layers[i].type, - CD_MVERT, - CD_MEDGE, - CD_MPOLY, - CD_MLOOPUV, - CD_MLOOPCOL, - CD_MDEFORMVERT)) { - i2++; +if (CD_TYPE_AS_MASK(c2->layers[i].type) & cd_mask_all_attr) { + layer_count2++; } } - if (i1 != i2) { + if (layer_count1 != layer_count2) { return MESHCMP_CDLAYERS_MISMATCH; } l1 = c1->layers; l2 = c2->layers; - for (i1 = 0; i1 < c1->totlayer; i1++) { + for (int i1 = 0; i1 < c1->totlayer; i1++) { l1 = c1->layers + i1; -if ((CD_TYPE_AS_MASK(l1->type) & CD_MASK_PROP_ALL) == 0) { - /* Skip non generic attribute layers. */ - continue; -} - -bool found_corresponding_layer = false; -for (i2 = 0; i2 < c2->totlayer; i2++) { +for (int i2 = 0; i2 < c2->totlayer; i2++) { l2 = c2->layers + i2; if (l1->type != l2->type || !STREQ(l1->name, l2->name)) { continue; } - found_corresponding_layer = true; /* At this point `l1` and `l2` have the same name and type, so they should be compared. */ switch (l1->type) { +case CD_MVERT: { + MVert *v1 = l1->data; + MVert *v2 = l2->data; + int vtot = m1->totvert; + + for (j = 0; j < vtot; j++, v1++, v2++) { +if (len_squared_v3v3(v1->co, v2->co) > thresh_sq) { + return MESHCMP_VERTCOMISMATCH; +} +/* I don't care about normals, let's just do coordinates. */ + } + break; +} + +/* We're order-agnostic for edges here. */ +case CD_MEDGE: { + MEdge *e1 = l1->data; + MEdge *e2 = l2->data; + int etot = m1->totedge; + EdgeHash *eh = BLI_edgehash_new_ex(__func__, etot); + + for (j = 0; j < etot; j++, e1++) { +BLI_edgehash_insert(eh, e1->v1, e1->v2, e1); + } + + for (j = 0; j < etot; j++, e2++) { +if (!BLI_edgehash_lookup(eh, e2->v1, e2->v2)) { + return MESHCMP_EDGEUNKNOWN; +} + } + BLI_edgehash_free(eh, NULL); + break; +} +case CD_MPOLY: { + MPoly *p1 = l1->data; + MPoly *p2 = l2->data; + int ptot = m1->totpoly; + + for (j = 0; j < ptot; j++, p1++, p2++) { +MLoop *lp1, *lp2; +int k; + +if (p1->totloop != p2->totloop) { + return MESHCMP_POLYMISMATCH; +} + +lp1 = m1->mloop + p1->loopstart; +lp2 = m2->mloop + p2->loopstart; + +for (k = 0; k < p1->totloop; k++, lp1++, lp2++) { + if (lp1->v != lp2->v) { +return MESHCMP_POLYVERTMISMATCH; + } +} + } +
[Bf-blender-cvs] [92edf37997c] master: Add custom data comparison for generic attributes
Commit: 92edf37997c25444fc2628c8057a87b7e87c5eff Author: Himanshi Kalra Date: Fri Aug 6 00:03:16 2021 +0530 Branches: master https://developer.blender.org/rB92edf37997c25444fc2628c8057a87b7e87c5eff Add custom data comparison for generic attributes Generic attributes CD_PROP_* comparison is added in customdata_compare Checks for built-in as well as user created attributes. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12137 === M source/blender/blenkernel/intern/mesh.c === diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 8d74002ad79..b00670aad4c 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -389,6 +389,7 @@ enum { MESHCMP_EDGEUNKNOWN, MESHCMP_VERTCOMISMATCH, MESHCMP_CDLAYERS_MISMATCH, + MESHCMP_ATTRIBUTE_VALUE_MISMATCH, }; static const char *cmpcode_to_str(int code) @@ -416,6 +417,8 @@ static const char *cmpcode_to_str(int code) return "Vertex Coordinate Mismatch"; case MESHCMP_CDLAYERS_MISMATCH: return "CustomData Layer Count Mismatch"; +case MESHCMP_ATTRIBUTE_VALUE_MISMATCH: + return "Attribute Value Mismatch"; default: return "Mesh Comparison Code Unknown"; } @@ -423,13 +426,13 @@ static const char *cmpcode_to_str(int code) /** Thresh is threshold for comparing vertices, UV's, vertex colors, weights, etc. */ static int customdata_compare( -CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2, const float thresh) +CustomData *c1, CustomData *c2, const int total_length, Mesh *m1, Mesh *m2, const float thresh) { const float thresh_sq = thresh * thresh; CustomDataLayer *l1, *l2; - int i, i1 = 0, i2 = 0, tot, j; + int i1 = 0, i2 = 0, tot, j; - for (i = 0; i < c1->totlayer; i++) { + for (int i = 0; i < c1->totlayer; i++) { if (ELEM(c1->layers[i].type, CD_MVERT, CD_MEDGE, @@ -441,7 +444,7 @@ static int customdata_compare( } } - for (i = 0; i < c2->totlayer; i++) { + for (int i = 0; i < c2->totlayer; i++) { if (ELEM(c2->layers[i].type, CD_MVERT, CD_MEDGE, @@ -457,12 +460,86 @@ static int customdata_compare( return MESHCMP_CDLAYERS_MISMATCH; } + l1 = c1->layers; + l2 = c2->layers; + + for (i1 = 0; i1 < c1->totlayer; i1++) { +l1 = c1->layers + i1; +if ((CD_TYPE_AS_MASK(l1->type) & CD_MASK_PROP_ALL) == 0) { + /* Skip non generic attribute layers. */ + continue; +} + +bool found_corresponding_layer = false; +for (i2 = 0; i2 < c2->totlayer; i2++) { + l2 = c2->layers + i2; + if (l1->type != l2->type || !STREQ(l1->name, l2->name)) { +continue; + } + found_corresponding_layer = true; + /* At this point `l1` and `l2` have the same name and type, so they should be compared. */ + + switch (l1->type) { + +case CD_PROP_FLOAT: { + const float *l1_data = l1->data; + const float *l2_data = l2->data; + + for (int i = 0; i < total_length; i++) { +if (fabsf(l1_data[i] - l2_data[i]) > thresh) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} + } + break; +} +case CD_PROP_FLOAT2: { + const float(*l1_data)[2] = l1->data; + const float(*l2_data)[2] = l2->data; + + for (int i = 0; i < total_length; i++) { +if (len_squared_v2v2(l1_data[i], l2_data[i]) > thresh_sq) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} + } + break; +} +case CD_PROP_FLOAT3: { + const float(*l1_data)[3] = l1->data; + const float(*l2_data)[3] = l2->data; + + for (int i = 0; i < total_length; i++) { +if (len_squared_v3v3(l1_data[i], l2_data[i]) > thresh_sq) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} + } + break; +} +default: { + int element_size = CustomData_sizeof(l1->type); + for (int i = 0; i < total_length; i++) { +int offset = element_size * i; +if (!CustomData_data_equals(l1->type, +POINTER_OFFSET(l1->data, offset), +POINTER_OFFSET(l2->data, offset))) { + return MESHCMP_ATTRIBUTE_VALUE_MISMATCH; +} + } + break; +} + } +} + +if (!found_corresponding_layer) { + return MESHCMP_CDLAYERS_MISMATCH; +} + } + l1 = c1->layers; l2 = c2->layers; tot = i1; i1 = 0; i2 = 0; -
[Bf-blender-cvs] [4a02b9ffeb0] master: Regression Testing: Running tests based on blend files
Commit: 4a02b9ffeb018ced11768ca99935fda5fa5f7da0 Author: Himanshi Kalra Date: Tue Jul 27 21:00:28 2021 +0530 Branches: master https://developer.blender.org/rB4a02b9ffeb018ced11768ca99935fda5fa5f7da0 Regression Testing: Running tests based on blend files Runs tests based on blend files with minimum python interaction. Developed as part of GSoC 2021 - Regression Testing of Geometry Nodes. Earlier, tests were built from scratch by adding a modifier/operation from the Python API. Now, tests can also be created inside blender and are compared using Python script. Features: Automatically adding expected object if it doesn't exist. This patch adds tests for the following Geometry Nodes category: * Curves * Geometry * Mesh * Points The implemented UML diagram for refactoring of mesh test framework. {F10225906} Technical Changes: SpecMeshTest: It adds the modifier/operation based on the Spec provided. BlendFileTest: It applies already existing modifier/operation from the blend file. Test folders hierarchy with tests. This folder should be extracted to `lib\tests\modeling` {F10240651} Note: The `geometry_nodes` folder might lie under another `geometry_nodes` folder while extracting, please double check. Use the inner-most one. The hierarchy should be: -`lib\tests\modeling\geometry_nodes\mesh` -`lib\tests\modeling\geometry_nodes\points` and so on. * From `ctest` the tests should be run as `ctest -R geo_node -C [Configuration]` on Windows. * Each single test can be run with its entire name e..g `ctest -R geo_node_geometry_join_geometry`.(just an example). Run `ctest -N -R geo_node` to see all tests. * From blender, the tests can be run `blender -b path\to\blend\file --python path\to\geo_node_test.py` Reviewed By: zazizizou, JacquesLucke Differential Revision: https://developer.blender.org/D11611 === M tests/python/CMakeLists.txt M tests/python/bevel_operator.py M tests/python/boolean_operator.py M tests/python/curve_to_mesh.py M tests/python/deform_modifiers.py A tests/python/geo_node_test.py M tests/python/modifiers.py M tests/python/modules/mesh_test.py M tests/python/operators.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/CMakeLists.txt b/tests/python/CMakeLists.txt index 92cebb7d274..0f9665f0a95 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -740,6 +740,29 @@ if(WITH_COMPOSITOR) endif() +set(geo_node_tests + curves + geometry + mesh + points +) + +foreach(geo_node_test ${geo_node_tests}) + if(EXISTS "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/") +file(GLOB files "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/*.blend") +foreach(file ${files}) + get_filename_component(filename ${file} NAME_WE) + add_blender_test( +geo_node_${geo_node_test}_test_${filename} +${file} +--python ${TEST_PYTHON_DIR}/geo_node_test.py + ) + endforeach() + else() +MESSAGE(STATUS "No directory named ${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/ found, disabling test.") + endif() +endforeach() + if(WITH_OPENGL_DRAW_TESTS) if(NOT OPENIMAGEIO_IDIFF) MESSAGE(STATUS "Disabling OpenGL draw tests because OIIO idiff does not exist") diff --git a/tests/python/bevel_operator.py b/tests/python/bevel_operator.py index c732d437b57..726bf4b5b03 100644 --- a/tests/python/bevel_operator.py +++ b/tests/python/bevel_operator.py @@ -27,272 +27,272 @@ import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import MeshTest, OperatorSpecEditMode, RunTest +from modules.mesh_test import SpecMeshTest, OperatorSpecEditMode, RunTest def main(): tests = [ # 0 -MeshTest('Cube_test_1', 'Cube_test', 'Cube_result_1', +SpecMeshTest('Cube_test_1', 'Cube_test', 'Cube_result_1', [OperatorSpecEditMode('bevel', {'offset': 0.2}, 'EDGE', {10})]), -MeshTest('Cube_test_2', 'Cube_test', 'Cube_result_2', +SpecMeshTest('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', +SpecMeshTest('Cube_test_3', 'Cube_test', 'Cube_result_3', [OperatorSpecEditMode('bevel', {'offset': 0.2, 'offset_type': 'DEPTH'}, 'EDGE', {8, 10,
[Bf-blender-cvs] [dff47e3b94d] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: dff47e3b94dace457670926c7fb9e6ae3401d297 Author: Himanshi Kalra Date: Tue Jul 27 00:59:28 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBdff47e3b94dace457670926c7fb9e6ae3401d297 Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fd32fe6b02f] soc-2021-geometry-nodes-regression-test: Updating cmake error messsage
Commit: fd32fe6b02f68662cfe04ea9cbaf86187dbf77a4 Author: Himanshi Kalra Date: Mon Jul 26 21:30:59 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBfd32fe6b02f68662cfe04ea9cbaf86187dbf77a4 Updating cmake error messsage === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 49909050ec4..0f9665f0a95 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -759,7 +759,7 @@ foreach(geo_node_test ${geo_node_tests}) ) endforeach() else() -MESSAGE(STATUS "No directory called ${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/ found!") +MESSAGE(STATUS "No directory named ${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/ found, disabling test.") endif() endforeach() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0708e605d56] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: 0708e605d569e119ee18546d2658f34ed82fe999 Author: Himanshi Kalra Date: Mon Jul 26 18:05:39 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB0708e605d569e119ee18546d2658f34ed82fe999 Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5fc1779b653] soc-2021-geometry-nodes-regression-test: CMake: Add directory exists check
Commit: 5fc1779b653fefa17ba8dbcf12c68f788004062e Author: Himanshi Kalra Date: Mon Jul 26 17:45:52 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB5fc1779b653fefa17ba8dbcf12c68f788004062e CMake: Add directory exists check === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 1d96968b9b3..49909050ec4 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -748,16 +748,19 @@ set(geo_node_tests ) foreach(geo_node_test ${geo_node_tests}) - - file(GLOB files "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/*.blend") - foreach(file ${files}) -get_filename_component(filename ${file} NAME_WE) -add_blender_test( - geo_node_${geo_node_test}_test_${filename} - ${file} - --python ${TEST_PYTHON_DIR}/geo_node_test.py -) -endforeach() + if(EXISTS "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/") +file(GLOB files "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/*.blend") +foreach(file ${files}) + get_filename_component(filename ${file} NAME_WE) + add_blender_test( +geo_node_${geo_node_test}_test_${filename} +${file} +--python ${TEST_PYTHON_DIR}/geo_node_test.py + ) + endforeach() + else() +MESSAGE(STATUS "No directory called ${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/ found!") + endif() endforeach() if(WITH_OPENGL_DRAW_TESTS) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b8f3df98179] soc-2021-geometry-nodes-regression-test: Add curve tests
Commit: b8f3df9817970e615fd9fadb90cb26e73dc8374f Author: Himanshi Kalra Date: Wed Jul 21 21:35:59 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBb8f3df9817970e615fd9fadb90cb26e73dc8374f Add curve tests === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 0c1595775ba..1d96968b9b3 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -741,6 +741,7 @@ if(WITH_COMPOSITOR) endif() set(geo_node_tests + curves geometry mesh points ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [60a0928f355] blender-v2.93-release: Fix T85517: Cannot type Space while holding Shift key in text-field like spaces.
Commit: 60a0928f3559f72c8c4b686417ba01004ff996ec Author: Himanshi Kalra Date: Mon Jul 26 09:08:38 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rB60a0928f3559f72c8c4b686417ba01004ff996ec Fix T85517: Cannot type Space while holding Shift key in text-field like spaces. Fix for T85517 Bug: Couldn't type space while holding down the shift key in text spaces (e.g. when saving a file, changing the name of object). Changes: Removing the key combination of Shift + space in `WM_event_is_ime_switch` method. Reviewed By: harley, mont29 Maniphest Tasks: T85517 Differential Revision: https://developer.blender.org/D10452 === M source/blender/windowmanager/intern/wm_event_query.c === diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c index 3efff20f107..b95bd49c750 100644 --- a/source/blender/windowmanager/intern/wm_event_query.c +++ b/source/blender/windowmanager/intern/wm_event_query.c @@ -486,7 +486,7 @@ int WM_event_absolute_delta_y(const struct wmEvent *event) bool WM_event_is_ime_switch(const struct wmEvent *event) { return event->val == KM_PRESS && event->type == EVT_SPACEKEY && - (event->ctrl || event->oskey || event->shift || event->alt); + (event->ctrl || event->oskey || event->alt); } #endif ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6abf63f463c] master: Fix T85517: Cannot type Space while holding Shift key in text-field like spaces.
Commit: 6abf63f463cf124eaeb894c7d728550fca54a239 Author: Himanshi Kalra Date: Mon Jul 26 09:08:38 2021 +0200 Branches: master https://developer.blender.org/rB6abf63f463cf124eaeb894c7d728550fca54a239 Fix T85517: Cannot type Space while holding Shift key in text-field like spaces. Fix for T85517 Bug: Couldn't type space while holding down the shift key in text spaces (e.g. when saving a file, changing the name of object). Changes: Removing the key combination of Shift + space in `WM_event_is_ime_switch` method. Reviewed By: harley, mont29 Maniphest Tasks: T85517 Differential Revision: https://developer.blender.org/D10452 === M source/blender/windowmanager/intern/wm_event_query.c === diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c index 006dc220a56..381284e0d7e 100644 --- a/source/blender/windowmanager/intern/wm_event_query.c +++ b/source/blender/windowmanager/intern/wm_event_query.c @@ -491,7 +491,7 @@ int WM_event_absolute_delta_y(const struct wmEvent *event) bool WM_event_is_ime_switch(const struct wmEvent *event) { return event->val == KM_PRESS && event->type == EVT_SPACEKEY && - (event->ctrl || event->oskey || event->shift || event->alt); + (event->ctrl || event->oskey || event->alt); } #endif ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c54b53fa14e] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: c54b53fa14e60a5dc8dd4d4f0694f4df99d2e0f2 Author: Himanshi Kalra Date: Wed Jul 21 01:42:56 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBc54b53fa14e60a5dc8dd4d4f0694f4df99d2e0f2 Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ad3afa02af6] soc-2021-geometry-nodes-regression-test: Minor Fix: create_evaluated_object method changed return type fix
Commit: ad3afa02af6b6901539e747225e299386f9c37ec Author: Himanshi Kalra Date: Wed Jul 21 20:48:00 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBad3afa02af6b6901539e747225e299386f9c37ec Minor Fix: create_evaluated_object method changed return type fix === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 78da41f4dee..4cf545d3292 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -207,8 +207,8 @@ class MeshTest(ABC): """ if self.verbose: print("Creating expected object...") -evaluated_object = self.create_evaluated_object() -self.expected_object = evaluated_object +self.create_evaluated_object() +self.expected_object = self.evaluated_object self.expected_object.name = self.exp_object_name x, y, z = self.test_object.location self.expected_object.location = (x, y+10, z) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [25e388c8b12] soc-2021-geometry-nodes-regression-test: Addressed comments by Habib
Commit: 25e388c8b120ef269a0b6e064c5a72b504f1657e Author: Himanshi Kalra Date: Tue Jul 20 15:06:44 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB25e388c8b120ef269a0b6e064c5a72b504f1657e Addressed comments by Habib === M tests/python/geo_node_test.py M tests/python/modules/mesh_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index 6d6f5cc2963..fa87fb23bee 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -30,4 +30,4 @@ result = geo_node_test.run_test() # Telling `ctest` about the failed test by raising Exception. if result == False: -raise Exception("Failed {}".format(geo_node_test.test_name)) \ No newline at end of file +raise Exception("Failed {}".format(geo_node_test.test_name)) diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index b03a865cf7b..78da41f4dee 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -205,7 +205,8 @@ class MeshTest(ABC): Creates an expected object 10 units away in Y direction from test object. """ -print("Creating expected object...") +if self.verbose: +print("Creating expected object...") evaluated_object = self.create_evaluated_object() self.expected_object = evaluated_object self.expected_object.name = self.exp_object_name @@ -245,7 +246,7 @@ class MeshTest(ABC): """ self.create_evaluated_object() -self.apply_operations(self.evaluated_object) +self.apply_operations(self.evaluated_object.name) if not self.do_compare: print("\nVisualization purpose only: Open Blender in GUI mode") @@ -333,7 +334,9 @@ class MeshTest(ABC): items[index].select = True def update_failed_test(self): -# Update expected object. +""" +Updates expected object. +""" self.evaluated_object.location = self.expected_object.location expected_object_name = self.expected_object.name evaluated_selection = { @@ -402,13 +405,18 @@ class MeshTest(ABC): return result_codes @abstractmethod -def apply_operations(self, any_object): +def apply_operations(self, object_name): +""" +Apply operations on this object. + +object_name (str): Name of the test object on which operations will be applied. +""" pass class SpecMeshTest(MeshTest): """ -A mesh testing inherited from MeshTest class targeted at testing modifiers and operators on a single object. +A mesh testing class inherited from MeshTest class targeted at testing modifiers and operators on a single object. It holds a stack of mesh operations, i.e. modifiers or operators. The test is executed using MeshTest's run_test. """ @@ -429,7 +437,6 @@ class SpecMeshTest(MeshTest): :param apply_modifier: bool - True if we want to apply the modifiers right after adding them to the object. - True if we want to apply the modifier to list of modifiers, after some operation. This affects operations of type ModifierSpec and DeformModifierSpec. -:param do_compare: bool - True if we want to compare the test and expected objects, False otherwise. """ super().__init__(test_object_name, exp_object_name, test_name, threshold) @@ -440,9 +447,12 @@ class SpecMeshTest(MeshTest): self.operations_stack = operations_stack self.apply_modifier = apply_modifier -def apply_operations(self, evaluated_test_object): +def apply_operations(self, evaluated_test_object_name): # Add modifiers and operators. -print("Applying operations...") +SpecMeshTest.apply_operations.__doc__ = MeshTest.apply_operations.__doc__ +evaluated_test_object = bpy.data.objects[evaluated_test_object_name] +if self.verbose: +print("Applying operations...") for operation in self.operations_stack: if isinstance(operation, ModifierSpec): self._add_modifier(evaluated_test_object, operation) @@ -701,11 +711,13 @@ class BlendFileTest(MeshTest): blend file i.e. without adding them from scratch or without adding specifications. """ -def apply_operations(self, evaluated_test_object): -""" -Apply all modifiers added to the current object. -"""
[Bf-blender-cvs] [8e41ce4959b] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: 8e41ce4959b23239875b8c21c5fdf19c524da42b Author: Himanshi Kalra Date: Tue Jul 20 15:28:50 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB8e41ce4959b23239875b8c21c5fdf19c524da42b Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5040638dbf9] soc-2021-geometry-nodes-regression-test: Updated the path for geometry_nodes folder
Commit: 5040638dbf9c9f004fbe21226ee7c83c9ba7ee34 Author: Himanshi Kalra Date: Fri Jul 16 17:59:14 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB5040638dbf9c9f004fbe21226ee7c83c9ba7ee34 Updated the path for geometry_nodes folder === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index aa797297b26..0c1595775ba 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -748,7 +748,7 @@ set(geo_node_tests foreach(geo_node_test ${geo_node_tests}) - file(GLOB files "${TEST_SRC_DIR}/geometry_nodes/${geo_node_test}/*.blend") + file(GLOB files "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/*.blend") foreach(file ${files}) get_filename_component(filename ${file} NAME_WE) add_blender_test( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [af0743c47db] soc-2021-geometry-nodes-regression-test: Polishing script: WIP
Commit: af0743c47db0138b627da7fd582234cf73f102fc Author: Himanshi Kalra Date: Fri Jul 16 17:20:38 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBaf0743c47db0138b627da7fd582234cf73f102fc Polishing script: WIP === M tests/python/geo_node_test.py M tests/python/modules/mesh_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index 5ad86b41329..09988cd3d51 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -23,7 +23,11 @@ import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import BlendFileTest +from modules.mesh_test import BlendFileTest, RunTest -geo_node_test = BlendFileTest("test_object", "expected_object") -geo_node_test.run_test() \ No newline at end of file +geo_test = BlendFileTest("test_object", "expected_object") +result = geo_test.run_test() + +# Telling `ctest` that the test failed by raising Exception. +if result == False: +raise Exception("Failed {}".format(geo_test.test_name)) \ No newline at end of file diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 74e7c127193..2816c4f192d 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -167,13 +167,14 @@ class MeshTest(ABC): A mesh testing Abstract class that hold common functionalities for testting operations. """ -def __init__(self, test_object_name, exp_object_name, test_name=None, threshold=None): +def __init__(self, test_object_name, exp_object_name, test_name=None, threshold=None, do_compare=True): """ :param test_object_name: str - Name of object of mesh type to run the operations on. :param exp_object_name: str - Name of object of mesh type that has the expected geometry after running the operations. :param test_name: str - Name of the test. :param threshold: exponent: To allow variations and accept difference to a certain degree. +:param do_compare: bool - True if we want to compare the test and expected objects, False otherwise. """ self.test_object_name = test_object_name self.exp_object_name = exp_object_name @@ -183,10 +184,12 @@ class MeshTest(ABC): filepath = bpy.data.filepath self.test_name = bpy.path.display_name_from_filepath(filepath) self.threshold = threshold +self.do_compare = do_compare self.update = os.getenv("BLENDER_TEST_UPDATE") is not None self.verbose = os.getenv("BLENDER_VERBOSE") is not None self.test_updated_counter = 0 objects = bpy.data.objects +self.evaluated_object = None self.test_object = objects[self.test_object_name] if self.update: @@ -223,9 +226,8 @@ class MeshTest(ABC): self.test_object.select_set(True) bpy.ops.object.duplicate() -evaluated_test_object = bpy.context.active_object -evaluated_test_object.name = "evaluated_object" -return evaluated_test_object +self.evaluated_object = bpy.context.active_object +self.evaluated_object.name = "evaluated_object" @staticmethod def _print_result(result): @@ -241,11 +243,16 @@ class MeshTest(ABC): """ Runs a single test, runs it again if test file is updated. """ -evaluated_test_object = self.create_evaluated_object() -self.apply_operations(evaluated_test_object) -result = self.compare_meshes(evaluated_test_object, self.expected_object, self.threshold) -comparison_result, selection_result, validation_result = result +self.create_evaluated_object() +self.apply_operations(self.evaluated_object) + +if not self.do_compare: +print("\nVisualization purpose only: Open Blender in GUI mode") +print("Compare evaluated and expected object in Blender.\n") +return False + +result = self.compare_meshes(self.evaluated_object, self.expected_object, self.threshold) # Initializing with True to get correct resultant of result_code booleans. success = True @@ -270,7 +277,7 @@ class MeshTest(ABC): elif self.update: self.print_failed_test_result(result) -self.update_failed_test(evaluated_test_object) +self.update_failed_test() # Check for testing the blend file is updated and re-running. # Also safety check to avoid infinite recursion loop. if self.test_updated_co
[Bf-blender-cvs] [53fc2ca51fd] soc-2021-geometry-nodes-regression-test: Polishing script, checking for verbose use cases
Commit: 53fc2ca51fd3777b5b4249a754244ead582ae7cf Author: Himanshi Kalra Date: Fri Jul 16 17:38:54 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB53fc2ca51fd3777b5b4249a754244ead582ae7cf Polishing script, checking for verbose use cases === M tests/python/geo_node_test.py M tests/python/modules/mesh_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index 09988cd3d51..6d6f5cc2963 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -23,11 +23,11 @@ import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import BlendFileTest, RunTest +from modules.mesh_test import BlendFileTest -geo_test = BlendFileTest("test_object", "expected_object") -result = geo_test.run_test() +geo_node_test = BlendFileTest("test_object", "expected_object") +result = geo_node_test.run_test() -# Telling `ctest` that the test failed by raising Exception. +# Telling `ctest` about the failed test by raising Exception. if result == False: -raise Exception("Failed {}".format(geo_test.test_name)) \ No newline at end of file +raise Exception("Failed {}".format(geo_node_test.test_name)) \ No newline at end of file diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 2816c4f192d..b03a865cf7b 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -281,6 +281,7 @@ class MeshTest(ABC): # Check for testing the blend file is updated and re-running. # Also safety check to avoid infinite recursion loop. if self.test_updated_counter == 1: +print("Re-running test...") self.run_test() else: print("The test fails consistently. Exiting...") ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d066f16a6c9] soc-2021-geometry-nodes-regression-test: Updated based on review by Habib Gahbiche
Commit: d066f16a6c9884f6349b410cccf067547658cc2d Author: Himanshi Kalra Date: Tue Jul 13 13:34:45 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBd066f16a6c9884f6349b410cccf067547658cc2d Updated based on review by Habib Gahbiche === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 1bd12c9d77b..74e7c127193 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -232,10 +232,9 @@ class MeshTest(ABC): """ Prints the comparison, selection and validation result. """ -comparison_result, selection_result, validation_result = result -print("Mesh Comparison: {}".format(comparison_result)) -print("Selection Result: {}".format(selection_result)) -print("Mesh Validation: {}".format(validation_result)) +print("Results:") +for key in result: +print("{} : {}".format(key, result[key][1])) print() def run_test(self): @@ -244,12 +243,24 @@ class MeshTest(ABC): """ evaluated_test_object = self.create_evaluated_object() self.apply_operations(evaluated_test_object) -result = self.compare_meshes(evaluated_test_object) +result = self.compare_meshes(evaluated_test_object, self.expected_object, self.threshold) comparison_result, selection_result, validation_result = result -if comparison_result == "Same" and selection_result == "Same" and validation_result == "Valid": -self.passed_test(result) +# Initializing with True to get correct resultant of result_code booleans. +success = True +inside_loop_flag = False +for key in result: +inside_loop_flag = True +success = success and result[key][0] + +# Check "success" is actually evaluated and is not the default True value. +if not inside_loop_flag: +success = False + + +if success: +self.print_passed_test_result(result) # Clean up. if self.verbose: print("Cleaning up...") @@ -258,32 +269,37 @@ class MeshTest(ABC): return True elif self.update: -self.failed_test(result) +self.print_failed_test_result(result) self.update_failed_test(evaluated_test_object) # Check for testing the blend file is updated and re-running. # Also safety check to avoid infinite recursion loop. if self.test_updated_counter == 1: self.run_test() -return True else: print("The test fails consistently. Exiting...") return False else: -self.failed_test(result) +self.print_failed_test_result(result) return False -def failed_test(self, result): +def print_failed_test_result(self, result): +""" +Print results for failed test. +""" print("\nFAILED {} test with the following: ".format(self.test_name)) self._print_result(result) -def passed_test(self, result): +def print_passed_test_result(self, result): +""" +Print results for passing test. +""" print("\nPASSED {} test successfully.".format(self.test_name)) self._print_result(result) def do_selection(self, mesh: bpy.types.Mesh, select_mode: str, selection: set): """ -Do selection on a mesh +Do selection on a mesh. :param mesh: bpy.types.Mesh - input mesh :param: select_mode: str - selection mode. Must be 'VERT', 'EDGE' or 'FACE' :param: selection: set - indices of selection. @@ -325,20 +341,32 @@ class MeshTest(ABC): self.test_updated_counter += 1 self.expected_object = evaluated_test_object -def compare_meshes(self, evaluated_object): +@staticmethod +def compare_meshes(evaluated_object, expected_object, threshold): +""" +Compares evaluated object mesh with expected object mesh. +:param evaluated_object: first object for comparison. +:param expected_object: second object for comparison. +:param threshold: exponent: To allow variations and accept difference to a certain degree. +:return: dict: Contains results of different comparisons. +""" objects = bpy.data.objects evaluate
[Bf-blender-cvs] [3d18b2d9f7c] soc-2021-geometry-nodes-regression-test: Renaming: From MeshTest to SpecMeshTest curve_to_mesh tests
Commit: 3d18b2d9f7cbfc032e63fe719514e2683f4aedfb Author: Himanshi Kalra Date: Fri Jul 9 18:15:54 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB3d18b2d9f7cbfc032e63fe719514e2683f4aedfb Renaming: From MeshTest to SpecMeshTest curve_to_mesh tests === M tests/python/curve_to_mesh.py === diff --git a/tests/python/curve_to_mesh.py b/tests/python/curve_to_mesh.py index 998ecdae116..654cfc750d7 100644 --- a/tests/python/curve_to_mesh.py +++ b/tests/python/curve_to_mesh.py @@ -24,74 +24,74 @@ import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import MeshTest, OperatorSpecObjectMode, RunTest +from modules.mesh_test import SpecMeshTest, OperatorSpecObjectMode, RunTest def main(): tests = [ -MeshTest('2D Non Cyclic', 'test2DNonCyclic', 'expected2DNonCyclic', +SpecMeshTest('2D Non Cyclic', 'test2DNonCyclic', 'expected2DNonCyclic', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('2D NURBS With Tail', 'test2DNURBSWithTail', 'expected2DNURBSWithTail', +SpecMeshTest('2D NURBS With Tail', 'test2DNURBSWithTail', 'expected2DNURBSWithTail', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('2D Shape With Hole', 'test2DShapeWithHole', 'expected2DShapeWithHole', +SpecMeshTest('2D Shape With Hole', 'test2DShapeWithHole', 'expected2DShapeWithHole', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('2D Simple Lower Res', 'test2DSimpleLowerRes', 'expected2DSimpleLowerRes', +SpecMeshTest('2D Simple Lower Res', 'test2DSimpleLowerRes', 'expected2DSimpleLowerRes', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('2D Simple Low Res', 'test2DSimpleLowRes', 'expected2DSimpleLowRes', +SpecMeshTest('2D Simple Low Res', 'test2DSimpleLowRes', 'expected2DSimpleLowRes', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('2D Square', 'test2DSquare', 'expected2DSquare', +SpecMeshTest('2D Square', 'test2DSquare', 'expected2DSquare', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('2D Extrude', 'test2DExtrude', 'expected2DExtrude', +SpecMeshTest('2D Extrude', 'test2DExtrude', 'expected2DExtrude', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Back', 'testBevelBack', 'expectedBevelBack', +SpecMeshTest('Bevel Back', 'testBevelBack', 'expectedBevelBack', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Back Low Res', 'testBevelBackLowRes', 'expectedBevelBackLowRes', +SpecMeshTest('Bevel Back Low Res', 'testBevelBackLowRes', 'expectedBevelBackLowRes', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Extrude Back', 'testBevelExtrudeBack', 'expectedBevelExtrudeBack', +SpecMeshTest('Bevel Extrude Back', 'testBevelExtrudeBack', 'expectedBevelExtrudeBack', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Extrude Front', 'testBevelExtrudeFront', 'expectedBevelExtrudeFront', +SpecMeshTest('Bevel Extrude Front', 'testBevelExtrudeFront', 'expectedBevelExtrudeFront', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Extrude Full', 'testBevelExtrudeFull', 'expectedBevelExtrudeFull', +SpecMeshTest('Bevel Extrude Full', 'testBevelExtrudeFull', 'expectedBevelExtrudeFull', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Extrude Half', 'testBevelExtrudeHalf', 'expectedBevelExtrudeHalf', +SpecMeshTest('Bevel Extrude Half', 'testBevelExtrudeHalf', 'expectedBevelExtrudeHalf', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Front', 'testBevelFront', 'expectedBevelFront', +SpecMeshTest('Bevel Front', 'testBevelFront', 'expectedBevelFront', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Front Low Res', 'testBevelFrontLowRes', 'expectedBevelFrontLowRes', +SpecMeshTest('Bevel Front Low Res', 'testBevelFrontLowRes', 'expectedBevelFrontLowRes', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Full', 'testBevelFull', 'expectedBevelFull', +SpecMeshTest('Bevel Full', 'testBevelFull', 'expectedBevelFull', [OperatorSpecObjectMode('convert', {'target': 'MESH'})]), -MeshTest('Bevel Full Low Res', 'testBevelFullLowRes
[Bf-blender-cvs] [faae72e8ee9] soc-2021-geometry-nodes-regression-test: Addressed comments by Jacques Lucke
Commit: faae72e8ee9e8191cb3604c9337e73e8ea4a1666 Author: Himanshi Kalra Date: Fri Jul 9 18:05:54 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBfaae72e8ee9e8191cb3604c9337e73e8ea4a1666 Addressed comments by Jacques Lucke === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 3eb18cf2ff6..1bd12c9d77b 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -190,7 +190,7 @@ class MeshTest(ABC): self.test_object = objects[self.test_object_name] if self.update: -if objects.find(exp_object_name) > -1: +if exp_object_name in objects: self.expected_object = objects[self.exp_object_name] else: self.create_expected_object() @@ -260,6 +260,8 @@ class MeshTest(ABC): elif self.update: self.failed_test(result) self.update_failed_test(evaluated_test_object) +# Check for testing the blend file is updated and re-running. +# Also safety check to avoid infinite recursion loop. if self.test_updated_counter == 1: self.run_test() return True @@ -274,14 +276,10 @@ class MeshTest(ABC): def failed_test(self, result): print("\nFAILED {} test with the following: ".format(self.test_name)) self._print_result(result) -# Real implementation. -pass def passed_test(self, result): print("\nPASSED {} test successfully.".format(self.test_name)) self._print_result(result) -# Real implementation -pass def do_selection(self, mesh: bpy.types.Mesh, select_mode: str, selection: set): """ @@ -292,7 +290,7 @@ class MeshTest(ABC): Example: select_mode='VERT' and selection={1,2,3} selects veritces 1, 2 and 3 of input mesh """ -# deselect all +# Deselect all objects. bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_all(action='DESELECT') bpy.ops.object.mode_set(mode='OBJECT') ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [82aa700fe6f] soc-2021-geometry-nodes-regression-test: Removing unwanted formatting changes
Commit: 82aa700fe6fb2273823f77f36cb837dc2b9cfc28 Author: Himanshi Kalra Date: Fri Jul 9 14:19:16 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB82aa700fe6fb2273823f77f36cb837dc2b9cfc28 Removing unwanted formatting changes === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 08264199bed..3eb18cf2ff6 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -95,9 +95,7 @@ class ParticleSystemSpec: def __str__(self): return "Physics Modifier: " + self.modifier_name + " of type " + self.modifier_type + \ - " with parameters: " + \ -str(self.modifier_parameters) + \ -" with frame end: " + str(self.frame_end) + " with parameters: " + str(self.modifier_parameters) + " with frame end: " + str(self.frame_end) class OperatorSpecEditMode: @@ -116,15 +114,13 @@ class OperatorSpecEditMode: self.operator_name = operator_name self.operator_parameters = operator_parameters if select_mode not in ['VERT', 'EDGE', 'FACE']: -raise ValueError("select_mode must be either {}, {} or {}".format( -'VERT', 'EDGE', 'FACE')) +raise ValueError("select_mode must be either {}, {} or {}".format('VERT', 'EDGE', 'FACE')) self.select_mode = select_mode self.selection = selection def __str__(self): return "Operator: " + self.operator_name + " with parameters: " + str(self.operator_parameters) + \ - " in selection mode: " + self.select_mode + \ -", selecting " + str(self.selection) + " in selection mode: " + self.select_mode + ", selecting " + str(self.selection) class OperatorSpecObjectMode: @@ -478,8 +474,7 @@ class SpecMeshTest(MeshTest): """ settings = [] modifier_name = modifier.name -self._set_parameters_impl( -modifier, modifier_parameters, settings, modifier_name) +self._set_parameters_impl(modifier, modifier_parameters, settings, modifier_name) def _add_modifier(self, test_object, modifier_spec: ModifierSpec): """ @@ -494,8 +489,7 @@ class SpecMeshTest(MeshTest): modifier_spec.modifier_type) if modifier is None: -raise Exception( -"This modifier type is already added on the Test Object, please remove it and try again.") +raise Exception("This modifier type is already added on the Test Object, please remove it and try again.") if self.verbose: print("Created modifier '{}' of type '{}'.". @@ -508,8 +502,7 @@ class SpecMeshTest(MeshTest): self.set_parameters(modifier, modifier_spec.modifier_parameters) if modifier.type in bakers_list: -self._bake_current_simulation( -test_object, modifier.name, modifier_spec.frame_end) +self._bake_current_simulation(test_object, modifier.name, modifier_spec.frame_end) scene.frame_set(modifier_spec.frame_end) @@ -537,16 +530,14 @@ class SpecMeshTest(MeshTest): elif modifier.type == 'CLOTH' or modifier.type == 'SOFT_BODY': test_object.modifiers[test_modifier_name].point_cache.frame_end = frame_end override_setting = modifier.point_cache -override = { -'scene': scene, 'active_object': test_object, 'point_cache': override_setting} +override = {'scene': scene, 'active_object': test_object, 'point_cache': override_setting} bpy.ops.ptcache.bake(override, bake=True) break elif modifier.type == 'DYNAMIC_PAINT': dynamic_paint_setting = modifier.canvas_settings.canvas_surfaces.active override_setting = dynamic_paint_setting.point_cache -override = { -'scene': scene, 'active_object': test_object, 'point_cache': override_setting} +override = {'scene': scene, 'active_object': test_object, 'point_cache': override_setting} bpy.ops.ptcache.bake(override, bake=True) break @@ -557,8 +548,7 @@ class SpecMeshTest(MeshTest): bpy.context.scene.frame_set(1) bpy.ops.object.select_all(action='DESELECT') -test_object.modifiers.new( -particle_sys_spec.modifier_name, particle_sy
[Bf-blender-cvs] [a5baa450d10] soc-2021-geometry-nodes-regression-test: Added test file for Geometry Nodes
Commit: a5baa450d106cd5372a1e52360e4ced890fb1b8c Author: Himanshi Kalra Date: Fri Jul 9 14:27:53 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBa5baa450d106cd5372a1e52360e4ced890fb1b8c Added test file for Geometry Nodes === A tests/python/geo_node_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py new file mode 100644 index 000..5ad86b41329 --- /dev/null +++ b/tests/python/geo_node_test.py @@ -0,0 +1,29 @@ +# # BEGIN GPL LICENSE BLOCK # +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# # END GPL LICENSE BLOCK # + +# + + +import os +import sys + +sys.path.append(os.path.dirname(os.path.realpath(__file__))) +from modules.mesh_test import BlendFileTest + +geo_node_test = BlendFileTest("test_object", "expected_object") +geo_node_test.run_test() \ No newline at end of file ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [09566e510ab] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: 09566e510abcc49e297091994636235c6680bcc0 Author: Himanshi Kalra Date: Fri Jul 9 14:32:09 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB09566e510abcc49e297091994636235c6680bcc0 Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [16f76725136] soc-2021-geometry-nodes-regression-test: Removed extra files
Commit: 16f76725136a0ce9c9c00553341f0b6b303c8465 Author: Himanshi Kalra Date: Fri Jul 9 02:08:20 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB16f76725136a0ce9c9c00553341f0b6b303c8465 Removed extra files === D tests/python/geo_node_test.py D tests/python/modules/base_mesh_test.py D tests/python/modules/mesh_test_prototype.py D tests/python/modules/spec_classes.py D tests/python/test_classes.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py deleted file mode 100644 index a5f94fa4da7..000 --- a/tests/python/geo_node_test.py +++ /dev/null @@ -1,193 +0,0 @@ -# # BEGIN GPL LICENSE BLOCK # -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# # END GPL LICENSE BLOCK # - -# - - -# Script for running tests pre-loaded from a blend file. -# -# General Idea -# -# Load a blend file. -# Select the object. -# Apply the GN modifier on a duplicated object. -# Compare the result. -# If test pass, print("SUCCESS"). -# If test fail, print("FAIL"). -#Update tests if BLENDER_TEST_UPDATE flag is set. -# Display result of failed tests. -# -# Set the BLENDER_TEST_UPDATE env variable to update the expected object. -# -### RUN TEST COMMAND ### -# blender -b path_to_blend_file --python path/to/geo_node_test.py - -import bpy -import os -import sys - - -def get_test_object(): -""" -Get test object or raise Exception. -""" -try: -test_object = bpy.data.objects["test_object"] -return test_object -except KeyError: -raise Exception("No test object found!") - - -def get_expected_object(): -""" -Get expected object or raise Exception. -""" -try: -expected_object = bpy.data.objects["expected_object"] -return expected_object -except KeyError: -raise Exception("No expected object found!") - - -def get_evaluated_object(test_object): -evaluated_object = duplicate_test_object(test_object) -apply_modifier(evaluated_object) -return evaluated_object - - -def select_only_object(any_object): -""" -Select the given object and make it active object. -""" -bpy.ops.object.select_all(action="DESELECT") -bpy.context.view_layer.objects.active = any_object -any_object.select_set(True) - - -def create_expected_object(test_object): -""" -Create expected object when run with BLENDER_TEST_UPDATE -""" -try: -expected_object = bpy.data.objects["expected_object"] - -except KeyError: -print("Creating an expected object...") -evaluated_object = get_evaluated_object(test_object) - -# Setting evaluted_object to expected_object to create -# a new expected_object. -expected_object = evaluated_object -expected_object.name = "expected_object" - -# Be careful with tests dealing with global coordinates. -expected_object.location = (0, 10, 0) - -# Save file with the expected object. -bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) - - -def apply_modifier(evaluated_object): -""" -Apply all modifiers (Geometry Nodes for now) added to the current object [Discuss] -""" -select_only_object(evaluated_object) - -modifiers_list = evaluated_object.modifiers - -if modifiers_list[0].type == "NODES": -bpy.ops.object.modifier_apply(modifier=modifiers_list[0].name) -else: -raise Exception("Modifier not of Geometry Nodes type") - - -def compare_meshes(evaluated_object, expected_object): -""" -Compares the meshes of evaluated and expected objects. -""" -evaluated_data = evaluated_object.data -exp_data = expected_object.data -result = evaluated_data.unit_test_compare(mesh=exp_data) -if result == "Same": -print("\nPA
[Bf-blender-cvs] [43fd05d8d8d] soc-2021-geometry-nodes-regression-test: Solved merge formatting conflicts
Commit: 43fd05d8d8d31bb72d01ee256d4fa2cfe4c5de4e Author: Himanshi Kalra Date: Fri Jul 9 02:14:11 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB43fd05d8d8d31bb72d01ee256d4fa2cfe4c5de4e Solved merge formatting conflicts === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [984ad47d934] soc-2021-geometry-nodes-regression-test: Added the remaining classes, updated the python test files.
Commit: 984ad47d9343da139c78845769ade68161cde649 Author: Himanshi Kalra Date: Fri Jul 9 01:49:39 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB984ad47d9343da139c78845769ade68161cde649 Added the remaining classes, updated the python test files. Added the changes back to mesh test file. === M tests/python/bevel_operator.py M tests/python/boolean_operator.py M tests/python/deform_modifiers.py M tests/python/modifiers.py M tests/python/modules/base_mesh_test.py M tests/python/modules/mesh_test.py M tests/python/operators.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/bevel_operator.py b/tests/python/bevel_operator.py index c732d437b57..726bf4b5b03 100644 --- a/tests/python/bevel_operator.py +++ b/tests/python/bevel_operator.py @@ -27,272 +27,272 @@ import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import MeshTest, OperatorSpecEditMode, RunTest +from modules.mesh_test import SpecMeshTest, OperatorSpecEditMode, RunTest def main(): tests = [ # 0 -MeshTest('Cube_test_1', 'Cube_test', 'Cube_result_1', +SpecMeshTest('Cube_test_1', 'Cube_test', 'Cube_result_1', [OperatorSpecEditMode('bevel', {'offset': 0.2}, 'EDGE', {10})]), -MeshTest('Cube_test_2', 'Cube_test', 'Cube_result_2', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest('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', +SpecMeshTest("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', +SpecMeshTest('Pyramid4
[Bf-blender-cvs] [c400f79582b] soc-2021-geometry-nodes-regression-test: Small test file
Commit: c400f79582b53350ab4f7a714c2584fae84912f9 Author: Himanshi Kalra Date: Wed Jul 7 19:09:50 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBc400f79582b53350ab4f7a714c2584fae84912f9 Small test file === M tests/python/test_classes.py === diff --git a/tests/python/test_classes.py b/tests/python/test_classes.py index 7250a480050..2d9eff52cf2 100644 --- a/tests/python/test_classes.py +++ b/tests/python/test_classes.py @@ -1,3 +1,4 @@ + import math import os import sys @@ -6,10 +7,20 @@ from random import shuffle, seed import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.base_mesh_test import SpecTest, BlendFileTest -from modules.mesh_test import RunTest, ModifierSpec, MeshTest +from modules.spec_classes import ModifierSpec, DeformModifierSpec, OperatorSpecEditMode, OperatorSpecObjectMode, ParticleSystemSpec +from modules.base_mesh_test import SpecMeshTest, BlendFileTest # modifier_test = SpecTest("test_name_demo", "test_demo", "exp_demo", []) -geo_node_test = BlendFileTest("test_object", "expected_object") -geo_node_test.run_test() +# geo_node_test = BlendFileTest("test_object", "expected_object") +# geo_node_test.run_test() + +modifier_test = SpecMeshTest("CubeSubsurfPass", "test_object", "subsurf_obj", + [ModifierSpec('subsurf', 'SUBSURF', {})]) + +modifier_test.run_test() + +modifier_test_2 = SpecMeshTest("CubeSubsurffail", "test_object", "no_subsurf", + [ModifierSpec('subsurf', 'SUBSURF', {})]) + +modifier_test_2.run_test() \ No newline at end of file ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7e45a760b4f] soc-2021-geometry-nodes-regression-test: Added backward support for existing tests.
Commit: 7e45a760b4fc786af4674a0e44398d65cf709af2 Author: Himanshi Kalra Date: Wed Jul 7 18:46:09 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB7e45a760b4fc786af4674a0e44398d65cf709af2 Added backward support for existing tests. - Added create_expected_object if it doesn't exist. - Added a counter condition for recusrion. - Added optional test_name in basemesh test. - Added code of previous MeshTest to SpecMeshTest. - Changed default value of apply_modifier(s) flag and do_compare flag. === M tests/python/modules/base_mesh_test.py === diff --git a/tests/python/modules/base_mesh_test.py b/tests/python/modules/base_mesh_test.py index 1e8f48b74fc..d855af74c6d 100644 --- a/tests/python/modules/base_mesh_test.py +++ b/tests/python/modules/base_mesh_test.py @@ -3,24 +3,42 @@ import bpy import os import sys -from modules.spec_classes import ModifierSpec, DeformModifierSpec, OperatorSpecEditMode, OperatorSpecObjectMode +from modules.spec_classes import ModifierSpec, DeformModifierSpec, OperatorSpecEditMode, OperatorSpecObjectMode, ParticleSystemSpec class MeshTest(ABC): -def __init__(self, test_object_name, exp_object_name, threshold=None): +def __init__(self, test_object_name, exp_object_name, test_name=None, threshold=None): self.test_object_name = test_object_name self.exp_object_name = exp_object_name +self.test_name = test_name self.threshold = threshold self.update = os.getenv("BLENDER_TEST_UPDATE") is not None +self.verbose = os.getenv("BLENDER_VERBOSE") is not None # self.eval_object_name = "evaluated_object" -# Private flag to indicate whether the blend file was updated after the test. -self._test_updated = False + +self.test_updated_counter = 0 objects = bpy.data.objects self.test_object = objects[self.test_object_name] +# self.expected_object = objects[self.exp_object_name] -# TODO - create exp object, in case doesn't exist. -self.expected_object = objects[self.exp_object_name] +if self.update: +if objects.find(exp_object_name) > -1: +self.expected_object = objects[self.exp_object_name] +else: +self.create_expected_object() +else: +self.expected_object = objects[self.exp_object_name] + + +def create_expected_object(self): +print("Creating expected object...") +evaluated_object = self.create_evaluated_object() +self.expected_object = evaluated_object +self.expected_object.name = self.exp_object_name +x, y, z = self.test_object.location +self.expected_object.location = (x, y+10, z) +bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) def create_evaluated_object(self): bpy.context.view_layer.objects.active = self.test_object @@ -40,11 +58,13 @@ class MeshTest(ABC): @staticmethod def _print_result(result): comparison_result, selection_result, validation_result = result -print("Mesh Compariosn: {}".format(comparison_result)) +print("Mesh Comparison: {}".format(comparison_result)) print("Selection Result: {}".format(selection_result)) print("Mesh Validation: {}".format(validation_result)) +print() def run_test(self): +# self.test_updated_counter = 0 evaluated_test_object = self.create_evaluated_object() self.apply_operations(evaluated_test_object) result = self.compare_meshes(evaluated_test_object) @@ -53,25 +73,35 @@ class MeshTest(ABC): if comparison_result == "Same" and selection_result == "Same" and validation_result == "Valid": self.passed_test(result) +# Clean up. +if self.verbose: +print("Cleaning up...") +# Delete evaluated_test_object. +bpy.ops.object.delete() +# bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) + +return True elif self.update: self.failed_test(result) self.update_failed_test(evaluated_test_object) +if self.test_updated_counter == 1: +self.run_test() +else: +print("The test fails consistently. Exiting...") else: self.failed_test(result) -# Real implementation. -pass def failed_test(self, result): -print("The test failed with the following: ") +print("\nFAILED {} test with the following: ".format(self.test_name)) self._print_result(re
[Bf-blender-cvs] [3c996fe7e2e] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: 3c996fe7e2eb8f1e7e9aa9800595b400b4a289cf Author: Himanshi Kalra Date: Mon Jul 5 01:21:06 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB3c996fe7e2eb8f1e7e9aa9800595b400b4a289cf Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2edc2136a1d] soc-2021-geometry-nodes-regression-test: WIP: Saving work, Mesh Test Abstract class implementattion complete, updating to Win 11
Commit: 2edc2136a1d89e4fdeafa7df127a1e4df18fb9db Author: Himanshi Kalra Date: Sat Jul 3 14:17:38 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB2edc2136a1d89e4fdeafa7df127a1e4df18fb9db WIP: Saving work, Mesh Test Abstract class implementattion complete, updating to Win 11 === M tests/python/modules/base_mesh_test.py A tests/python/modules/spec_classes.py A tests/python/test_classes.py === diff --git a/tests/python/modules/base_mesh_test.py b/tests/python/modules/base_mesh_test.py index d07f5485041..1e8f48b74fc 100644 --- a/tests/python/modules/base_mesh_test.py +++ b/tests/python/modules/base_mesh_test.py @@ -3,6 +3,8 @@ import bpy import os import sys +from modules.spec_classes import ModifierSpec, DeformModifierSpec, OperatorSpecEditMode, OperatorSpecObjectMode + class MeshTest(ABC): def __init__(self, test_object_name, exp_object_name, threshold=None): @@ -10,37 +12,123 @@ class MeshTest(ABC): self.exp_object_name = exp_object_name self.threshold = threshold self.update = os.getenv("BLENDER_TEST_UPDATE") is not None -self.eval_object_name = "evaluated_object" +# self.eval_object_name = "evaluated_object" + +# Private flag to indicate whether the blend file was updated after the test. +self._test_updated = False +objects = bpy.data.objects +self.test_object = objects[self.test_object_name] + +# TODO - create exp object, in case doesn't exist. +self.expected_object = objects[self.exp_object_name] def create_evaluated_object(self): +bpy.context.view_layer.objects.active = self.test_object + +# Duplicate test object. +bpy.ops.object.mode_set(mode="OBJECT") +bpy.ops.object.select_all(action="DESELECT") +bpy.context.view_layer.objects.active = self.test_object + +self.test_object.select_set(True) +bpy.ops.object.duplicate() +evaluated_test_object = bpy.context.active_object +evaluated_test_object.name = "evaluated_object" # Real implementation. -pass +return evaluated_test_object + +@staticmethod +def _print_result(result): +comparison_result, selection_result, validation_result = result +print("Mesh Compariosn: {}".format(comparison_result)) +print("Selection Result: {}".format(selection_result)) +print("Mesh Validation: {}".format(validation_result)) def run_test(self): +evaluated_test_object = self.create_evaluated_object() +self.apply_operations(evaluated_test_object) +result = self.compare_meshes(evaluated_test_object) + +comparison_result, selection_result, validation_result = result + +if comparison_result == "Same" and selection_result == "Same" and validation_result == "Valid": +self.passed_test(result) + +elif self.update: +self.failed_test(result) +self.update_failed_test(evaluated_test_object) + +else: +self.failed_test(result) + # Real implementation. pass -def failed_test(self): +def failed_test(self, result): +print("The test failed with the following: ") +self._print_result(result) # Real implementation. pass -def passed_test(self): +def passed_test(self, result): +print("The tests passed successfully.") +self._print_result(result) # Real implementation pass -def update_failed_test(self): -if self.failed_test() and self.update: -self.create_evaluated_object() -# Real implementation -pass +def do_selection(self, mesh: bpy.types.Mesh, select_mode: str, selection: set): +""" +Do selection on a mesh +:param mesh: bpy.types.Mesh - input mesh +:param: select_mode: str - selection mode. Must be 'VERT', 'EDGE' or 'FACE' +:param: selection: set - indices of selection. + +Example: select_mode='VERT' and selection={1,2,3} selects veritces 1, 2 and 3 of input mesh +""" +# deselect all +bpy.ops.object.mode_set(mode='EDIT') +bpy.ops.mesh.select_all(action='DESELECT') +bpy.ops.object.mode_set(mode='OBJECT') + +bpy.context.tool_settings.mesh_select_mode = (select_mode == 'VERT', + select_mode == 'EDGE', + select_mode == 'FACE') + +items = (mesh.vertices if select_mode == 'VERT' + else mesh.edges if select_mode == 'ED
[Bf-blender-cvs] [fec564b3210] soc-2021-geometry-nodes-regression-test: Refactoring of mesh test in a new file: WIP
Commit: fec564b3210274a4e4340e6a4aa2bd627ee37f2b Author: Himanshi Kalra Date: Thu Jul 1 11:00:29 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBfec564b3210274a4e4340e6a4aa2bd627ee37f2b Refactoring of mesh test in a new file: WIP === A tests/python/modules/base_mesh_test.py A tests/python/modules/mesh_test_prototype.py === diff --git a/tests/python/modules/base_mesh_test.py b/tests/python/modules/base_mesh_test.py new file mode 100644 index 000..d07f5485041 --- /dev/null +++ b/tests/python/modules/base_mesh_test.py @@ -0,0 +1,99 @@ +from abc import ABC, abstractmethod +import bpy +import os +import sys + + +class MeshTest(ABC): +def __init__(self, test_object_name, exp_object_name, threshold=None): +self.test_object_name = test_object_name +self.exp_object_name = exp_object_name +self.threshold = threshold +self.update = os.getenv("BLENDER_TEST_UPDATE") is not None +self.eval_object_name = "evaluated_object" + +def create_evaluated_object(self): +# Real implementation. +pass + +def run_test(self): +# Real implementation. +pass + +def failed_test(self): +# Real implementation. +pass + +def passed_test(self): +# Real implementation +pass + +def update_failed_test(self): +if self.failed_test() and self.update: +self.create_evaluated_object() +# Real implementation +pass + +def compare_meshes(self, evaluated_object, with_selection=True): +objects = bpy.data.objects +evaluated_test_mesh = objects[evaluated_object.name].data +expected_mesh = objects[self.exp_object_name].data +result_codes = [] + +# Mesh Comparison +if self.threshold: +result_mesh = expected_mesh.unit_test_compare( +mesh=evaluated_test_mesh, threshold=self.threshold) +else: +result_mesh = expected_mesh.unit_test_compare( +mesh=evaluated_test_mesh) +result_codes.append(result_mesh) + +# Selection comparison. +if with_selection: +selected_evaluatated_verts = [ +v.index for v in evaluated_test_mesh.vertices if v.select] +selected_expected_verts = [ +v.index for v in expected_mesh.vertices if v.select] + +if selected_evaluatated_verts == selected_expected_verts: +result_selection = "Same" +else: +result_selection = "Selection doesn't match." +else: +result_selection = "NA" + +result_codes.append(result_selection) + +# Validation check. +# TODO + +return result_codes + +@abstractmethod +def apply_operations(self): +pass + +def __repr__(self): +return "MeshTest({}, {} )".format(self.test_object_name, self.exp_object_name) + + +class SpecTest(MeshTest): +def __init__(self, test_object_name, exp_object_name, threshold=None, operation_stack=None): +super.__init__(test_object_name, exp_object_name, threshold=None) +pass + +def apply_operations(self): +pass + + +class BlendFileTest(MeshTest): +def apply_operations(self): +pass + + +geometry_nodes_test = BlendFileTest("test_object", "expected_object") +geometry_nodes_test.run_test() + +modifier_test = SpecTest("test_array", "exp_array", operation_stack=[]) +modifier_test.run_test() diff --git a/tests/python/modules/mesh_test_prototype.py b/tests/python/modules/mesh_test_prototype.py new file mode 100644 index 000..7fcaecfccee --- /dev/null +++ b/tests/python/modules/mesh_test_prototype.py @@ -0,0 +1,82 @@ +from abc import ABC, ABCMeta, abstractmethod + + +class MeshTest(ABC): +def __init__(self, test_object_name, exp_object_name, threshold=None): +self.test_object_name = test_object_name +self.exp_object_name = exp_object_name +self.threshold = threshold +self.update = ENV_VAR + +def create_evaluated_object(self): +# Real implementation. +pass + +def run_test(self): +# Real implementation. +pass + +def failed_test(self): +# Real implementation. +pass + +def passed_test(self): +# Real implementation +pass + +def update_failed_test(self): +if self.failed_test() == True and self.update: +self.create_evaluated_object() +# Real implementation +pass + +def compare_mesh(self, with_selection=True): +# Real implementation. +pass + +@abstractmethod +def apply_operations(self): +
[Bf-blender-cvs] [70e8acf0bae] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: 70e8acf0bae7d8de582c5d827ea4749b2c6ea92b Author: Himanshi Kalra Date: Mon Jun 28 12:00:15 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB70e8acf0bae7d8de582c5d827ea4749b2c6ea92b Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2778211cea4] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: 2778211cea4b8c72c02f52a3eb424854b6e57f64 Author: Himanshi Kalra Date: Fri Jun 18 16:56:27 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB2778211cea4b8c72c02f52a3eb424854b6e57f64 Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [24a401c36d1] soc-2021-geometry-nodes-regression-test: Changes based on review by Habib Gahbiche
Commit: 24a401c36d1da64580cbb1b33c7c1d5c3d8d2c3f Author: Himanshi Kalra Date: Thu Jun 17 11:12:27 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB24a401c36d1da64580cbb1b33c7c1d5c3d8d2c3f Changes based on review by Habib Gahbiche Removed global variable FILE UPDATE COUNT, introduced a function run_test(). === M tests/python/geo_node_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index 55002ee9585..a5f94fa4da7 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -41,8 +41,6 @@ import bpy import os import sys -FILE_UPDATE_COUNT = 0 - def get_test_object(): """ @@ -144,17 +142,11 @@ def failed_test(evaluated_object, expected_object, result): update_expected_object(evaluated_object, expected_object) print("Re-running the test...") -if FILE_UPDATE_COUNT < 2: -main() -else: -print("The script has run into some errors. Test cannot pass. Exiting...") -sys.exit(1) +run_test() def update_expected_object(evaluated_object, expected_object): print("Updating the test...") -global FILE_UPDATE_COUNT -FILE_UPDATE_COUNT += 1 evaluated_object.location = expected_object.location expected_object_name = expected_object.name bpy.data.objects.remove(expected_object, do_unlink=True) @@ -179,6 +171,13 @@ def duplicate_test_object(test_object): return evaluated_object +def run_test(): +test_object = get_test_object() +expected_object = get_expected_object() +evaluated_object = get_evaluated_object(test_object) +compare_meshes(evaluated_object, expected_object) + + def main(): """ Main function controlling the workflow and running the tests. @@ -187,9 +186,7 @@ def main(): update_test_flag = os.getenv('BLENDER_TEST_UPDATE') is not None if update_test_flag: create_expected_object(test_object) -expected_object = get_expected_object() -evaluated_object = get_evaluated_object(test_object) -compare_meshes(evaluated_object, expected_object) +run_test() if __name__ == "__main__": ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [959fe77e9c6] soc-2021-geometry-nodes-regression-test: Removing unused functions for remove modifiers
Commit: 959fe77e9c6fd5b1419491f66f1167ddac24053c Author: Himanshi Kalra Date: Thu Jun 17 11:06:44 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB959fe77e9c6fd5b1419491f66f1167ddac24053c Removing unused functions for remove modifiers === M tests/python/geo_node_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index cf559947a73..55002ee9585 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -27,13 +27,15 @@ # Select the object. # Apply the GN modifier on a duplicated object. # Compare the result. -# If test pass, print("SUCCESS") -# If test fail, print("FAIL") +# If test pass, print("SUCCESS"). +# If test fail, print("FAIL"). #Update tests if BLENDER_TEST_UPDATE flag is set. # Display result of failed tests. - +# +# Set the BLENDER_TEST_UPDATE env variable to update the expected object. +# ### RUN TEST COMMAND ### -# blender -b path_to_blend_file --python path/to/geo_node_test.py -- [--first-time] +# blender -b path_to_blend_file --python path/to/geo_node_test.py import bpy import os @@ -64,41 +66,39 @@ def get_expected_object(): raise Exception("No expected object found!") +def get_evaluated_object(test_object): +evaluated_object = duplicate_test_object(test_object) +apply_modifier(evaluated_object) +return evaluated_object + + def select_only_object(any_object): """ -Select the given object. +Select the given object and make it active object. """ -bpy.ops.object.mode_set(mode="OBJECT") bpy.ops.object.select_all(action="DESELECT") bpy.context.view_layer.objects.active = any_object any_object.select_set(True) -def remove_modifiers_from_object(any_object): +def create_expected_object(test_object): """ -Remove modifiers from the selected object. -""" -select_only_object(any_object) -modifier_list = list(any_object.modifiers) -for modifier in modifier_list: -any_object.modifiers.remove(modifier=modifier) - - -def run_first_time(): -""" -Automatically creates the expected object when script -is run with argument "--first-time". +Create expected object when run with BLENDER_TEST_UPDATE """ try: expected_object = bpy.data.objects["expected_object"] -print("\nExpected Object already present, skipping creating a new object.") except KeyError: -expected_object = duplicate_test_object(get_test_object()) -expected_object.location = (0, 10, 0) +print("Creating an expected object...") +evaluated_object = get_evaluated_object(test_object) + +# Setting evaluted_object to expected_object to create +# a new expected_object. +expected_object = evaluated_object expected_object.name = "expected_object" -remove_modifiers_from_object(expected_object) +# Be careful with tests dealing with global coordinates. +expected_object.location = (0, 10, 0) # Save file with the expected object. bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) @@ -142,6 +142,16 @@ def failed_test(evaluated_object, expected_object, result): if not update_test_flag: sys.exit(1) +update_expected_object(evaluated_object, expected_object) +print("Re-running the test...") +if FILE_UPDATE_COUNT < 2: +main() +else: +print("The script has run into some errors. Test cannot pass. Exiting...") +sys.exit(1) + + +def update_expected_object(evaluated_object, expected_object): print("Updating the test...") global FILE_UPDATE_COUNT FILE_UPDATE_COUNT += 1 @@ -156,12 +166,6 @@ def failed_test(evaluated_object, expected_object, result): print("The test file was updated with new expected object") print("The blend file {} was updated.".format( bpy.path.display_name_from_filepath(bpy.data.filepath))) -print("Re-running the test...") -if FILE_UPDATE_COUNT < 2: -main() -else: -print("The script has run into some errors. Test cannot pass. Exiting...") -sys.exit(1) def duplicate_test_object(test_object): @@ -179,21 +183,12 @@ def main(): """ Main function controlling the workflow and running the tests. """ -argv = sys.argv -try: -command = argv[argv.index("--") + 1:] -for cmd in command: -if cmd == "--first-time": -
[Bf-blender-cvs] [f52c6749911] soc-2021-geometry-nodes-regression-test: Alerted ctest with failed or pass
Commit: f52c6749911a3a485b111a965e423483ebe4a5f0 Author: Himanshi Kalra Date: Wed Jun 16 13:51:05 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBf52c6749911a3a485b111a965e423483ebe4a5f0 Alerted ctest with failed or pass Added a global file count base condition, in case of failure recursion. Added exit condition for errors. === M tests/python/geo_node_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index 89bcc99bd92..974df477c07 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -129,7 +129,10 @@ def compare_meshes(evaluated_object, expected_object): evaluated_data = evaluated_object.data exp_data = expected_object.data result = evaluated_data.unit_test_compare(mesh=exp_data) -return result +if result == "Same": +print("\nPASSED") +else: +failed_test(evaluated_object, expected_object, result) def failed_test(evaluated_object, expected_object, result): @@ -138,12 +141,13 @@ def failed_test(evaluated_object, expected_object, result): Updates the expected object on failure if BLENDER_TEST_UPDATE environment variable is set. """ -print("FAIL with {}".format(result)) +print("\nFAILED with {}".format(result)) update_test_flag = os.getenv('BLENDER_TEST_UPDATE') is not None if not update_test_flag: -return +sys.exit(1) print("Updating the test...") +global FILE_UPDATE_COUNT FILE_UPDATE_COUNT += 1 evaluated_object.location = expected_object.location expected_object_name = expected_object.name @@ -154,13 +158,14 @@ def failed_test(evaluated_object, expected_object, result): bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) print("The test file was updated with new expected object") -print("The blend file : {} was updated".format( +print("The blend file {} was updated.".format( bpy.path.display_name_from_filepath(bpy.data.filepath))) print("Re-running the test...") if FILE_UPDATE_COUNT < 2: main() else: -print("The script has run into some errors. Exiting...") +print("The script has run into some errors. Test cannot pass. Exiting...") +sys.exit(1) def duplicate_test_object(test_object): @@ -193,11 +198,7 @@ def main(): expected_object = get_expected_object() evaluated_object = duplicate_test_object(test_object) evaluated_object = apply_modifier(evaluated_object) -result = compare_meshes(evaluated_object, expected_object) -if result == "Same": -print("PASS") -else: -failed_test(evaluated_object, expected_object, result) +compare_meshes(evaluated_object, expected_object) if __name__ == "__main__": ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6f699690ee0] soc-2021-geometry-nodes-regression-test: Removed unwanted return statements
Commit: 6f699690ee060ae37cf1c27e9a785503d275210a Author: Himanshi Kalra Date: Wed Jun 16 16:15:54 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB6f699690ee060ae37cf1c27e9a785503d275210a Removed unwanted return statements === M tests/python/geo_node_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index 974df477c07..cf559947a73 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -73,18 +73,15 @@ def select_only_object(any_object): bpy.context.view_layer.objects.active = any_object any_object.select_set(True) -return any_object - def remove_modifiers_from_object(any_object): """ Remove modifiers from the selected object. """ -any_object = select_only_object(any_object) +select_only_object(any_object) modifier_list = list(any_object.modifiers) for modifier in modifier_list: any_object.modifiers.remove(modifier=modifier) -return any_object def run_first_time(): @@ -101,7 +98,7 @@ def run_first_time(): expected_object.location = (0, 10, 0) expected_object.name = "expected_object" -expected_object = remove_modifiers_from_object(expected_object) +remove_modifiers_from_object(expected_object) # Save file with the expected object. bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) @@ -111,7 +108,7 @@ def apply_modifier(evaluated_object): """ Apply all modifiers (Geometry Nodes for now) added to the current object [Discuss] """ -evaluated_object = select_only_object(evaluated_object) +select_only_object(evaluated_object) modifiers_list = evaluated_object.modifiers @@ -119,7 +116,6 @@ def apply_modifier(evaluated_object): bpy.ops.object.modifier_apply(modifier=modifiers_list[0].name) else: raise Exception("Modifier not of Geometry Nodes type") -return evaluated_object def compare_meshes(evaluated_object, expected_object): @@ -172,7 +168,7 @@ def duplicate_test_object(test_object): """ Duplicate test object. """ -test_object = select_only_object(test_object) +select_only_object(test_object) bpy.ops.object.duplicate() evaluated_object = bpy.context.active_object evaluated_object.name = "evaluated_object" @@ -197,7 +193,7 @@ def main(): test_object = get_test_object() expected_object = get_expected_object() evaluated_object = duplicate_test_object(test_object) -evaluated_object = apply_modifier(evaluated_object) +apply_modifier(evaluated_object) compare_meshes(evaluated_object, expected_object) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [825081a2d02] soc-2021-geometry-nodes-regression-test: Changes based on review by Jacques Lucke
Commit: 825081a2d02770dc8ef902cc5af774a5c6497690 Author: Himanshi Kalra Date: Tue Jun 15 23:28:02 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB825081a2d02770dc8ef902cc5af774a5c6497690 Changes based on review by Jacques Lucke === M tests/python/geo_node_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index e6cf5d8c61b..89bcc99bd92 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -23,21 +23,14 @@ # # General Idea # -# Load a blend file -# Select the object -# Apply the GN modifier on a duplicated object -# Compare the result -# If test pass, print("SUCESS") +# Load a blend file. +# Select the object. +# Apply the GN modifier on a duplicated object. +# Compare the result. +# If test pass, print("SUCCESS") # If test fail, print("FAIL") #Update tests if BLENDER_TEST_UPDATE flag is set. -# Display result of failed tests - -# Code to be re-used from Mesh Test -# Depending on what all we want to use -# the mesh comparison code -# -- run-test code -# Code to be re-used from a Compositor -# Edit Cmake to iterate over directories. +# Display result of failed tests. ### RUN TEST COMMAND ### # blender -b path_to_blend_file --python path/to/geo_node_test.py -- [--first-time] @@ -46,6 +39,8 @@ import bpy import os import sys +FILE_UPDATE_COUNT = 0 + def get_test_object(): """ @@ -53,9 +48,9 @@ def get_test_object(): """ try: test_object = bpy.data.objects["test_object"] +return test_object except KeyError: raise Exception("No test object found!") -return test_object def get_expected_object(): @@ -64,18 +59,19 @@ def get_expected_object(): """ try: expected_object = bpy.data.objects["expected_object"] +return expected_object except KeyError: raise Exception("No expected object found!") -return expected_object -def select_the_object(any_object): +def select_only_object(any_object): """ Select the given object. """ bpy.ops.object.mode_set(mode="OBJECT") bpy.ops.object.select_all(action="DESELECT") bpy.context.view_layer.objects.active = any_object +any_object.select_set(True) return any_object @@ -84,22 +80,22 @@ def remove_modifiers_from_object(any_object): """ Remove modifiers from the selected object. """ -any_object = select_the_object(any_object) +any_object = select_only_object(any_object) modifier_list = list(any_object.modifiers) for modifier in modifier_list: -bpy.ops.object.modifier_remove(modifier=modifier.name) +any_object.modifiers.remove(modifier=modifier) return any_object def run_first_time(): """ Automatically creates the expected object when script -is run with argument "--first-time" +is run with argument "--first-time". """ try: expected_object = bpy.data.objects["expected_object"] -print("\nExpected Object already, skipping creating a new object.") -return +print("\nExpected Object already present, skipping creating a new object.") + except KeyError: expected_object = duplicate_test_object(get_test_object()) expected_object.location = (0, 10, 0) @@ -115,7 +111,7 @@ def apply_modifier(evaluated_object): """ Apply all modifiers (Geometry Nodes for now) added to the current object [Discuss] """ -evaluated_object = select_the_object(evaluated_object) +evaluated_object = select_only_object(evaluated_object) modifiers_list = evaluated_object.modifiers @@ -126,17 +122,14 @@ def apply_modifier(evaluated_object): return evaluated_object -def compare_mesh(evaluated_object, expected_object): +def compare_meshes(evaluated_object, expected_object): """ Compares the meshes of evaluated and expected objects. """ evaluated_data = evaluated_object.data exp_data = expected_object.data result = evaluated_data.unit_test_compare(mesh=exp_data) -if result == "Same": -print("PASS") -else: -failed_test(evaluated_object, expected_object, result) +return result def failed_test(evaluated_object, expected_object, result): @@ -151,6 +144,7 @@ def failed_test(evaluated_object, expected_object, result): return print("Updating the test...") +FILE_UPDATE_COUNT += 1 evaluated_object.loc
[Bf-blender-cvs] [8b151c5cdbd] soc-2021-geometry-nodes-regression-test: Updated the script, adding support for cmd arguments
Commit: 8b151c5cdbd8a4c81a7f49a9b470883504822936 Author: Himanshi Kalra Date: Tue Jun 15 13:18:29 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB8b151c5cdbd8a4c81a7f49a9b470883504822936 Updated the script, adding support for cmd arguments Added exception errors for try except, formatting, adding comments Improved the workflow, updated error messages. Re-running of the test after BLENDER_TEST_UPDATE. === M tests/python/geo_node_test.py === diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py index a684aeaf54d..e6cf5d8c61b 100644 --- a/tests/python/geo_node_test.py +++ b/tests/python/geo_node_test.py @@ -1,53 +1,122 @@ -# Load a blend file +# # BEGIN GPL LICENSE BLOCK # +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# # END GPL LICENSE BLOCK # + +# + + +# Script for running tests pre-loaded from a blend file. +# +# General Idea +# +# Load a blend file # Select the object # Apply the GN modifier on a duplicated object # Compare the result # If test pass, print("SUCESS") # If test fail, print("FAIL") -# Update tests if BLENDER_TEST_UPDATE flag is set. -# Display result of failed tests [?] +#Update tests if BLENDER_TEST_UPDATE flag is set. +# Display result of failed tests # Code to be re-used from Mesh Test # Depending on what all we want to use - ## the mesh comparison code - ## -- run-test code +# the mesh comparison code +# -- run-test code # Code to be re-used from a Compositor - ## Edit Cmake to iterate over directories. - -### Questions ### -# Usage of __slots__ (only getting save memory, optimize) [Can Skip specific to Compositor] -# How to keep track of failed tests. -# Every blend file will run the test script and no memory. -# For compositor, it only tells which directory has a failed test, not the exact file name -# Pre-decide on the name of the test object and expected object ? Default name of the modifier? -# Should I make it generic for any modifier or just geometry nodes? - +# Edit Cmake to iterate over directories. ### RUN TEST COMMAND ### -# blender -b path_to_blend_file --python path/to/geo_node_test.py +# blender -b path_to_blend_file --python path/to/geo_node_test.py -- [--first-time] import bpy import os +import sys + -def get_objects(): +def get_test_object(): +""" +Get test object or raise Exception. +""" try: -test_object = bpy.data.objects["test_obj"] -except: +test_object = bpy.data.objects["test_object"] +except KeyError: raise Exception("No test object found!") +return test_object + + +def get_expected_object(): +""" +Get expected object or raise Exception. +""" try: -expected_object = bpy.data.objects["expected_obj"] -except: +expected_object = bpy.data.objects["expected_object"] +except KeyError: raise Exception("No expected object found!") -return [test_object, expected_object] +return expected_object -def apply_modifier(evaluated_object): + +def select_the_object(any_object): """ -Apply all modifiers added to the current object [Discuss] +Select the given object. """ bpy.ops.object.mode_set(mode="OBJECT") bpy.ops.object.select_all(action="DESELECT") -bpy.context.view_layer.objects.active = evaluated_object - +bpy.context.view_layer.objects.active = any_object + +return any_object + + +def remove_modifiers_from_object(any_object): +""" +Remove modifiers from the selected object. +""" +any_object = select_the_object(any_object) +modifier_list = list(any_object.modifiers) +for modifier in modifier_list: +bpy.ops.object.modifier_remove(modifier=modifier.name) +return any_object + + +def run_first_time(): +""" +Automatically creates the expected object when script +is run with argument "--first-time"
[Bf-blender-cvs] [5dc85773eb1] soc-2021-geometry-nodes-regression-test: Merge branch 'master' into soc-2021-geometry-nodes-regression-test
Commit: 5dc85773eb159d5439a0dc1a89dcc16c19c29528 Author: Himanshi Kalra Date: Tue Jun 15 23:30:14 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB5dc85773eb159d5439a0dc1a89dcc16c19c29528 Merge branch 'master' into soc-2021-geometry-nodes-regression-test === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [225f638afd4] soc-2021-geometry-nodes-regression-test: Created a script for running blend file with pre-loaded modifier
Commit: 225f638afd4a1820c2d71aff61f598282c6a6aad Author: Himanshi Kalra Date: Thu Jun 10 16:29:13 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB225f638afd4a1820c2d71aff61f598282c6a6aad Created a script for running blend file with pre-loaded modifier === M tests/python/CMakeLists.txt A tests/python/geo_node_test.py === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 92cebb7d274..e7ce78a1d59 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -740,6 +740,21 @@ if(WITH_COMPOSITOR) endif() +set(geo_node_tests + geometry + mesh + points +) + +foreach(geo_node_test ${geo_node_tests}) + + add_blender_test( +geo_node_${geo_node_test}_test +${TEST_SRC_DIR}/geometry_nodes/${geo_node_test} +--python ${TEST_PYTHON_DIR}/geo_node_test.py + ) +endforeach() + if(WITH_OPENGL_DRAW_TESTS) if(NOT OPENIMAGEIO_IDIFF) MESSAGE(STATUS "Disabling OpenGL draw tests because OIIO idiff does not exist") diff --git a/tests/python/geo_node_test.py b/tests/python/geo_node_test.py new file mode 100644 index 000..a684aeaf54d --- /dev/null +++ b/tests/python/geo_node_test.py @@ -0,0 +1,113 @@ +# Load a blend file +# Select the object +# Apply the GN modifier on a duplicated object +# Compare the result +# If test pass, print("SUCESS") +# If test fail, print("FAIL") +# Update tests if BLENDER_TEST_UPDATE flag is set. +# Display result of failed tests [?] + +# Code to be re-used from Mesh Test +# Depending on what all we want to use + ## the mesh comparison code + ## -- run-test code +# Code to be re-used from a Compositor + ## Edit Cmake to iterate over directories. + +### Questions ### +# Usage of __slots__ (only getting save memory, optimize) [Can Skip specific to Compositor] +# How to keep track of failed tests. +# Every blend file will run the test script and no memory. +# For compositor, it only tells which directory has a failed test, not the exact file name +# Pre-decide on the name of the test object and expected object ? Default name of the modifier? +# Should I make it generic for any modifier or just geometry nodes? + + +### RUN TEST COMMAND ### +# blender -b path_to_blend_file --python path/to/geo_node_test.py + +import bpy +import os + +def get_objects(): +try: +test_object = bpy.data.objects["test_obj"] +except: +raise Exception("No test object found!") +try: +expected_object = bpy.data.objects["expected_obj"] +except: +raise Exception("No expected object found!") +return [test_object, expected_object] + +def apply_modifier(evaluated_object): +""" +Apply all modifiers added to the current object [Discuss] +""" +bpy.ops.object.mode_set(mode="OBJECT") +bpy.ops.object.select_all(action="DESELECT") +bpy.context.view_layer.objects.active = evaluated_object + +modifiers_list = evaluated_object.modifiers + +if modifiers_list[0].type == "NODES": +bpy.ops.object.modifier_apply(modifier=modifiers_list[0].name) +else: +raise Exception("Modifier not of Geometry Nodes type") +return evaluated_object + + +def compare_mesh(evaluated_object, expected_object): +evaluated_data = evaluated_object.data +exp_data = expected_object.data +result = evaluated_data.unit_test_compare(mesh=exp_data) +if result == "Same": +print("PASS") +else: +failed_test(evaluated_object, expected_object, result) + +def passed_test(): +pass + +def failed_test(evaluated_object, expected_object, result): +""" +[Need discussion] +""" +update_test_flag = os.getenv('BLENDER_TEST_UPDATE') is not None +if not update_test_flag: +print("Test failed with {}".format(result)) +return + +evaluated_object.location = expected_object.location +expected_object_name = expected_object.name +bpy.data.objects.remove(expected_object, do_unlink=True) +evaluated_object.name = expected_object_name + +# Save file. +bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) + +print("The test file was updated with new expected object") +print("The blend file was saved.") + +def duplicate_test_object(test_object): +# Duplicate test object. +bpy.ops.object.mode_set(mode="OBJECT") +bpy.ops.object.select_all(action="DESELECT") +bpy.context.view_layer.objects.active = test_object + +test_object.select_set(True) +bpy.ops.object.duplicate() +evaluated_object = bpy.context.active_object +evaluated_object.name = "
[Bf-blender-cvs] [fd25c2c59a0] soc-2021-geometry-nodes-regression-test: Added a loop to add each category geo_node tests
Commit: fd25c2c59a09e1cf0a01a4fcf645b8c7bc2e8aa3 Author: Himanshi Kalra Date: Fri Jun 11 16:22:19 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rBfd25c2c59a09e1cf0a01a4fcf645b8c7bc2e8aa3 Added a loop to add each category geo_node tests Each geometry node test is an individual test. It can be run separately by ctest command. For example ctest -R geo_node_mesh This will run all mesh tests. The extra overhead is each test adds to the total tests. === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index e7ce78a1d59..aa797297b26 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -748,11 +748,15 @@ set(geo_node_tests foreach(geo_node_test ${geo_node_tests}) - add_blender_test( -geo_node_${geo_node_test}_test -${TEST_SRC_DIR}/geometry_nodes/${geo_node_test} ---python ${TEST_PYTHON_DIR}/geo_node_test.py - ) + file(GLOB files "${TEST_SRC_DIR}/geometry_nodes/${geo_node_test}/*.blend") + foreach(file ${files}) +get_filename_component(filename ${file} NAME_WE) +add_blender_test( + geo_node_${geo_node_test}_test_${filename} + ${file} + --python ${TEST_PYTHON_DIR}/geo_node_test.py +) +endforeach() endforeach() if(WITH_OPENGL_DRAW_TESTS) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [10ace20bcff] soc-2021-geometry-nodes-regression-test: Created a script for running blend file with pre-loaded modifier
Commit: 10ace20bcfff6d006d3d744c6a9b1e199f70e347 Author: Himanshi Kalra Date: Tue Jun 15 14:07:52 2021 +0530 Branches: soc-2021-geometry-nodes-regression-test https://developer.blender.org/rB10ace20bcfff6d006d3d744c6a9b1e199f70e347 Created a script for running blend file with pre-loaded modifier Added a loop to add each category geo_node tests Each geometry node test is an individual test. It can be run separately by ctest command. For example ctest -R geo_node_mesh This will run all mesh tests. The extra overhead is each test adds to the total tests. Updated the script, adding support for cmd arguments Added exception errors for try except, formatting, adding comments Improved the workflow, updated error messages. Re-running of the test after BLENDER_TEST_UPDATE. Merge branch 'geo-node-testing' into soc-2021-geometry-nodes-regression-test Differential Revision: https://developer.blender.org/D11611 === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7134b9dacad] master: Added Operator tests: unsubdivide, shading, vertex connect and mark seam
Commit: 7134b9dacadb933f884ffdbb1e5f433839dc47f2 Author: Himanshi Kalra Date: Thu Apr 29 19:59:11 2021 +0530 Branches: master https://developer.blender.org/rB7134b9dacadb933f884ffdbb1e5f433839dc47f2 Added Operator tests: unsubdivide, shading, vertex connect and mark seam Added tests for: * Mark Seam * Shade flat * Shade smooth * Unsubdivide * Vertex Connect Path * select nth (Checkered Deselect) Notes: 1) Shade flat, shade smooth are base test cases (to check mesh doesn't change for real) Updated blend file: tests/modeling/operators.blend Reviewed By: zazizizou, mont29 Differential Revision: https://developer.blender.org/D10893 === M tests/python/operators.py === diff --git a/tests/python/operators.py b/tests/python/operators.py index 309a872ac67..4c863edfbdb 100644 --- a/tests/python/operators.py +++ b/tests/python/operators.py @@ -196,6 +196,14 @@ def main(): MeshTest("SphereFillHoles", "testSphereFillHoles", "expectedSphereFillHoles", [OperatorSpecEditMode("fill_holes", {"sides": 9}, "VERT", {i for i in range(481)})]), +# face shade smooth (not a real test) +MeshTest("CubeShadeSmooth", "testCubeShadeSmooth", "expectedCubeShadeSmooth", + [OperatorSpecEditMode("faces_shade_smooth", {}, "VERT", {i for i in range(8)})]), + +# faces shade flat (not a real test) +MeshTest("CubeShadeFlat", "testCubeShadeFlat", "expectedCubeShadeFlat", + [OperatorSpecEditMode("faces_shade_flat", {}, "FACE", {i for i in range(6)})]), + # inset faces MeshTest("CubeInset", "testCubeInset", "expectedCubeInset", [OperatorSpecEditMode("inset", {"thickness": 0.2}, "VERT", @@ -226,6 +234,10 @@ def main(): MeshTest("EmptyMeshLoopMultiSelect", "testEmptyMeshLoopMultiSelect", "expectedEmptyMeshLoopMultiSelect", [OperatorSpecEditMode("loop_multi_select", {}, "VERT", {})]), +# mark seam +MeshTest("CubeMarkSeam", "testCubeMarkSeam", "expectedCubeMarkSeam", + [OperatorSpecEditMode("mark_seam", {}, "EDGE", {1})]), + # select all MeshTest("CircleSelectAll", "testCircleSelectAll", "expectedCircleSelectAll", [OperatorSpecEditMode("select_all", {}, "VERT", {1})]), @@ -296,6 +308,26 @@ def main(): MeshTest("EmptyMeshSelectLinked", "testEmptyMeshSelectLinked", "expectedEmptyMeshSelectLinked", [OperatorSpecEditMode("select_linked", {}, "VERT", {})]), +# select nth (checkered deselect) +MeshTest("CircleSelect2nd", "testCircleSelect2nd", "expectedCircleSelect2nd", + [OperatorSpecEditMode("select_nth", {}, "VERT", {i for i in range(32)})]), + +# unsubdivide +# normal case +MeshTest("CubeFaceUnsubdivide", "testCubeUnsubdivide", "expectedCubeUnsubdivide", + [OperatorSpecEditMode("unsubdivide", {}, "FACE", {i for i in range(6)})]), + +# T87259 - test cases +MeshTest("CubeEdgeUnsubdivide", "testCubeEdgeUnsubdivide", "expectedCubeEdgeUnsubdivide", + [OperatorSpecEditMode("unsubdivide", {}, "EDGE", {i for i in range(6)})]), +MeshTest("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. +MeshTest("CubeVertConnectPath", "testCubeVertConnectPath", "expectedCubeVertConnectPath", + [OperatorSpecEditMode("vert_connect_path", {}, "VERT", {0, 5})]), + ] operators_test = RunTest(tests) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [72411048772] master: Enabled Physics Particle Instance test
Commit: 724110487721226812a111cb147b85622f2c19e4 Author: Himanshi Kalra Date: Tue Jan 5 16:16:08 2021 +0530 Branches: master https://developer.blender.org/rB724110487721226812a111cb147b85622f2c19e4 Enabled Physics Particle Instance test === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index acf8010d13c..f33bb81d6b0 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -245,14 +245,13 @@ add_blender_test( --run-all-tests ) -# Particle Instance disabling currently broken in master -# add_blender_test( -# physics_particle_instance -# ${TEST_SRC_DIR}/physics/physics_particle_instance.blend -# --python ${TEST_PYTHON_DIR}/physics_particle_instance.py -# -- -# --run-all-tests -# ) +add_blender_test( + physics_particle_instance + ${TEST_SRC_DIR}/physics/physics_particle_instance.blend + --python ${TEST_PYTHON_DIR}/physics_particle_instance.py + -- + --run-all-tests +) add_blender_test( constraints ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e7b698327cd] master: Updated and extended Regression Testing frameworks (Gsoc 2020)
Commit: e7b698327cd91b371ff4fd43d1c117637224fded Author: Himanshi Kalra Date: Thu Dec 17 20:44:55 2020 +0530 Branches: master https://developer.blender.org/rBe7b698327cd91b371ff4fd43d1c117637224fded Updated and extended Regression Testing frameworks (Gsoc 2020) This revision contains the following changes- - Updated the existing testing framework for Modifiers for Regression Testing. - Tests for Physics modifiers and remaining Generate and Deform modifiers are added. - The existing `ModifierSpec` is updated with backward compatibility to support Physics Modifiers. - Now there is support for frame number and giving nested parameters for attributes. - Some Deform modifiers required Object Operators, e.g. "Bind" in Mesh Deform, so a new class was added to support that functionality. - A separate class for holding Particles System, they are tested by converting all the particles to mesh and joining it to the mesh they were added. - Updated the format to add tests for Bevel, Boolean and Operators as well. Reviewed By: zazizizou, mont29, campbellbarton Differential Revision: https://developer.blender.org/D8507 === M tests/python/CMakeLists.txt M tests/python/bevel_operator.py M tests/python/boolean_operator.py A tests/python/deform_modifiers.py M tests/python/modifiers.py M tests/python/modules/mesh_test.py M tests/python/operators.py M tests/python/physics_cloth.py A tests/python/physics_dynamic_paint.py A tests/python/physics_ocean.py A tests/python/physics_particle_instance.py A tests/python/physics_particle_system.py M tests/python/physics_softbody.py === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 97f5df3ec09..bf949d66286 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -204,6 +204,48 @@ add_blender_test( --run-all-tests ) +add_blender_test( + physics_dynamic_paint + ${TEST_SRC_DIR}/physics/dynamic_paint_test.blend + --python ${TEST_PYTHON_DIR}/physics_dynamic_paint.py + -- + --run-all-tests +) + +add_blender_test( + deform_modifiers + ${TEST_SRC_DIR}/modeling/deform_modifiers.blend + --python ${TEST_PYTHON_DIR}/deform_modifiers.py + -- + --run-all-tests +) + +add_blender_test( + physics_ocean + ${TEST_SRC_DIR}/physics/ocean_test.blend + --python ${TEST_PYTHON_DIR}/physics_ocean.py + -- + --run-all-tests +) + + +add_blender_test( + physics_particle_system + ${TEST_SRC_DIR}/physics/physics_particle_test.blend + --python ${TEST_PYTHON_DIR}/physics_particle_system.py + -- + --run-all-tests +) + +# Particle Instance disabling currently broken in master +# add_blender_test( +# physics_particle_instance +# ${TEST_SRC_DIR}/physics/physics_particle_instance.blend +# --python ${TEST_PYTHON_DIR}/physics_particle_instance.py +# -- +# --run-all-tests +# ) + add_blender_test( constraints --python ${CMAKE_CURRENT_LIST_DIR}/bl_constraints.py diff --git a/tests/python/bevel_operator.py b/tests/python/bevel_operator.py index 50f52b958f7..c732d437b57 100644 --- a/tests/python/bevel_operator.py +++ b/tests/python/bevel_operator.py @@ -27,151 +27,287 @@ import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import OperatorTest +from modules.mesh_test import MeshTest, OperatorSpecEditMode, RunTest def main(): tests = [ # 0 -['EDGE', {10}, 'Cube_test', 'Cube_result_1', 'bevel', {'offset': 0.2}], -['EDGE', {10, 7}, 'Cube_test', 'Cube_result_2', 'bevel', {'offset': 0.2, 'offset_type': 'WIDTH'}], -['EDGE', {8, 10, 7}, 'Cube_test', 'Cube_result_3', 'bevel', {'offset': 0.2, 'offset_type': 'DEPTH'}], -['EDGE', {10}, 'Cube_test', 'Cube_result_4', 'bevel', {'offset': 0.4, 'segments': 2}], -['EDGE', {10, 7}, 'Cube_test', 'Cube_result_5', 'bevel', {'offset': 0.4, 'segments': 3}], +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', {'of
[Bf-blender-cvs] [2d0c84cf765] soc-2020-testing-frameworks: Merge branch 'master' into soc-2020-testing-frameworks
Commit: 2d0c84cf765b62cf902fdc1852e68dd8ae5b0d52 Author: Himanshi Kalra Date: Thu Dec 17 20:37:01 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB2d0c84cf765b62cf902fdc1852e68dd8ae5b0d52 Merge branch 'master' into soc-2020-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6e60b3cf596] soc-2020-testing-frameworks: Updated frame end value for Build modifier, now shows non-empty mesh in blend file
Commit: 6e60b3cf5965e2c8b82d243819271a15a7a4c677 Author: Himanshi Kalra Date: Thu Dec 17 17:33:07 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB6e60b3cf5965e2c8b82d243819271a15a7a4c677 Updated frame end value for Build modifier, now shows non-empty mesh in blend file === M tests/python/modifiers.py === diff --git a/tests/python/modifiers.py b/tests/python/modifiers.py index 09d12cc5e47..24f71c4066d 100644 --- a/tests/python/modifiers.py +++ b/tests/python/modifiers.py @@ -47,7 +47,7 @@ def get_generate_modifiers_list(test_object_name, randomize=False): ModifierSpec('array', 'ARRAY', {}), ModifierSpec('bevel', 'BEVEL', {'width': 0.1}), ModifierSpec('boolean', 'BOOLEAN', {'object': boolean_test_object, 'solver': 'FAST'}), -ModifierSpec('build', 'BUILD', {'frame_start': 0, 'frame_duration': 1}), +ModifierSpec('build', 'BUILD', {'frame_start': 1, 'frame_duration': 1}, 2), ModifierSpec('decimate', 'DECIMATE', {}), ModifierSpec('edge split', 'EDGE_SPLIT', {}), @@ -167,7 +167,7 @@ def main(): 'offset_object': bpy.data.objects["testRadialArrayHelper"]})]), MeshTest("CylinderBuild", "testCylinderBuild", "expectedCylinderBuild", - [ModifierSpec('build', 'BUILD', {'frame_start': 0, 'frame_duration': 1})]), + [ModifierSpec('build', 'BUILD', {'frame_start': 1, 'frame_duration': 1}, 2)]), # 17 MeshTest("ConeDecimate", "testConeDecimate", "expectedConeDecimate", @@ -289,7 +289,7 @@ def main(): [ModifierSpec('bevel', 'BEVEL', {})]), MeshTest("CurveBuild", "testObjBezierCurveBuild", "expObjBezierCurveBuild", - [ModifierSpec('build', 'BUILD', {'frame_start': 0, 'frame_duration': 1})]), + [ModifierSpec('build', 'BUILD', {'frame_start': 1, 'frame_duration': 1}, 2)]), MeshTest("CurveDecimate", "testObjBezierCurveDecimate", "expObjBezierCurveDecimate", [ModifierSpec('decimate', 'DECIMATE', {'ratio': 0.5})]), ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [167eace0e73] soc-2020-testing-frameworks: Merge branch 'master' into soc-2020-testing-frameworks
Commit: 167eace0e73bef77cf362af04f1f0dd47c492a92 Author: Himanshi Kalra Date: Thu Dec 17 17:36:26 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB167eace0e73bef77cf362af04f1f0dd47c492a92 Merge branch 'master' into soc-2020-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f066bf923c2] soc-2020-testing-frameworks: Disabling particle instance modifier test
Commit: f066bf923c234f52a6159d51f4978bf1072edaf1 Author: Himanshi Kalra Date: Thu Dec 17 17:34:44 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBf066bf923c234f52a6159d51f4978bf1072edaf1 Disabling particle instance modifier test === M tests/python/CMakeLists.txt === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index a36148012ac..bf949d66286 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -237,13 +237,14 @@ add_blender_test( --run-all-tests ) -add_blender_test( - physics_particle_instance - ${TEST_SRC_DIR}/physics/physics_particle_instance.blend - --python ${TEST_PYTHON_DIR}/physics_particle_instance.py - -- - --run-all-tests -) +# Particle Instance disabling currently broken in master +# add_blender_test( +# physics_particle_instance +# ${TEST_SRC_DIR}/physics/physics_particle_instance.blend +# --python ${TEST_PYTHON_DIR}/physics_particle_instance.py +# -- +# --run-all-tests +# ) add_blender_test( constraints ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [098be40b53f] soc-2020-testing-frameworks: Removed unused variable modifier_copy
Commit: 098be40b53fa8bcf9fcae6d2c77e949873340602 Author: Himanshi Kalra Date: Wed Dec 16 12:53:31 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB098be40b53fa8bcf9fcae6d2c77e949873340602 Removed unused variable modifier_copy === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 1aa6aac80bf..6671918a206 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -320,9 +320,8 @@ class MeshTest: Wrapper for _set_parameters_util """ settings = [] -modifier_copy = modifier modifier_name = modifier.name -self._set_parameters_impl(modifier_copy, modifier_parameters, settings, modifier_name) +self._set_parameters_impl(modifier, modifier_parameters, settings, modifier_name) def _add_modifier(self, test_object, modifier_spec: ModifierSpec): """ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [191ab5990b8] soc-2020-testing-frameworks: Resolved a merge conflict related to the threshold of Weld modifier
Commit: 191ab5990b87373819165e84a105fd4d6695b671 Author: Himanshi Kalra Date: Sun Sep 27 16:32:24 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB191ab5990b87373819165e84a105fd4d6695b671 Resolved a merge conflict related to the threshold of Weld modifier === === diff --cc tests/python/modifiers.py index 7d76ff47a46,ba156cef8ea..09d12cc5e47 --- a/tests/python/modifiers.py +++ b/tests/python/modifiers.py @@@ -148,90 -134,62 +148,92 @@@ def main() # One 'Generate' modifier on primitive meshes # # 12 -["testCubeArray", "expectedCubeArray", [ModifierSpec('array', 'ARRAY', {})]], -["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"]})]], -["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)})]], -["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"]})]], - -["testCylinderBuild", "expectedCylinderBuild", [ModifierSpec('build', 'BUILD', {'frame_start': 0, 'frame_duration': 1})]], +MeshTest("CubeArray", "testCubeArray", "expectedCubeArray", + [ModifierSpec('array', 'ARRAY', {})]), +MeshTest("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"]})]), +MeshTest("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)})]), +MeshTest("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"]})]), + +MeshTest("CylinderBuild", "testCylinderBuild", "expectedCylinderBuild", + [ModifierSpec('build', 'BUILD', {'frame_start': 0, 'frame_duration': 1})]), # 17 -["testConeDecimate", "expectedConeDecimate", [ModifierSpec('decimate', 'DECIMATE', {'ratio': 0.5})]], -["testCubeEdgeSplit", "expectedCubeEdgeSplit", [ModifierSpec('edge split', 'EDGE_SPLIT', {})]], - -["testSphereMirror", "expectedSphereMirror", [ModifierSpec('mirror', 'MIRROR', {})]], -["testLocalMirror", "expectedLocalMirror", - [ModifierSpec('mirror', 'MIRROR', {'use_clip': True})]], -["testObjectOffsetMirror", "expectedObjectOffsetMirror", - [ModifierSpec('mirror', 'MIRROR', {'mirror_object': bpy.data.objects["testObjectOffsetMirrorHelper"]})]], - -["testCylinderMask", "expectedCylinderMask", [ModifierSpec('mask', 'MASK', {'vertex_group': "mask_vertex_group"})]], -["testConeMultiRes", "expectedConeMultiRes", [ModifierSpec('multires', 'MULTIRES', {})]], +MeshTest("ConeDecimate", "testConeDecimate", "expectedConeDecimate", + [ModifierSpec('decimate', 'DECIMATE', {'ratio': 0.5})]), +MeshTest("CubeEdgeSplit", "testCubeEdg
[Bf-blender-cvs] [30021b04161] soc-2020-testing-frameworks: Merge branch 'master' into soc-2021-testing-frameworks
Commit: 30021b041616f10e624409b745970baeded8dbd7 Author: Himanshi Kalra Date: Tue Dec 15 22:37:12 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB30021b041616f10e624409b745970baeded8dbd7 Merge branch 'master' into soc-2021-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1e41a9a86be] soc-2020-testing-frameworks: Post Review: fix coding styles, remove try..except, using value for enumerate
Commit: 1e41a9a86be8366d60f561080b8a42a5f411e90b Author: Himanshi Kalra Date: Tue Dec 15 22:18:41 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB1e41a9a86be8366d60f561080b8a42a5f411e90b Post Review: fix coding styles, remove try..except, using value for enumerate === M tests/python/modules/mesh_test.py M tests/python/physics_particle_instance.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 997a959ac17..1aa6aac80bf 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -169,14 +169,14 @@ class MeshTest: """ def __init__( -self, -test_name: str, -test_object_name: str, -expected_object_name: str, -operations_stack=None, -apply_modifiers=False, -do_compare=False, -threshold=None +self, +test_name: str, +test_object_name: str, +expected_object_name: str, +operations_stack=None, +apply_modifiers=False, +do_compare=False, +threshold=None ): """ Constructs a MeshTest object. Raises a KeyError if objects with names expected_object_name @@ -275,34 +275,34 @@ class MeshTest: """ return self._test_updated -def _set_parameters_util(self, modifier, modifier_parameters, nested_settings_path, modifier_name): +def _set_parameters_impl(self, modifier, modifier_parameters, nested_settings_path, modifier_name): """ Doing a depth first traversal of the modifier parameters and setting their values. -:param: modifier: Of type modifier, its altered to become a setting in recursion -:param: modifier_parameters : dict, a simple/nested dictionary of modifier parameters. +:param: modifier: Of type modifier, its altered to become a setting in recursion. +:param: modifier_parameters : dict or sequence, a simple/nested dictionary of modifier parameters. :param: nested_settings_path : list(stack): helps in tracing path to each node. """ if not isinstance(modifier_parameters, dict): param_setting = None for i, setting in enumerate(nested_settings_path): -try: -# We want to set the attribute only when we have reached the last setting -# Applying of intermediate settings is meaningless. -if i == len(nested_settings_path) - 1: -setattr(modifier, setting, modifier_parameters) +# We want to set the attribute only when we have reached the last setting. +# Applying of intermediate settings is meaningless. +if i == len(nested_settings_path) - 1: +setattr(modifier, setting, modifier_parameters) + +elif hasattr(modifier, setting): +param_setting = getattr(modifier, setting) +# getattr doesn't accept canvas_surfaces["Surface"], but we need to pass it to setattr. +if setting == "canvas_surfaces": +modifier = param_setting.active else: -param_setting = getattr(modifier, setting) -# getattr doesn't accept canvas_surfaces["Surface"], but we need to pass it to setattr -if setting == "canvas_surfaces": -modifier = param_setting.active -else: -modifier = param_setting -except AttributeError: +modifier = param_setting +else: # Clean up first bpy.ops.object.delete() -raise AttributeError("Modifier '{}' has no parameter named '{}'". - format(modifier_name, setting)) +raise Exception("Modifier '{}' has no parameter named '{}'". +format(modifier_name, setting)) # It pops the current node before moving on to its sibling. nested_settings_path.pop() @@ -310,9 +310,9 @@ class MeshTest: for key in modifier_parameters: nested_settings_path.append(key) -self._set_parameters_util(modifier, modifier_parameters[key], nested_settings_path, modifier_name) +self._set_parameters_impl(modifier, modifier_parameters[key], nested_settings_path, modifier_name) -if len(nested_settings_path) != 0: +if nested_
[Bf-blender-cvs] [77cde6f1a10] soc-2020-testing-frameworks: Resolved merge conflict, reformatted, break long lines, parameters
Commit: 77cde6f1a104f19c1ad49d78314e56f086a302a6 Author: Himanshi Kalra Date: Tue Dec 1 01:19:01 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB77cde6f1a104f19c1ad49d78314e56f086a302a6 Resolved merge conflict, reformatted, break long lines, parameters === === diff --cc tests/python/modules/mesh_test.py index bd916df7251,c85e7acf4e8..997a959ac17 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@@ -168,8 -128,14 +168,16 @@@ class MeshTest the public method run_test(). """ - def __init__(self, test_name: str, test_object_name: str, expected_object_name: str, operations_stack=None, - apply_modifiers=False, do_compare=False, threshold=None): + def __init__( + self, ++test_name: str, + test_object_name: str, + expected_object_name: str, + operations_stack=None, + apply_modifiers=False, -threshold=None, ++do_compare=False, ++threshold=None + ): """ Constructs a MeshTest object. Raises a KeyError if objects with names expected_object_name or test_object_name don't exist. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5b7c6217876] soc-2020-testing-frameworks: Merge branch 'master' into soc-2021-testing-frameworks
Commit: 5b7c6217876fdd95f2d02af6cb08dfe6b0315c11 Author: Himanshi Kalra Date: Tue Dec 8 20:56:55 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB5b7c6217876fdd95f2d02af6cb08dfe6b0315c11 Merge branch 'master' into soc-2021-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6196b6df926] soc-2020-testing-frameworks: Added misisng space before parameter type in doc string
Commit: 6196b6df926cbb69fc0ed655b6135f7d9d5fa080 Author: Himanshi Kalra Date: Sun Sep 27 16:22:12 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB6196b6df926cbb69fc0ed655b6135f7d9d5fa080 Added misisng space before parameter type in doc string === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index b9be8681e7f..bd916df7251 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -62,7 +62,7 @@ class ModifierSpec: :param modifier_name: str - name of object modifier, e.g. "myFirstSubsurfModif" :param modifier_type: str - type of object modifier, e.g. "SUBSURF" :param modifier_parameters: dict - {name : val} dictionary giving modifier parameters, e.g. {"quality" : 4} -:param frame_end:int - frame at which simulation needs to be baked or modifier needs to be applied. +:param frame_end: int - frame at which simulation needs to be baked or modifier needs to be applied. """ self.modifier_name = modifier_name self.modifier_type = modifier_type @@ -85,7 +85,7 @@ class ParticleSystemSpec: :param modifier_name: str - name of object modifier, e.g. "Particles" :param modifier_type: str - type of object modifier, e.g. "PARTICLE_SYSTEM" :param modifier_parameters: dict - {name : val} dictionary giving modifier parameters, e.g. {"seed" : 1} -:param frame_end:int - the last frame of the simulation at which the modifier is applied +:param frame_end: int - the last frame of the simulation at which the modifier is applied """ self.modifier_name = modifier_name self.modifier_type = modifier_type ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fcf73377488] soc-2020-testing-frameworks: Post Review: Minor fixes, renaming, removing confuisng comments
Commit: fcf733774880eac8b0e733bb397efd356b376d76 Author: Himanshi Kalra Date: Mon Sep 7 02:51:42 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBfcf733774880eac8b0e733bb397efd356b376d76 Post Review: Minor fixes, renaming, removing confuisng comments === M tests/python/modules/mesh_test.py M tests/python/physics_cloth.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index e6937af3509..b9be8681e7f 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -130,7 +130,6 @@ class OperatorSpecObjectMode: def __init__(self, operator_name: str, operator_parameters: dict): """ -Constructs an Object Operator spec :param operator_name: str - name of the object operator from bpy.ops.object, e.g. "shade_smooth" or "shape_keys" :param operator_parameters: dict - contains operator parameters. """ @@ -422,7 +421,7 @@ class MeshTest: if self.apply_modifier: self._apply_modifier(test_object, particle_sys_spec.modifier_name) -def _apply_operator(self, test_object, operator: OperatorSpecEditMode): +def _apply_operator_edit_mode(self, test_object, operator: OperatorSpecEditMode): """ Apply operator on test object. :param test_object: bpy.types.Object - Blender object to apply operator on. @@ -466,7 +465,7 @@ class MeshTest: bpy.ops.object.mode_set(mode='OBJECT') -def _apply_object_operator(self, operator: OperatorSpecObjectMode): +def _apply_operator_object_mode(self, operator: OperatorSpecObjectMode): """ Applies the object operator. """ @@ -502,7 +501,7 @@ class MeshTest: modifier_names.append(modifier_operations.modifier_name) if isinstance(object_operations, OperatorSpecObjectMode): -self._apply_object_operator(object_operations) +self._apply_operator_object_mode(object_operations) print("NAME", list(test_object.modifiers)) @@ -542,10 +541,10 @@ class MeshTest: self._apply_modifier(evaluated_test_object, operation.modifier_name) elif isinstance(operation, OperatorSpecEditMode): -self._apply_operator(evaluated_test_object, operation) +self._apply_operator_edit_mode(evaluated_test_object, operation) elif isinstance(operation, OperatorSpecObjectMode): -self._apply_object_operator(operation) +self._apply_operator_object_mode(operation) elif isinstance(operation, DeformModifierSpec): self._apply_deform_modifier(evaluated_test_object, operation) diff --git a/tests/python/physics_cloth.py b/tests/python/physics_cloth.py index c1af01be17d..b88b4d63f9d 100644 --- a/tests/python/physics_cloth.py +++ b/tests/python/physics_cloth.py @@ -30,7 +30,6 @@ from modules.mesh_test import RunTest, ModifierSpec, MeshTest def main(): test = [ -# Make sure no modifier is added on the test object. MeshTest("ClothSimple", "testClothPlane", "expectedClothPlane", [ModifierSpec('Cloth', 'CLOTH', {'settings': {'quality': 5}}, 15)], threshold=1e-3), ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [14efcadcb23] soc-2020-testing-frameworks: Merge branch 'master' into soc-2021-testing-frameworks
Commit: 14efcadcb2398ac5c5f4ce144ba9be5f8f8e115a Author: Himanshi Kalra Date: Thu Sep 17 02:09:37 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB14efcadcb2398ac5c5f4ce144ba9be5f8f8e115a Merge branch 'master' into soc-2021-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [07e11b54ab5] soc-2020-testing-frameworks: Added a new compare flag `do_compare` for run-test
Commit: 07e11b54ab5578f65310b9bd5bd7c34b26fb23bc Author: Himanshi Kalra Date: Sun Sep 6 18:07:08 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB07e11b54ab5578f65310b9bd5bd7c34b26fb23bc Added a new compare flag `do_compare` for run-test do_compare is set to False if no comparison is needed, like when running run-test for investigation purpose === M tests/python/bevel_operator.py M tests/python/boolean_operator.py M tests/python/deform_modifiers.py M tests/python/modifiers.py M tests/python/modules/mesh_test.py M tests/python/operators.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/bevel_operator.py b/tests/python/bevel_operator.py index b9ea6f6b4d0..c732d437b57 100644 --- a/tests/python/bevel_operator.py +++ b/tests/python/bevel_operator.py @@ -301,12 +301,12 @@ def main(): command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": -operator_test.apply_modifiers = True +operator_test.do_compare = True operator_test.run_all_tests() break elif cmd == "--run-test": name = command[i + 1] -operator_test.apply_modifiers = False +operator_test.do_compare = False operator_test.run_test(name) break diff --git a/tests/python/boolean_operator.py b/tests/python/boolean_operator.py index 0c66648ab68..0db6a074699 100644 --- a/tests/python/boolean_operator.py +++ b/tests/python/boolean_operator.py @@ -69,12 +69,12 @@ def main(): command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": -operator_test.apply_modifiers = True +operator_test.do_compare = True operator_test.run_all_tests() break elif cmd == "--run-test": name = command[i + 1] -operator_test.apply_modifiers = False +operator_test.do_compare = False operator_test.run_test(name) break diff --git a/tests/python/deform_modifiers.py b/tests/python/deform_modifiers.py index 1642cdb6ac1..7c4ea457e9d 100644 --- a/tests/python/deform_modifiers.py +++ b/tests/python/deform_modifiers.py @@ -108,10 +108,12 @@ command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": deform_tests.apply_modifiers = True +deform_tests.do_compare = True deform_tests.run_all_tests() break elif cmd == "--run-test": deform_tests.apply_modifiers = False +deform_tests.do_compare = False name = command[i + 1] deform_tests.run_test(name) break diff --git a/tests/python/modifiers.py b/tests/python/modifiers.py index d038dc5e632..7d76ff47a46 100644 --- a/tests/python/modifiers.py +++ b/tests/python/modifiers.py @@ -349,10 +349,12 @@ def main(): for i, cmd in enumerate(command): if cmd == "--run-all-tests": modifiers_test.apply_modifiers = True +modifiers_test.do_compare = True modifiers_test.run_all_tests() break elif cmd == "--run-test": modifiers_test.apply_modifiers = False +modifiers_test.do_compare = False name = command[i + 1] modifiers_test.run_test(name) break diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index c19ff3c7e99..e6937af3509 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -170,7 +170,7 @@ class MeshTest: """ def __init__(self, test_name: str, test_object_name: str, expected_object_name: str, operations_stack=None, - apply_modifiers=False, threshold=None): + apply_modifiers=False, do_compare=False, threshold=None): """ Constructs a MeshTest object. Raises a KeyError if objects with names expected_object_name or test_object_name don't exist. @@ -182,6 +182,7 @@ class MeshTest: :param apply_modifiers: bool - True if we want to apply the modifiers right after adding them to the object. - True if we want to apply the modifier to a list of modifiers, after some operation. This affects operations of type ModifierSpec and DeformModifierSpec. +:param do_compare: bool - True if we want to compare the tes
[Bf-blender-cvs] [685609c5ea7] soc-2020-testing-frameworks: Added apply_modifiers flag for run-test and run-all-tests
Commit: 685609c5ea7be4f30d55f584931516b43fb95992 Author: Himanshi Kalra Date: Sun Sep 6 16:38:01 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB685609c5ea7be4f30d55f584931516b43fb95992 Added apply_modifiers flag for run-test and run-all-tests === M tests/python/bevel_operator.py M tests/python/boolean_operator.py M tests/python/operators.py === diff --git a/tests/python/bevel_operator.py b/tests/python/bevel_operator.py index b1767e63ad6..b9ea6f6b4d0 100644 --- a/tests/python/bevel_operator.py +++ b/tests/python/bevel_operator.py @@ -301,10 +301,12 @@ def main(): command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": +operator_test.apply_modifiers = True operator_test.run_all_tests() break elif cmd == "--run-test": name = command[i + 1] +operator_test.apply_modifiers = False operator_test.run_test(name) break diff --git a/tests/python/boolean_operator.py b/tests/python/boolean_operator.py index 939527676d5..0c66648ab68 100644 --- a/tests/python/boolean_operator.py +++ b/tests/python/boolean_operator.py @@ -69,10 +69,12 @@ def main(): command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": +operator_test.apply_modifiers = True operator_test.run_all_tests() break elif cmd == "--run-test": name = command[i + 1] +operator_test.apply_modifiers = False operator_test.run_test(name) break diff --git a/tests/python/operators.py b/tests/python/operators.py index bc754fcd5a8..80b470c3668 100644 --- a/tests/python/operators.py +++ b/tests/python/operators.py @@ -207,6 +207,7 @@ def main(): command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": +operators_test.apply_modifiers = True operators_test.run_all_tests() break elif cmd == "--run-test": ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [95d3aac8466] soc-2020-testing-frameworks: Added comment for not comparing in run-test and message
Commit: 95d3aac8466f31d611058a12798067301e5f82d4 Author: Himanshi Kalra Date: Wed Sep 2 01:56:50 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB95d3aac8466f31d611058a12798067301e5f82d4 Added comment for not comparing in run-test and message === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index dbf3055a0d0..c19ff3c7e99 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -460,7 +460,7 @@ class MeshTest: if retval != {'FINISHED'}: raise RuntimeError("Unexpected operator return value: {}".format(retval)) if self.verbose: -print("Applied operator {}".format(operator)) +print("Applied {}".format(operator)) bpy.ops.object.mode_set(mode='OBJECT') @@ -557,6 +557,7 @@ class MeshTest: type(OperatorSpecObjectMode), type(ParticleSystemSpec), type(operation))) # Compare resulting mesh with expected one. +# Compare only when self.modifier is set to True, if modifiers are not applied test will always fail if self.apply_modifier: if self.verbose: print("Comparing expected mesh with resulting mesh...") @@ -585,7 +586,8 @@ class MeshTest: else: return self._on_failed_test(compare_result, validation_success, evaluated_test_object) else: -print("Just visualizing") +print("Meshes/objects are not compared, compare evaluated and expected object in Blender for " + "visualization.") class RunTest: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [81f16d2f804] soc-2020-testing-frameworks: Merge branch 'master' into soc-2020-testing-frameworks
Commit: 81f16d2f804dd55aba88085f5eb469e0d7c61b0e Author: Himanshi Kalra Date: Sun Sep 6 15:29:23 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB81f16d2f804dd55aba88085f5eb469e0d7c61b0e Merge branch 'master' into soc-2020-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d63e7a997da] soc-2020-testing-frameworks: Merge branch 'master' into soc-2021-testing-frameworks
Commit: d63e7a997da2fa5a945838a708e80a37236bf4d0 Author: Himanshi Kalra Date: Mon Aug 31 21:43:34 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBd63e7a997da2fa5a945838a708e80a37236bf4d0 Merge branch 'master' into soc-2021-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d2a70fbd436] soc-2020-testing-frameworks: saving state, not running compare unit test for run-test
Commit: d2a70fbd436d29795a287b50a37a6c7e3869c5f7 Author: Himanshi Kalra Date: Mon Aug 31 21:40:49 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBd2a70fbd436d29795a287b50a37a6c7e3869c5f7 saving state, not running compare unit test for run-test === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 453004685e6..dbf3055a0d0 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -317,7 +317,7 @@ class MeshTest: def _add_modifier(self, test_object, modifier_spec: ModifierSpec): """ -Add modifier to object and apply (if modifier_spec.apply_modifier is True) +Add modifier to object. :param test_object: bpy.types.Object - Blender object to apply modifier on. :param modifier_spec: ModifierSpec - ModifierSpec object with parameters """ @@ -557,32 +557,35 @@ class MeshTest: type(OperatorSpecObjectMode), type(ParticleSystemSpec), type(operation))) # Compare resulting mesh with expected one. -if self.verbose: -print("Comparing expected mesh with resulting mesh...") -evaluated_test_mesh = evaluated_test_object.data -expected_mesh = self.expected_object.data -if self.threshold: -compare_result = evaluated_test_mesh.unit_test_compare(mesh=expected_mesh, threshold=self.threshold) -else: -compare_result = evaluated_test_mesh.unit_test_compare(mesh=expected_mesh) -compare_success = (compare_result == 'Same') +if self.apply_modifier: +if self.verbose: +print("Comparing expected mesh with resulting mesh...") +evaluated_test_mesh = evaluated_test_object.data +expected_mesh = self.expected_object.data +if self.threshold: +compare_result = evaluated_test_mesh.unit_test_compare(mesh=expected_mesh, threshold=self.threshold) +else: +compare_result = evaluated_test_mesh.unit_test_compare(mesh=expected_mesh) +compare_success = (compare_result == 'Same') -# Also check if invalid geometry (which is never expected) had to be corrected... -validation_success = evaluated_test_mesh.validate(verbose=True) == False +# Also check if invalid geometry (which is never expected) had to be corrected... +validation_success = evaluated_test_mesh.validate(verbose=True) == False -if compare_success and validation_success: -if self.verbose: -print("Success!") +if compare_success and validation_success: +if self.verbose: +print("Success!") -# Clean up. -if self.verbose: -print("Cleaning up...") -# Delete evaluated_test_object. -bpy.ops.object.delete() -return True +# Clean up. +if self.verbose: +print("Cleaning up...") +# Delete evaluated_test_object. +bpy.ops.object.delete() +return True +else: +return self._on_failed_test(compare_result, validation_success, evaluated_test_object) else: -return self._on_failed_test(compare_result, validation_success, evaluated_test_object) +print("Just visualizing") class RunTest: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c2134cd13c1] soc-2020-testing-frameworks: removed extra str in cloth
Commit: c2134cd13c1ce010a8342ddd002b8b9aa64e4b87 Author: Himanshi Kalra Date: Sun Aug 30 19:01:53 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBc2134cd13c1ce010a8342ddd002b8b9aa64e4b87 removed extra str in cloth === M tests/python/physics_cloth.py === diff --git a/tests/python/physics_cloth.py b/tests/python/physics_cloth.py index 7eac97dda40..700544262c2 100644 --- a/tests/python/physics_cloth.py +++ b/tests/python/physics_cloth.py @@ -57,7 +57,7 @@ def main(): break elif cmd == "--run-test": cloth_test.apply_modifiers = False -name = str(command[i + 1]) +name = command[i + 1] cloth_test.run_test(name) break ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [501c0bfccb0] soc-2020-testing-frameworks: Solved merge conflict
Commit: 501c0bfccb03fdb78b135355be62ea0700af63f7 Author: Himanshi Kalra Date: Sun Aug 30 18:43:22 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB501c0bfccb03fdb78b135355be62ea0700af63f7 Solved merge conflict === === diff --cc tests/python/boolean_operator.py index fc87780ce49,b35c69b7ca5..939527676d5 --- a/tests/python/boolean_operator.py +++ b/tests/python/boolean_operator.py @@@ -34,35 -34,19 +34,37 @@@ from modules.mesh_test import MeshTest def main(): tests = [ -['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecube', 'Cubecube_result_1', 'intersect_boolean', {'operation': 'UNION', 'solver' : 'FAST'}], -['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecube', 'Cubecube_result_2', 'intersect_boolean', {'operation': 'INTERSECT', 'solver' : 'FAST'}], -['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecube', 'Cubecube_result_3', 'intersect_boolean', {'operation': 'DIFFERENCE', 'solver' : 'FAST'}], -['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecube', 'Cubecube_result_4', 'intersect', {'separate_mode': 'CUT', 'solver' : 'FAST'}], -['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecube', 'Cubecube_result_5', 'intersect', {'separate_mode': 'ALL', 'solver' : 'FAST'}], -['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecube', 'Cubecube_result_6', 'intersect', {'separate_mode': 'NONE', 'solver' : 'FAST'}], -['FACE', {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 'Cubecube', 'Cubecube_result_7', 'intersect', - {'mode': 'SELECT', 'separate_mode': 'NONE', 'solver' : 'FAST'}], -['FACE', {6, 7, 8, 9, 10}, 'Cubecone', 'Cubecone_result_1', 'intersect_boolean', {'operation': 'UNION', 'solver' : 'FAST'}], -['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecones', 'Cubecones_result_1', 'intersect_boolean', {'operation': 'UNION', 'solver' : 'FAST'}], ++ +MeshTest('Cubecube_intersect_union', 'Cubecube', 'Cubecube_result_1', + [OperatorSpecEditMode('intersect_boolean', -{'operation': 'UNION'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), ++ {'operation': 'UNION', 'solver': 'FAST'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), +MeshTest('Cubecube_intersect_intersect', 'Cubecube', 'Cubecube_result_2', - [OperatorSpecEditMode('intersect_boolean', {'operation': 'INTERSECT'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), ++ [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'}, 'FACE', ++ [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'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), ++ {'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'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), ++ {'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'}, 'FACE', {0, 1, 2, 3, 4, 5}, )]), ++ {'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'}, 'FACE', ++ {'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'}, 'FACE', {6, 7, 8, 9, 10}, )]), ++ {'operation': 'UNION', 'solver': 'FAST'}, 'FACE', {6, 7, 8, 9, 10}, )]), +MeshTest
[Bf-blender-cvs] [0db26fd8289] soc-2020-testing-frameworks: Remove extra import statement
Commit: 0db26fd82893bd10cf8b9ea9c001ce8c061376aa Author: Himanshi Kalra Date: Sun Aug 30 18:23:05 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB0db26fd82893bd10cf8b9ea9c001ce8c061376aa Remove extra import statement === M tests/python/operators.py === diff --git a/tests/python/operators.py b/tests/python/operators.py index 3c9b53d80b8..bc754fcd5a8 100644 --- a/tests/python/operators.py +++ b/tests/python/operators.py @@ -26,7 +26,7 @@ from random import shuffle, seed seed(0) sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import OperatorTest, MeshTest, OperatorSpecEditMode, RunTest +from modules.mesh_test import MeshTest, OperatorSpecEditMode, RunTest # Central vertical loop of Suzanne MONKEY_LOOP_VERT = {68, 69, 71, 73, 74, 75, 76, 77, 90, 129, 136, 175, 188, 189, 198, 207, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9231bc646cb] soc-2020-testing-frameworks: Increased the frame number for visible differnce
Commit: 9231bc646cba14f47c78e2627f3b3376258fc73b Author: Himanshi Kalra Date: Sun Aug 30 18:30:24 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB9231bc646cba14f47c78e2627f3b3376258fc73b Increased the frame number for visible differnce === M tests/python/physics_cloth.py === diff --git a/tests/python/physics_cloth.py b/tests/python/physics_cloth.py index 7c8b8fd1940..7eac97dda40 100644 --- a/tests/python/physics_cloth.py +++ b/tests/python/physics_cloth.py @@ -32,7 +32,7 @@ def main(): # Make sure no modifier is added on the test object. MeshTest("ClothSimple", "testClothPlane", "expectedClothPlane", - [ModifierSpec('Cloth', 'CLOTH', {'settings': {'quality': 5}}, 10)], threshold=1e-3), + [ModifierSpec('Cloth', 'CLOTH', {'settings': {'quality': 5}}, 15)], threshold=1e-3), # Not reproducible # MeshTest("ClothPressure", "testObjClothPressure", "expObjClothPressure", ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a09ae63e2b7] soc-2020-testing-frameworks: Minor fix
Commit: a09ae63e2b74a359f3cf1dd5a07feee888c2ad3b Author: Himanshi Kalra Date: Sun Aug 30 17:04:12 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBa09ae63e2b74a359f3cf1dd5a07feee888c2ad3b Minor fix === M tests/python/physics_softbody.py === diff --git a/tests/python/physics_softbody.py b/tests/python/physics_softbody.py index 83ad26b05c6..499ce32ad93 100644 --- a/tests/python/physics_softbody.py +++ b/tests/python/physics_softbody.py @@ -24,7 +24,7 @@ import sys import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import ModifierTest, ModifierSpec, MeshTest +from modules.mesh_test import RunTest, ModifierSpec, MeshTest def main(): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [500bf1f2bb9] soc-2020-testing-frameworks: Merge branch 'master' into soc-2021-testing-frameworks
Commit: 500bf1f2bb953ae879d568c34e430bc35ce30679 Author: Himanshi Kalra Date: Fri Aug 28 22:24:18 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB500bf1f2bb953ae879d568c34e430bc35ce30679 Merge branch 'master' into soc-2021-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [39da8310015] soc-2020-testing-frameworks: Merge branch 'soc-2020-testing-frameworks' of git.blender.org:blender into soc-2020-testing-frameworks
Commit: 39da8310015aec50518404c9859fb535057496af Author: Himanshi Kalra Date: Fri Aug 28 23:37:46 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB39da8310015aec50518404c9859fb535057496af Merge branch 'soc-2020-testing-frameworks' of git.blender.org:blender into soc-2020-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [eb5fd291cff] soc-2020-testing-frameworks: Removed extra import statement
Commit: eb5fd291cff37709d6c9427632d9b6d7770119d4 Author: Himanshi Kalra Date: Thu Aug 27 23:38:22 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBeb5fd291cff37709d6c9427632d9b6d7770119d4 Removed extra import statement === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 030649ef472..453004685e6 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -44,7 +44,6 @@ import bpy import functools import inspect import os -from abc import ABC, abstractmethod # Output from this module and from blender itself will occur during tests. # We need to flush python so that the output is properly interleaved, otherwise ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7c1656d0e6b] soc-2020-testing-frameworks: Merge branch 'master' into soc-2020-testing-frameworks
Commit: 7c1656d0e6bc6e5a7a91d839086954b32db6bc00 Author: Himanshi Kalra Date: Thu Aug 27 19:33:25 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB7c1656d0e6bc6e5a7a91d839086954b32db6bc00 Merge branch 'master' into soc-2020-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4a5165d9456] soc-2020-testing-frameworks: Changed from ModifierTest to RunTest
Commit: 4a5165d94560ef9111cf17119062a8d05bd528f8 Author: Himanshi Kalra Date: Thu Aug 27 18:46:49 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB4a5165d94560ef9111cf17119062a8d05bd528f8 Changed from ModifierTest to RunTest === M tests/python/deform_modifiers.py 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/deform_modifiers.py b/tests/python/deform_modifiers.py index 9a35ae0ad35..1642cdb6ac1 100644 --- a/tests/python/deform_modifiers.py +++ b/tests/python/deform_modifiers.py @@ -28,7 +28,7 @@ import sys import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import MeshTest, ModifierSpec, OperatorSpecObjectMode, DeformModifierSpec, ModifierTest +from modules.mesh_test import MeshTest, ModifierSpec, OperatorSpecObjectMode, DeformModifierSpec, RunTest tests = [ @@ -103,7 +103,7 @@ tests = [ ] -deform_tests = ModifierTest(tests) +deform_tests = RunTest(tests) command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": diff --git a/tests/python/modifiers.py b/tests/python/modifiers.py index 4f775cb6c5d..c2bb5df65f9 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, MeshTest +from modules.mesh_test import RunTest, ModifierSpec, MeshTest seed(0) @@ -343,7 +343,7 @@ def main(): ] -modifiers_test = ModifierTest(tests) +modifiers_test = RunTest(tests) command = list(sys.argv) for i, cmd in enumerate(command): diff --git a/tests/python/physics_cloth.py b/tests/python/physics_cloth.py index 4c18dee6fc7..7c8b8fd1940 100644 --- a/tests/python/physics_cloth.py +++ b/tests/python/physics_cloth.py @@ -24,7 +24,7 @@ import sys import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import ModifierTest, ModifierSpec, MeshTest +from modules.mesh_test import RunTest, ModifierSpec, MeshTest def main(): @@ -47,7 +47,7 @@ def main(): [ModifierSpec('Cloth2', 'CLOTH', {'settings': {'use_internal_springs': True}}, 10)], threshold=1e-3), ] -cloth_test = ModifierTest(test) +cloth_test = RunTest(test) command = list(sys.argv) for i, cmd in enumerate(command): diff --git a/tests/python/physics_dynamic_paint.py b/tests/python/physics_dynamic_paint.py index c15999fb540..45ab5551978 100644 --- a/tests/python/physics_dynamic_paint.py +++ b/tests/python/physics_dynamic_paint.py @@ -24,7 +24,7 @@ import sys import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import ModifierTest, ModifierSpec, MeshTest +from modules.mesh_test import RunTest, ModifierSpec, MeshTest def main(): @@ -37,7 +37,7 @@ def main(): 15)]), ] -dynamic_paint_test = ModifierTest(test) +dynamic_paint_test = RunTest(test) command = list(sys.argv) for i, cmd in enumerate(command): diff --git a/tests/python/physics_ocean.py b/tests/python/physics_ocean.py index a8bffc97a77..e569fea0074 100644 --- a/tests/python/physics_ocean.py +++ b/tests/python/physics_ocean.py @@ -24,7 +24,7 @@ import sys import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import ModifierTest, ModifierSpec, MeshTest +from modules.mesh_test import RunTest, ModifierSpec, MeshTest def main(): @@ -33,7 +33,7 @@ def main(): MeshTest("PlaneOcean", "testObjPlaneOcean", "expObjPlaneOcean", [ModifierSpec('Ocean', 'OCEAN', {})]), ] -ocean_test = ModifierTest(test) +ocean_test = RunTest(test) command = list(sys.argv) for i, cmd in enumerate(command): diff --git a/tests/python/physics_particle_instance.py b/tests/python/physics_particle_instance.py index 673dbe5995f..e7f882eaaa5 100644 --- a/tests/python/physics_particle_instance.py +++ b/tests/python/physics_particle_instance.py @@ -24,17 +24,18 @@ import sys import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import ModifierTest, ModifierSpec, MeshTest +from modules.mesh_test import RunTest, ModifierSpec, MeshTest def main(): test = [ MeshTest("ParticleInstanceSimple", "testParticleInstance", "expectedParticleInstance", - [ModifierSpec
[Bf-blender-cvs] [c2918d8525d] soc-2020-testing-frameworks: Removed OperatorTest and ModifierTest, added a generic RunTest
Commit: c2918d8525da44dfc4860d252157d53792e87563 Author: Himanshi Kalra Date: Thu Aug 27 18:42:55 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBc2918d8525da44dfc4860d252157d53792e87563 Removed OperatorTest and ModifierTest, added a generic RunTest === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 0d75a4f1c08..030649ef472 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -231,13 +231,6 @@ class MeshTest: objects = bpy.data.objects self.expected_object = objects[expected_object_name] -def add_operator_to_stack(self, operator_spec: OperatorSpecEditMode): -""" -Adds an operator to the operations stack. -:param operator_spec: OperatorSpecEditMode - operator to add to the operations stack. -""" -self.operations_stack.append(operator_spec) - def _on_failed_test(self, compare_result, validation_success, evaluated_test_object): if self.update and validation_success: if self.verbose: @@ -593,123 +586,7 @@ class MeshTest: return self._on_failed_test(compare_result, validation_success, evaluated_test_object) -class OperatorTest: -""" -Helper class that stores and executes operator tests. - -Example usage: - ->>> tests = [ ->>> ['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecube', 'Cubecube_result_1', 'intersect_boolean', {'operation': 'UNION'}], ->>> ['FACE', {0, 1, 2, 3, 4, 5}, 'Cubecube', 'Cubecube_result_2', 'intersect_boolean', {'operation': 'INTERSECT'}], ->>> ] ->>> operator_test = OperatorTest(tests) ->>> operator_test.run_all_tests() -""" - -def __init__(self, operator_tests): -""" -Constructs an operator test. -:param operator_tests: list - list of operator test cases. Each element in the list must contain the following - in the correct order: - 1) select_mode: str - mesh selection mode, must be either 'VERT', 'EDGE' or 'FACE' - 2) selection: set - set of vertices/edges/faces indices to select, e.g. [0, 9, 10]. - 3) test_name: str - unique name for each test - 4) test_object_name: bpy.Types.Object - test object - 5) expected_object_name: bpy.Types.Object - expected object - 6) operator_name: str - name of mesh operator from bpy.ops.mesh, e.g. "bevel" or "fill" - 7) operator_parameters: dict - {name : val} dictionary containing operator parameters. -""" -self.operator_tests = operator_tests -self._check_for_unique_test_name() -self.verbose = os.environ.get("BLENDER_VERBOSE") is not None -self._failed_tests_list = [] - -def _check_for_unique_test_name(self): -""" -Check if the test name is unique in existing test names within the file. -""" -all_test_names = [] -for index, _ in enumerate(self.operator_tests): -test_name = self.operator_tests[index][2] -all_test_names.append(test_name) -seen_name = set() - -for ele in all_test_names: -if ele in seen_name: -raise ValueError("{} is a duplicate, write a new unique name.".format(ele)) -else: -seen_name.add(ele) - -def run_test(self, test_name: str): -""" -Run a single test from operator_tests list -:param test_name: str - name of test -:return: bool - True if test is successful. False otherwise. -""" -case = None -len_test = len(self.operator_tests) -count = 0 -# Finding the index of the test to match the "test name" -for index, _ in enumerate(self.operator_tests): -if test_name == self.operator_tests[index][2]: -case = self.operator_tests[index] -break -count = count + 1 - -if count == len_test: -raise Exception("No test {} found!".format(test_name)) -if len(case) != 7: -raise ValueError("Expected exactly 7 parameters for each test case, got {}".format(len(case))) - -select_mode = case[0] -selection = case[1] -test_name = case[2] -test_object_name = case[3] -expected_object_name = case[4] -operator_name = case[5] -operator_parameters = case[6] - -operator_spec = OperatorSpecEditMode(operator_name, operat
[Bf-blender-cvs] [4d2d536747c] soc-2020-testing-frameworks: Changed the interface, now operators, bevel and boolean use MeshTest, no helper class
Commit: 4d2d536747c02979fdfe06ddfa315a4defa48051 Author: Himanshi Kalra Date: Thu Aug 27 18:44:04 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB4d2d536747c02979fdfe06ddfa315a4defa48051 Changed the interface, now operators,bevel and boolean use MeshTest, no helper class === M tests/python/bevel_operator.py M tests/python/boolean_operator.py M tests/python/operators.py === diff --git a/tests/python/bevel_operator.py b/tests/python/bevel_operator.py index a86080621bd..b1767e63ad6 100644 --- a/tests/python/bevel_operator.py +++ b/tests/python/bevel_operator.py @@ -27,170 +27,276 @@ import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import OperatorTest +from modules.mesh_test import MeshTest, OperatorSpecEditMode, RunTest def main(): tests = [ # 0 -['EDGE', {10}, 'Cube_test_1', 'Cube_test', 'Cube_result_1', 'bevel', {'offset': 0.2}], -['EDGE', {10, 7}, 'Cube_test_2', 'Cube_test', 'Cube_result_2', 'bevel', - {'offset': 0.2, 'offset_type': 'WIDTH'}], -['EDGE', {8, 10, 7}, 'Cube_test_3', 'Cube_test', 'Cube_result_3', 'bevel', - {'offset': 0.2, 'offset_type': 'DEPTH'}], -['EDGE', {10}, 'Cube_test_4', 'Cube_test', 'Cube_result_4', 'bevel', {'offset': 0.4, 'segments': 2}], -['EDGE', {10, 7}, 'Cube_test_5', 'Cube_test', 'Cube_result_5', 'bevel', {'offset': 0.4, 'segments': 3}], +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 -['EDGE', {8, 10, 7}, 'Cube_test_6', 'Cube_test', 'Cube_result_6', 'bevel', {'offset': 0.4, 'segments': 4}], -['EDGE', {0, 10, 4, 7}, 'Cube_test_7', 'Cube_test', 'Cube_result_7', 'bevel', - {'offset': 0.4, 'segments': 5, 'profile': 0.2}], -['EDGE', {8, 10, 7}, 'Cube_test_8', 'Cube_test', 'Cube_result_8', 'bevel', - {'offset': 0.4, 'segments': 5, 'profile': 0.25}], -['EDGE', {8, 10, 7}, 'Cube_test_9', 'Cube_test', 'Cube_result_9', 'bevel', - {'offset': 0.4, 'segments': 6, 'profile': 0.9}], -['EDGE', {10, 7}, 'Cube_test_10', 'Cube_test', 'Cube_result_10', 'bevel', - {'offset': 0.4, 'segments': 4, 'profile': 1.0}], +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 -['EDGE', {8, 10, 7}, 'Cube_test_11', 'Cube_test', 'Cube_result_11', 'bevel', - {'offset': 0.4, 'segments': 5, 'profile': 1.0}], -['EDGE', {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, "test 12", 'Cube_test', 'Cube_result_12', 'bevel', - {'offset': 0.4, 'segments': 8}], -['EDGE', {5}, 'Pyramid4_test_1', 'Pyr4_test', 'Pyr4_result_1', 'bevel', {'offset': 0.2}], -['EDGE', {2, 5}, 'Pyramid4_test_2', 'Pyr4_test', 'Pyr4_result_2', 'bevel', {'offset': 0.2}], -['EDGE', {2, 3, 5}, 'Pyramid4_test_3', 'Pyr4_test', 'Pyr4_result_3', 'bevel', {'offset': 0.2}], +
[Bf-blender-cvs] [1c6302a7e5c] soc-2020-testing-frameworks: Merge branch 'master' into soc-2021-testing-frameworks
Commit: 1c6302a7e5cc4da03da57979ccf66633894ef14e Author: Himanshi Kalra Date: Thu Aug 27 19:33:25 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB1c6302a7e5cc4da03da57979ccf66633894ef14e Merge branch 'master' into soc-2021-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e6abea5ce69] soc-2020-testing-frameworks: Merge branch 'master' into soc-2021-testing-frameworks
Commit: e6abea5ce696d1623e19cab0aa7c1fba98e9a3d9 Author: Himanshi Kalra Date: Thu Aug 27 00:45:23 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBe6abea5ce696d1623e19cab0aa7c1fba98e9a3d9 Merge branch 'master' into soc-2021-testing-frameworks === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6490eeabd55] soc-2020-testing-frameworks: Updated test file for Cloth and Dynamic Paint to bake less frames
Commit: 6490eeabd552f44df6e003e58cd80f0e6e20ac55 Author: Himanshi Kalra Date: Sun Aug 23 21:09:23 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB6490eeabd552f44df6e003e58cd80f0e6e20ac55 Updated test file for Cloth and Dynamic Paint to bake less frames === M tests/python/physics_cloth.py M tests/python/physics_dynamic_paint.py === diff --git a/tests/python/physics_cloth.py b/tests/python/physics_cloth.py index 7c82aeedf5a..2531650e820 100644 --- a/tests/python/physics_cloth.py +++ b/tests/python/physics_cloth.py @@ -31,8 +31,8 @@ def main(): test = [ # Make sure no modifier is added on the test object. -["ClothSimple", "testCloth", "expectedCloth", - [ModifierSpec('Cloth', 'CLOTH', {'settings': {'quality': 5}}, 35)]], +["ClothSimple", "testClothPlane", "expectedClothPlane", + [ModifierSpec('Cloth', 'CLOTH', {'settings': {'quality': 5}}, 10)]], # Not reproducible # ["ClothPressure", "testObjClothPressure", "expObjClothPressure", @@ -43,7 +43,7 @@ def main(): # [ModifierSpec('Cloth', 'CLOTH', {'collision_settings': {'use_self_collision': True}}, 67)]], ["ClothSpring", "testTorusClothSpring", "expTorusClothSpring", - [ModifierSpec('Cloth2', 'CLOTH', {'settings': {'use_internal_springs': True}}, 30)]], + [ModifierSpec('Cloth2', 'CLOTH', {'settings': {'use_internal_springs': True}}, 10)]], ] diff --git a/tests/python/physics_dynamic_paint.py b/tests/python/physics_dynamic_paint.py index b70f416f495..2ef9d3ab507 100644 --- a/tests/python/physics_dynamic_paint.py +++ b/tests/python/physics_dynamic_paint.py @@ -30,10 +30,10 @@ from modules.mesh_test import ModifierTest, ModifierSpec def main(): test = [ -["DynamicPaint2", "test", "exp", +["DynamicPaintSimple", "testObjDynamicPaintPlane", "expObjDynamicPaintPlane", [ModifierSpec('dynamic_paint', 'DYNAMIC_PAINT', {'ui_type': 'CANVAS', -'canvas_settings': {'canvas_surfaces': {'surface_type': 'WAVE', 'frame_end': 50}}}, 50)]], +'canvas_settings': {'canvas_surfaces': {'surface_type': 'WAVE', 'frame_end': 15}}}, 15)]], ] dynamic_paint_test = ModifierTest(test) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f7d2ed66a60] soc-2020-testing-frameworks: Using an abstract base class as a parent to ModifierTest
Commit: f7d2ed66a603927b58ef4f023673717bff2c2ca3 Author: Himanshi Kalra Date: Wed Aug 26 10:33:51 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rBf7d2ed66a603927b58ef4f023673717bff2c2ca3 Using an abstract base class as a parent to ModifierTest Change in implementation of ModifierTest, input parameter changed from a list to using MeshTest Class === M tests/python/modules/mesh_test.py === diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index 8fb65655b09..ab7e73c384f 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -44,6 +44,7 @@ import bpy import functools import inspect import os +from abc import ABC, abstractmethod # Output from this module and from blender itself will occur during tests. # We need to flush python so that the output is properly interleaved, otherwise @@ -717,49 +718,17 @@ class OperatorTest: raise Exception("Tests {} failed".format(self._failed_tests_list)) -class ModifierTest: +class RunTest(ABC): """ -Helper class that stores and executes modifier tests. - -Example usage: - ->>> modifier_list = [ ->>> ModifierSpec("firstSUBSURF", "SUBSURF", {"quality": 5}), ->>> ModifierSpec("firstSOLIDIFY", "SOLIDIFY", {"thickness_clamp": 0.9, "thickness": 1}) ->>> ] ->>> tests = [ ->>> ["Test1","testCube", "expectedCube", modifier_list], ->>> ["Test2","testCube_2", "expectedCube_2", modifier_list] ->>> ] ->>> modifiers_test = ModifierTest(tests) ->>> modifiers_test.run_all_tests() +Inherited from Abstract Base Class, used by ModifierTest (Child Class) """ - -def __init__(self, modifier_tests: list, apply_modifiers=False, threshold=None): -""" -Construct a modifier test. -:param modifier_tests: list - list of modifier test cases. Each element in the list must contain the following - in the correct order: - 0) test_name: str - unique test name - 1) test_object_name: bpy.Types.Object - test object - 2) expected_object_name: bpy.Types.Object - expected object - 3) modifiers: list - list of mesh_test.ModifierSpec objects. -""" - -self.modifier_tests = modifier_tests -self._check_for_unique_test_name() -self.apply_modifiers = apply_modifiers -self.threshold = threshold -self.verbose = os.environ.get("BLENDER_VERBOSE") is not None -self._failed_tests_list = [] - def _check_for_unique_test_name(self): """ Check if the test name is unique """ all_test_names = [] -for index, _ in enumerate(self.modifier_tests): -test_name = self.modifier_tests[index][0] +for index, _ in enumerate(self.tests): +test_name = self.tests[index].test_name all_test_names.append(test_name) seen_name = set() for ele in all_test_names: @@ -768,50 +737,12 @@ class ModifierTest: else: seen_name.add(ele) -def run_test(self, test_name: str): -""" -Run a single test from self.modifier_tests list -:param test_name: str - name of test -:return: bool - True if test passed, False otherwise. -""" -case = None -len_test = len(self.modifier_tests) -count = 0 -for index, _ in enumerate(self.modifier_tests): -if test_name == self.modifier_tests[index][0]: -case = self.modifier_tests[index] -break -count = count + 1 -if count == len_test: -raise Exception("No test {} found!".format(test_name)) - -if len(case) != 4: -raise ValueError("Expected exactly 4 parameters for each test case, got {}".format(len(case))) -test_name = case[0] -test_object_name = case[1] -expected_object_name = case[2] -spec_list = case[3] - -test = MeshTest(test_name, test_object_name, expected_object_name, threshold=self.threshold) -if self.apply_modifiers: -test.apply_modifier = True - -for modifier_spec in spec_list: -test.add_modifier_to_stack(modifier_spec) - -success = test.run_test() -if test.is_test_updated(): -# Run the test again if the blend file has been updated. -
[Bf-blender-cvs] [e3e81f60a80] soc-2020-testing-frameworks: Updating test files to use MeshTest Class in ModifierTest
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"]})]], -
[Bf-blender-cvs] [5dda36d875d] soc-2020-testing-frameworks: Removed the abstract base class as there is now only 1 Helper Test class, updated deform modifiers to ModifierTest
Commit: 5dda36d875db08ea8a53216510f0971dfcb88127 Author: Himanshi Kalra Date: Thu Aug 27 00:41:20 2020 +0530 Branches: soc-2020-testing-frameworks https://developer.blender.org/rB5dda36d875db08ea8a53216510f0971dfcb88127 Removed the abstract base class as there is now only 1 Helper Test class, updated deform modifiers to ModifierTest === M tests/python/deform_modifiers.py M tests/python/modules/mesh_test.py === diff --git a/tests/python/deform_modifiers.py b/tests/python/deform_modifiers.py index 9c8b26f9678..9a35ae0ad35 100644 --- a/tests/python/deform_modifiers.py +++ b/tests/python/deform_modifiers.py @@ -28,7 +28,7 @@ import sys import bpy sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from modules.mesh_test import MeshTest, ModifierSpec, OperatorSpecObjectMode, DeformModifierSpec, DeformModifierTest +from modules.mesh_test import MeshTest, ModifierSpec, OperatorSpecObjectMode, DeformModifierSpec, ModifierTest tests = [ @@ -103,7 +103,7 @@ tests = [ ] -deform_tests = DeformModifierTest(tests) +deform_tests = ModifierTest(tests) command = list(sys.argv) for i, cmd in enumerate(command): if cmd == "--run-all-tests": diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index ab7e73c384f..0d75a4f1c08 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -231,15 +231,6 @@ class MeshTest: objects = bpy.data.objects self.expected_object = objects[expected_object_name] -def add_modifier_to_stack(self, modifier_spec: ModifierSpec): -""" -Add a modifier to the operations stack. -:param modifier_spec: modifier to add to the operations stack -""" -self.operations_stack.append(modifier_spec) -if self.verbose: -print("Added modifier {}".format(modifier_spec)) - def add_operator_to_stack(self, operator_spec: OperatorSpecEditMode): """ Adds an operator to the operations stack. @@ -718,10 +709,40 @@ class OperatorTest: raise Exception("Tests {} failed".format(self._failed_tests_list)) -class RunTest(ABC): +class ModifierTest: """ -Inherited from Abstract Base Class, used by ModifierTest (Child Class) +Helper class that stores and executes modifier tests. + +Example usage: + +>>> modifier_list = [ +>>> ModifierSpec("firstSUBSURF", "SUBSURF", {"quality": 5}), +>>> ModifierSpec("firstSOLIDIFY", "SOLIDIFY", {"thickness_clamp": 0.9, "thickness": 1}) +>>> ] +>>> tests = [ +>>> MeshTest("Test1", "testCube", "expectedCube", modifier_list), +>>> MeshTest("Test2", "testCube_2", "expectedCube_2", modifier_list) +>>> ] +>>> modifiers_test = ModifierTest(tests) +>>> modifiers_test.run_all_tests() """ + +def __init__(self, tests, apply_modifiers=False): +""" +Construct a modifier test. +:param tests: list - list of modifier test cases. Each element in the list must contain the following + in the correct order: + 0) test_name: str - unique test name + 1) test_object_name: bpy.Types.Object - test object + 2) expected_object_name: bpy.Types.Object - expected object + 3) modifiers: list - list of mesh_test.ModifierSpec objects. +""" +self.tests = tests +self._check_for_unique_test_name() +self.apply_modifiers = apply_modifiers +self.verbose = os.environ.get("BLENDER_VERBOSE") is not None +self._failed_tests_list = [] + def _check_for_unique_test_name(self): """ Check if the test name is unique @@ -767,48 +788,6 @@ class RunTest(ABC): raise Exception("Tests {} failed".format(self._failed_tests_list)) -@abstractmethod -def run_test(self, test_name: str): -""" -For enforcing a check that any child class should have this method. -""" -pass - - -class ModifierTest(RunTest): -""" -Helper class that stores and executes modifier tests. - -Example usage: - ->>> modifier_list = [ ->>> ModifierSpec("firstSUBSURF", "SUBSURF", {"quality": 5}), ->>> ModifierSpec("firstSOLIDIFY", "SOLIDIFY", {"thickness_clamp": 0.9, "thickness": 1}) -
[Bf-blender-cvs] [b9f422c4be9] blender-v2.83-release: Tests: add physics tests cloth and softybody
Commit: b9f422c4be9c27bb47e5305bad2c91901719100e Author: Himanshi Kalra Date: Mon Apr 27 16:47:07 2020 +0200 Branches: blender-v2.83-release https://developer.blender.org/rBb9f422c4be9c27bb47e5305bad2c91901719100e Tests: add physics tests cloth and softybody This uses the same framework as automated modifier tests. It adds a physics modifier, bakes and compares vertex coordinates on the end frame. Differential Revision: https://developer.blender.org/D7017 === M tests/python/CMakeLists.txt M tests/python/modules/mesh_test.py A tests/python/physics_cloth.py A tests/python/physics_softbody.py === diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index db5d5dcf73b..2d6dc4af40e 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -188,6 +188,22 @@ add_blender_test( --run-all-tests ) +add_blender_test( + physics_cloth + ${TEST_SRC_DIR}/physics/cloth_test.blend + --python ${TEST_PYTHON_DIR}/physics_cloth.py + -- + --run-all-tests +) + +add_blender_test( + physics_softbody + ${TEST_SRC_DIR}/physics/softbody_test.blend + --python ${TEST_PYTHON_DIR}/physics_softbody.py + -- + --run-all-tests +) + add_blender_test( constraints --python ${CMAKE_CURRENT_LIST_DIR}/bl_constraints.py diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py index f188d998884..af0e78257d5 100644 --- a/tests/python/modules/mesh_test.py +++ b/tests/python/modules/mesh_test.py @@ -73,6 +73,28 @@ class ModifierSpec: " with parameters: " + str(self.modifier_parameters) +class PhysicsSpec: +""" +Holds one Physics modifier and its parameters. +""" + +def __init__(self, modifier_name: str, modifier_type: str, modifier_parameters: dict, frame_end: int): +""" +Constructs a physics spec. +:param modifier_name: str - name of object modifier, e.g. "Cloth" +:param modifier_type: str - type of object modifier, e.g. "CLOTH" +:param modifier_parameters: dict - {name : val} dictionary giving modifier parameters, e.g. {"quality" : 4} +:param frame_end:int - the last frame of the simulation at which it is baked +""" +self.modifier_name = modifier_name +self.modifier_type = modifier_type +self.modifier_parameters = modifier_parameters +self.frame_end = frame_end + +def __str__(self): +return "Physics Modifier: " + self.modifier_name + " of type " + self.modifier_type + \ + " with parameters: " + str(self.modifier_parameters) + " with frame end: " + str(self.frame_end) + class OperatorSpec: """ Holds one operator and its parameters. @@ -105,7 +127,7 @@ class MeshTest: the public method run_test(). """ -def __init__(self, test_object_name: str, expected_object_name: str, operations_stack=None, apply_modifiers=False): +def __init__(self, test_object_name: str, expected_object_name: str, operations_stack=None, apply_modifiers=False, threshold=None): """ Constructs a MeshTest object. Raises a KeyError if objects with names expected_object_name or test_object_name don't exist. @@ -125,6 +147,7 @@ class MeshTest: type(operation))) self.operations_stack = operations_stack self.apply_modifier = apply_modifiers +self.threshold = threshold self.verbose = os.environ.get("BLENDER_VERBOSE") is not None self.update = os.getenv('BLENDER_TEST_UPDATE') is not None @@ -235,6 +258,49 @@ class MeshTest: if self.apply_modifier: bpy.ops.object.modifier_apply(modifier=modifier_spec.modifier_name) + +def _bake_current_simulation(self, obj, test_mod_type, test_mod_name, frame_end): +for scene in bpy.data.scenes: +for modifier in obj.modifiers: +if modifier.type == test_mod_type: +obj.modifiers[test_mod_name].point_cache.frame_end = frame_end +override = {'scene': scene, 'active_object': obj, 'point_cache': modifier.point_cache} +bpy.ops.ptcache.bake(override, bake=True) +break + +def _apply_physics_settings(self, test_object, physics_spec: PhysicsSpec): +""" +Apply Physics settings to test objects. +""" +scene = bpy.context.scene +scene.frame_set(1) +modifier = test_object.modifiers.new(physics_spec.modifier_name, + physics_spec.modifier_type) +physic
[Bf-blender-cvs] [37f49af7494] temp-lanpr-cleanup: UI: Incorrect info message after batch rename
Commit: 37f49af7494a22e2c9149c6c5d44e7d1ca8f1db6 Author: Himanshi Kalra Date: Fri Sep 20 14:15:32 2019 +0200 Branches: temp-lanpr-cleanup https://developer.blender.org/rB37f49af7494a22e2c9149c6c5d44e7d1ca8f1db6 UI: Incorrect info message after batch rename Differential Revision: https://developer.blender.org/D5744 === M release/scripts/startup/bl_operators/wm.py === diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 9a9975ad897..cb9af88f45f 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2205,7 +2205,7 @@ class WM_OT_batch_rename(Operator): change_len += 1 total_len += 1 -self.report({'INFO'}, "Renamed {:d} of {:d} {:s}".format(total_len, change_len, descr)) +self.report({'INFO'}, "Renamed {:d} of {:d} {:s}".format(change_len, total_len, descr)) return {'FINISHED'} ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [60af4d207b7] master: UI: Incorrect info message after batch rename
Commit: 60af4d207b7008fb0ed559ac4372ceba8a13406a Author: Himanshi Kalra Date: Fri Sep 20 14:15:32 2019 +0200 Branches: master https://developer.blender.org/rB60af4d207b7008fb0ed559ac4372ceba8a13406a UI: Incorrect info message after batch rename Differential Revision: https://developer.blender.org/D5744 === M release/scripts/startup/bl_operators/wm.py === diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 9a9975ad897..cb9af88f45f 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2205,7 +2205,7 @@ class WM_OT_batch_rename(Operator): change_len += 1 total_len += 1 -self.report({'INFO'}, "Renamed {:d} of {:d} {:s}".format(total_len, change_len, descr)) +self.report({'INFO'}, "Renamed {:d} of {:d} {:s}".format(change_len, total_len, descr)) return {'FINISHED'} ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs