[Prefabs] Add modifiers#612
Conversation
55ff092 to
09c1c67
Compare
86debfe to
9c9e731
Compare
…inside the object dynamically (see original proposition pr) and simply make the introduced example work
1370256 to
f1435ba
Compare
|
|
||
| @ReusableMethod | ||
| def setupLagrangianCollision(node, displayFlags = "showVisualModels",backgroundColor=[1,1,1,1], parallelComputing=False, stick=False, alarmDistance=DEFAULT_VALUE, contactDistance=DEFAULT_VALUE, frictionCoef=0.0, tolerance=0.0, maxIterations=100, **kwargs): | ||
| def setupLagrangianCollision(node, enableCollision = True, displayFlags = "showVisualModels",backgroundColor=[1,1,1,1], parallelComputing=False, stick=False, alarmDistance=DEFAULT_VALUE, contactDistance=DEFAULT_VALUE, frictionCoef=0.0, tolerance=0.0, maxIterations=100, **kwargs): |
There was a problem hiding this comment.
Why adding this boolean? Isn't setupLagrangianCollision always for collision?
Or did you forget to rename it to setupLagrangian or setupLagrangianConstraint?
There was a problem hiding this comment.
I think we should change the method name. We should remove "Collision" everywhere, so the boolean will make sense
| @@ -0,0 +1,41 @@ | |||
| import dataclasses | |||
| import splib.mechanics.attachment as splib_att | |||
There was a problem hiding this comment.
Minor but I would prefer import splib.mechanics.attachment as attachment. I would avoid renaming in general, if possible.
| touchedNodes = SimulationSettingsParameters._addConstraintCorrectionToMechanicalNodes(node[0], "LinearSolverConstraintCorrection", linearSolverPath = linearSolverPath) | ||
| return [owner] + touchedNodes |
There was a problem hiding this comment.
We could simplify this code by adding a single GenericConstraintCorrection.
There was a problem hiding this comment.
Yeah ok, I'll instead add a parameter that adds this Generic one by default and if set to true will add the local one.
Co-authored-by: EulalieCoevoet <eulalie.coevoet@gmail.com>
Added implementation of modifiers as designed.
I've added 4 types of modifiers already :
Attachements (fixation + attachements between two object)
Footers (SimulationSettings (aka animation loop + constraint correction) + SimulationSolvers (ODE + Linear solvers))
They are registered at the right place already (in the graph, and in datas of the prefabs modified by them). To test it launch examples/stlib/node_modifier.py