Changeset View
Changeset View
Standalone View
Standalone View
tests/python/physics_dynamic_paint.py
- This file was copied from tests/python/physics_cloth.py.
| Show All 18 Lines | |||||
| # <pep8 compliant> | # <pep8 compliant> | ||||
| import os | import os | ||||
| import sys | import sys | ||||
| import bpy | import bpy | ||||
| sys.path.append(os.path.dirname(os.path.realpath(__file__))) | sys.path.append(os.path.dirname(os.path.realpath(__file__))) | ||||
| from modules.mesh_test import ModifierTest, PhysicsSpec | from modules.mesh_test import RunTest, ModifierSpec, MeshTest | ||||
| def main(): | def main(): | ||||
| test = [ | test = [ | ||||
| ["testCloth", "expectedCloth", | |||||
| [PhysicsSpec('Cloth', 'CLOTH', {'quality': 5}, 35)]], | MeshTest("DynamicPaintSimple", "testObjDynamicPaintPlane", "expObjDynamicPaintPlane", | ||||
zazizizou: Use same quality/conventions as in other test blend files. So give meaningful names for… | |||||
| [ModifierSpec('dynamic_paint', 'DYNAMIC_PAINT', | |||||
| {'ui_type': 'CANVAS', | |||||
| 'canvas_settings': {'canvas_surfaces': {'surface_type': 'WAVE', 'frame_end': 15}}}, | |||||
| 15)]), | |||||
| ] | ] | ||||
| cloth_test = ModifierTest(test, threshold=1e-3) | dynamic_paint_test = RunTest(test) | ||||
| command = list(sys.argv) | command = list(sys.argv) | ||||
| for i, cmd in enumerate(command): | for i, cmd in enumerate(command): | ||||
| if cmd == "--run-all-tests": | if cmd == "--run-all-tests": | ||||
| cloth_test.apply_modifiers = True | dynamic_paint_test.apply_modifiers = True | ||||
| cloth_test.run_all_tests() | dynamic_paint_test.do_compare = True | ||||
| dynamic_paint_test.run_all_tests() | |||||
| break | break | ||||
| elif cmd == "--run-test": | elif cmd == "--run-test": | ||||
| cloth_test.apply_modifiers = False | dynamic_paint_test.apply_modifiers = False | ||||
| index = int(command[i + 1]) | dynamic_paint_test.do_compare = False | ||||
| cloth_test.run_test(index) | name = command[i + 1] | ||||
| dynamic_paint_test.run_test(name) | |||||
| break | break | ||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| main() | main() | ||||
Use same quality/conventions as in other test blend files. So give meaningful names for collection and test objects and delete unused objects in the file (to make it easier for the next person who wants to add a test). This applies to other blend files as well