Page MenuHome

Added framework for Simulate modifier tests
ClosedPublic

Authored by Himanshi Kalra (calra) on Mar 4 2020, 3:12 AM.

Details

Summary

A class called PhysicsSpec is made for Simulate modifiers.
The tests are added for:
Cloth
Soft Body
Note for future: The Physics calculations are done on world coordinates as told by Luca Rood in T74036, so for these tests, duplicate the objects in position otherwise the tests will fail because of threshold.

The blend files should be added in lib/tests/modeling

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Mar 4 2020, 10:12 AM

Thanks! Seems generally fine, though I haven't tried running the test.

Can this be made into a separate test with own .blend for every physics type? They're all modifiers, but it's specific enough that you'd want to be able to run them individually.

tests/python/modifiers.py
244 ↗(On Diff #22354)

Code style: here and in other places, always add a space after , and :.

tests/python/modules/mesh_test.py
88

frame_number -> frame_end

255

Code style: no empty line right after def line.

268

Avoid using operators when possible, this can probably be scene.frame_set or similar?

It's not even clear to me what this line does, which frame is it supposed to jump to?

275–277

Code style: use only one empty line as separator inside functions.

294

Easier to just pass the physics_spec entirely to this function.

This revision now requires changes to proceed.Mar 4 2020, 10:12 AM

Incorporating inline comments.

Himanshi Kalra (calra) marked 5 inline comments as done.Mar 13 2020, 9:05 AM
Himanshi Kalra (calra) added inline comments.
tests/python/modules/mesh_test.py
294

Accessing using physics_spec feels unnecessarily long.

Himanshi Kalra (calra) updated this revision to Diff 23069.EditedMar 24 2020, 6:11 PM

Added Individual files for testing for Cloth and SoftBody.

Himanshi Kalra (calra) edited the summary of this revision. (Show Details)Mar 24 2020, 7:07 PM
Himanshi Kalra (calra) edited the summary of this revision. (Show Details)
Brecht Van Lommel (brecht) requested changes to this revision.Apr 22 2020, 12:06 AM

This looks basically fine, just minor nitpicks at this point.

tests/python/CMakeLists.txt
201

For consistency, file should be lower case softbody_test.blend.

tests/python/modules/mesh_test.py
71

modifier -> physics modifier

88

Modifier -> Physics Modifier

256–258

Two empty lines still here.

292

This can also just call scene.frame_set?

This revision now requires changes to proceed.Apr 22 2020, 12:06 AM
Himanshi Kalra (calra) marked 4 inline comments as done.Apr 25 2020, 5:47 PM
Himanshi Kalra (calra) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Apr 28 2020, 12:52 PM