Changeset View
Changeset View
Standalone View
Standalone View
tests/python/physics_particle_instance.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 ModifierTest, ModifierSpec | ||||
| def main(): | def main(): | ||||
| test = [ | test = [ | ||||
| ["testCloth", "expectedCloth", | |||||
| [PhysicsSpec('Cloth', 'CLOTH', {'quality': 5}, 35)]], | ["ParticleInstanceSimple", "testParticleInstance", "expectedParticleInstance", | ||||
| [ModifierSpec('ParticleInstance', 'PARTICLE_INSTANCE', {'object': bpy.data.objects['Cube']})]], | |||||
| ] | ] | ||||
| cloth_test = ModifierTest(test, threshold=1e-3) | particle_instance_test = ModifierTest(test, threshold=1e-3) | ||||
| 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 | particle_instance_test.apply_modifiers = True | ||||
| cloth_test.run_all_tests() | particle_instance_test.run_all_tests() | ||||
| break | break | ||||
| elif cmd == "--run-test": | elif cmd == "--run-test": | ||||
| cloth_test.apply_modifiers = False | particle_instance_test.apply_modifiers = False | ||||
| index = int(command[i + 1]) | name = str(command[i + 1]) | ||||
| cloth_test.run_test(index) | particle_instance_test.run_test(name) | ||||
| break | break | ||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| main() | main() | ||||