Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions examples/CCDIntersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,15 @@ def createScene(root_node):

plugins = root_node.addChild('plugins')

plugins.addObject('RequiredPlugin', name="MultiThreading")
plugins.addObject('RequiredPlugin', name="Sofa.Component.AnimationLoop")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Collision.Detection.Algorithm")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Collision.Detection.Intersection")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Collision.Geometry")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Collision.Response.Contact")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Lagrangian.Correction")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Lagrangian.Solver")
plugins.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
plugins.addObject('RequiredPlugin', name="Sofa.Component.LinearSolver.Direct")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Mapping.Linear")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Mass")
plugins.addObject('RequiredPlugin', name="Sofa.Component.ODESolver.Backward")
plugins.addObject('RequiredPlugin', name="Sofa.Component.SolidMechanics.FEM.Elastic")
plugins.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Dynamic")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Grid")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Topology.Mapping")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Visual")
plugins.addObject('RequiredPlugin', name="Sofa.GL.Component.Rendering3D")
plugins.addObject('RequiredPlugin', name="Sofa.Component.Engine.Select")
plugins.addObject('RequiredPlugin', name="Sofa.GUI.Component")
plugins.addObject('RequiredPlugin', pluginName=["MultiThreading", "Sofa.Component.AnimationLoop",
"Sofa.Component.Collision.Detection.Algorithm", "Sofa.Component.Collision.Detection.Intersection",
"Sofa.Component.Collision.Geometry", "Sofa.Component.Collision.Response.Contact",
"Sofa.Component.Constraint.Lagrangian.Correction", "Sofa.Component.Constraint.Lagrangian.Solver",
"Sofa.Component.IO.Mesh", "Sofa.Component.LinearSolver.Direct", "Sofa.Component.Mapping.Linear",
"Sofa.Component.Mass", "Sofa.Component.ODESolver.Backward", "Sofa.Component.SolidMechanics.FEM.Elastic",
"Sofa.Component.StateContainer", "Sofa.Component.Topology.Container.Dynamic",
"Sofa.Component.Topology.Container.Grid", "Sofa.Component.Topology.Mapping", "Sofa.Component.Visual",
"Sofa.GL.Component.Rendering3D", "Sofa.Component.Engine.Select", "Sofa.GUI.Component"])

root_node.addObject('VisualStyle', displayFlags="showVisual")
root_node.addObject('ConstraintAttachButtonSetting')
Expand Down
17 changes: 5 additions & 12 deletions examples/access_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,16 @@ def createScene(root):

root.addObject('VisualStyle', displayFlags="showBehaviorModels showForceFields")

root.addObject("RequiredPlugin", pluginName=['Sofa.Component.Mass',
'Sofa.Component.StateContainer',
'Sofa.Component.Topology.Container.Grid',
'Sofa.Component.Visual'
root.addObject("RequiredPlugin", pluginName=['Sofa.Component.Mass', 'Sofa.Component.StateContainer',
'Sofa.Component.Topology.Container.Grid', 'Sofa.Component.Visual',
'Sofa.Component.Constraint.Projective', 'Sofa.Component.Engine.Select',
'Sofa.Component.LinearSolver.Direct', 'Sofa.Component.LinearSystem',
'Sofa.Component.ODESolver.Backward','Sofa.Component.SolidMechanics.FEM.Elastic'
])

root.addObject('DefaultAnimationLoop', parallelODESolving=True)
root.addObject('DefaultVisualManagerLoop')

plugins = root.addChild('plugins')
plugins.addObject('RequiredPlugin', name='Sofa.Component.Constraint.Projective')
plugins.addObject('RequiredPlugin', name='Sofa.Component.Engine.Select')
plugins.addObject('RequiredPlugin', name='Sofa.Component.LinearSolver.Direct')
plugins.addObject('RequiredPlugin', name='Sofa.Component.LinearSystem')
plugins.addObject('RequiredPlugin', name='Sofa.Component.ODESolver.Backward')
plugins.addObject('RequiredPlugin', name='Sofa.Component.SolidMechanics.FEM.Elastic')

node_crs = createBeam(root, 'CompressedRowSparseMatrixMat3x3d')
node_crs.addObject('SparseLDLSolver', template="CompressedRowSparseMatrixMat3x3d")

Expand Down
3 changes: 1 addition & 2 deletions examples/additional-examples/pygame_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ def simple_render(rootNode):
def createScene(root):
# Register all the common component in the factory.
SofaRuntime.PluginRepository.addFirstPath(os.path.join(sofa_directory, 'bin'))
root.addObject("RequiredPlugin", name="Sofa.Component")
root.addObject("RequiredPlugin", name="Sofa.GL.Component")
root.addObject("RequiredPlugin", pluginName=["Sofa.Component", "Sofa.GL.Component"])

### these are just some things that stay still and move around
# so you know the animation is actually happening
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-addGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def main():
# Function called when the scene graph is being created
def createScene(root):

root.addObject('RequiredPlugin', name='Sofa.Component.StateContainer')
root.addObject('RequiredPlugin', pluginName='Sofa.Component.StateContainer')

# Scene must now include a AnimationLoop
root.addObject('DefaultAnimationLoop')
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-useQtGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def main():
# Function called when the scene graph is being created
def createScene(root):

root.addObject('RequiredPlugin', name='Sofa.Component.StateContainer')
root.addObject('RequiredPlugin', pluginName='Sofa.Component.StateContainer')

# Scene must now include a AnimationLoop
root.addObject('DefaultAnimationLoop')
Expand Down
2 changes: 1 addition & 1 deletion examples/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def main():
# Function called when the scene graph is being created
def createScene(root):

root.addObject('RequiredPlugin', name='Sofa.Component.StateContainer')
root.addObject('RequiredPlugin', pluginName='Sofa.Component.StateContainer')

# Scene must now include a AnimationLoop
root.addObject('DefaultAnimationLoop')
Expand Down
4 changes: 2 additions & 2 deletions examples/loadXMLfromPython.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ def createScene(root):
# Call the above function to create the scene graph
scene="""
<Node dt="0.005" gravity="0 0 0">
<RequiredPlugin name="Sofa.GL.Component.Rendering2D" />
<RequiredPlugin name="Sofa.Component.StateContainer" />
<RequiredPlugin pluginName="Sofa.GL.Component.Rendering2D" />
<RequiredPlugin pluginName="Sofa.Component.StateContainer" />

<Node name="child1">
<MechanicalObject template="Rigid3d" position="0 0 0 0 0 0 1" showObject="1"/>
Expand Down
3 changes: 1 addition & 2 deletions examples/pointSetTopologyModifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def createScene(root):

root.addObject("DefaultAnimationLoop")
root.addObject("DefaultVisualManagerLoop")
root.addObject("RequiredPlugin", name="Sofa.Component.Topology.Container.Dynamic")
root.addObject('RequiredPlugin', name='Sofa.Component.StateContainer')
root.addObject("RequiredPlugin", pluginName=["Sofa.Component.Topology.Container.Dynamic", "Sofa.Component.StateContainer"])

container = root.addObject("PointSetTopologyContainer", points=[[0, 0, 0], [1, 0, 0]])
modifier = root.addObject("PointSetTopologyModifier")
Expand Down
2 changes: 1 addition & 1 deletion examples/scene_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main():
# Function called when the scene graph is being created
def createScene(root):

root.addObject('RequiredPlugin', name='Sofa.Component.StateContainer')
root.addObject('RequiredPlugin', pluginName='Sofa.Component.StateContainer')

# Scene must now include a AnimationLoop
root.addObject('DefaultAnimationLoop')
Expand Down
Loading