Changeset View
Changeset View
Standalone View
Standalone View
tests/python/physics_softbody.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 ModifierTest, ModifierSpec | ||||
| def main(): | def main(): | ||||
| test = [ | test = [ | ||||
| ["testSoftBody", "expectedSoftBody", | |||||
| [PhysicsSpec('Softbody', 'SOFT_BODY', {'use_goal': False, 'bend': 8, 'pull': 0.8, 'push': 0.8}, 45)]], | ["SoftBodySimple", "testSoftBody", "expectedSoftBody", | ||||
| [ModifierSpec('Softbody', 'SOFT_BODY', {'settings': {'use_goal': False, 'bend': 8, 'pull': 0.8, 'push': 0.8}}, 45)]], | |||||
| ] | ] | ||||
| softBody_test = ModifierTest(test) | soft_body_test = ModifierTest(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": | ||||
| softBody_test.apply_modifiers = True | soft_body_test.apply_modifiers = True | ||||
| softBody_test.run_all_tests() | soft_body_test.run_all_tests() | ||||
| break | break | ||||
| elif cmd == "--run-test": | elif cmd == "--run-test": | ||||
| softBody_test.apply_modifiers = False | soft_body_test.apply_modifiers = False | ||||
| index = int(command[i + 1]) | name = str(command[i + 1]) | ||||
| softBody_test.run_test(index) | soft_body_test.run_test(name) | ||||
| break | break | ||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| main() | main() | ||||