Changeset View
Changeset View
Standalone View
Standalone View
tests/python/physics_cloth.py
- This file was copied to tests/python/physics_dynamic_paint.py, tests/python/physics_ocean.py, tests/python/physics_particle_instance.py, tests/python/physics_particle_system.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("ClothSimple", "testClothPlane", "expectedClothPlane", | ||||
zazizizou: the line after this comment does exactly the opposite of what the comment says, it //does// add… | |||||
| [ModifierSpec('Cloth', 'CLOTH', {'settings': {'quality': 5}}, 15)], threshold=1e-3), | |||||
Done Inline ActionsIs it really necessary to have 35 frames? The 2 cloth tests take almost as long as all of the modifiers tests (around 2.5 sec on my computer). I would choose this one to be as low as possible. Maybe just a couple frames after deformation can be observed or so. zazizizou: Is it really necessary to have 35 frames? The 2 cloth tests take almost as long as all of the… | |||||
| # Not reproducible | |||||
| # MeshTest("ClothPressure", "testObjClothPressure", "expObjClothPressure", | |||||
| # [ModifierSpec('Cloth2', 'CLOTH', {'settings': {'use_pressure': True, | |||||
| # 'uniform_pressure_force': 1}}, 16)]), | |||||
| # Not reproducible | |||||
| # MeshTest("ClothSelfCollision", "testClothCollision", "expClothCollision", | |||||
| # [ModifierSpec('Cloth', 'CLOTH', {'collision_settings': {'use_self_collision': True}}, 67)]), | |||||
| MeshTest("ClothSpring", "testTorusClothSpring", "expTorusClothSpring", | |||||
| [ModifierSpec('Cloth2', 'CLOTH', {'settings': {'use_internal_springs': True}}, 10)], threshold=1e-3), | |||||
| ] | ] | ||||
| cloth_test = ModifierTest(test, threshold=1e-3) | cloth_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 | cloth_test.apply_modifiers = True | ||||
| cloth_test.do_compare = True | |||||
| cloth_test.run_all_tests() | cloth_test.run_all_tests() | ||||
| break | break | ||||
| elif cmd == "--run-test": | elif cmd == "--run-test": | ||||
| cloth_test.apply_modifiers = False | cloth_test.apply_modifiers = False | ||||
| index = int(command[i + 1]) | cloth_test.do_compare = False | ||||
| cloth_test.run_test(index) | name = command[i + 1] | ||||
| cloth_test.run_test(name) | |||||
| break | break | ||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| main() | main() | ||||
the line after this comment does exactly the opposite of what the comment says, it does add a modifier.
Or maybe this was meant as an instruction on how to add tests? in that case you should add such instructions in doc strings or in your wiki page