[scripts] Fix recursive node parsing was forgetting root and add option to test if mechanicalObject is mapped #99
Conversation
|
There's a conflict here @epernod |
# Conflicts: # tools/RegressionSceneList.py
| return JSONEncoder.default(self, obj) | ||
|
|
||
|
|
||
| def is_mapped(node): |
There was a problem hiding this comment.
Just for the record, your test is based on an implicit rule that a mapped state is in the same Node than the mapping. But that's not mandatory...
There was a problem hiding this comment.
And I guess there is no way from the MechanicalObject to know if it is mapped?
This means we should process all MechancalMapping first?
There was a problem hiding this comment.
You guessed right. But for now SOFA also relies on this in its visitors: https://github.com/sofa-framework/sofa/blob/694bc3cd2f3891460e3c69141095146f1198af61/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.cpp#L79. You're safe for now.
There was a problem hiding this comment.
ok, anyway, this is mostly to match the old regression behavior. For me we should test all mechanicalObject, mapped or not.
Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
Add method to test if mechanicalObject is in a mapped Node and confront this value with the option "check mapped mechanicalOjbect" from legacy regression