2022-02-10 22:07:11 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2020-04-27 14:47:07 +00:00
|
|
|
|
|
|
|
# <pep8 compliant>
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
2021-07-27 15:30:28 +00:00
|
|
|
from modules.mesh_test import RunTest, ModifierSpec, SpecMeshTest
|
2020-04-27 14:47:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
test = [
|
2020-12-17 15:14:55 +00:00
|
|
|
|
2021-07-27 15:30:28 +00:00
|
|
|
SpecMeshTest("SoftBodySimple", "testSoftBody", "expectedSoftBody",
|
2020-12-17 15:14:55 +00:00
|
|
|
[ModifierSpec('Softbody', 'SOFT_BODY',
|
|
|
|
{'settings': {'use_goal': False, 'bend': 8, 'pull': 0.8, 'push': 0.8}},
|
|
|
|
45)]),
|
2020-04-27 14:47:07 +00:00
|
|
|
]
|
2020-12-17 15:14:55 +00:00
|
|
|
soft_body_test = RunTest(test)
|
2020-04-27 14:47:07 +00:00
|
|
|
|
|
|
|
command = list(sys.argv)
|
|
|
|
for i, cmd in enumerate(command):
|
|
|
|
if cmd == "--run-all-tests":
|
2020-12-17 15:14:55 +00:00
|
|
|
soft_body_test.apply_modifiers = True
|
|
|
|
soft_body_test.do_compare = True
|
|
|
|
soft_body_test.run_all_tests()
|
2020-04-27 14:47:07 +00:00
|
|
|
break
|
|
|
|
elif cmd == "--run-test":
|
2020-12-17 15:14:55 +00:00
|
|
|
soft_body_test.apply_modifiers = False
|
|
|
|
soft_body_test.do_compare = False
|
|
|
|
name = command[i + 1]
|
|
|
|
soft_body_test.run_test(name)
|
2020-04-27 14:47:07 +00:00
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2020-04-27 15:43:47 +00:00
|
|
|
main()
|