From 5c33bcb6c84f283787e9d3b11fab4c952c4a6211 Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Wed, 3 Jan 2024 10:30:00 +0900 Subject: [PATCH] update plugins --- examples/additional-examples/ControllerScene.py | 5 +++-- examples/additional-examples/pygame_example.py | 16 ++-------------- examples/additional-examples/pyqt_example.py | 11 +++-------- examples/emptyController.py | 2 +- examples/emptyDataEngine.py | 2 +- examples/example-forcefield.py | 3 --- examples/liver.py | 2 -- 7 files changed, 10 insertions(+), 31 deletions(-) diff --git a/examples/additional-examples/ControllerScene.py b/examples/additional-examples/ControllerScene.py index 197ac28d..a5010a7a 100755 --- a/examples/additional-examples/ControllerScene.py +++ b/examples/additional-examples/ControllerScene.py @@ -108,8 +108,9 @@ def createScene(root): def main(): # Load the required plugins - SofaRuntime.importPlugin("SofaOpenglVisual") - SofaRuntime.importPlugin("SofaGeneralEngine") + SofaRuntime.importPlugin("Sofa.GL.Component") + SofaRuntime.importPlugin("Sofa.Component") + # Check and save if the script is called from python environment global _runAsPythonScript diff --git a/examples/additional-examples/pygame_example.py b/examples/additional-examples/pygame_example.py index 72a8a0be..8b93819c 100644 --- a/examples/additional-examples/pygame_example.py +++ b/examples/additional-examples/pygame_example.py @@ -53,20 +53,8 @@ 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="SofaOpenglVisual") # visual stuff - root.addObject("RequiredPlugin", name="SofaLoader") # geometry loaders - root.addObject("RequiredPlugin", name="SofaSimpleFem") # diffusion fem - root.addObject("RequiredPlugin", name="SofaBoundaryCondition") # constraints - root.addObject("RequiredPlugin", name="SofaEngine") # Box Roi - root.addObject("RequiredPlugin", name="SofaImplicitOdeSolver") # implicit solver - root.addObject("RequiredPlugin", name="SofaMiscForceField") # meshmatrix - root.addObject("RequiredPlugin", name="SofaGeneralEngine") # TextureInterpolation - root.addObject("RequiredPlugin", name="CImgPlugin") # for loading a bmp image for texture - root.addObject("RequiredPlugin", name="SofaBaseLinearSolver") - root.addObject("RequiredPlugin", name="SofaGeneralVisual") - root.addObject("RequiredPlugin", name="SofaTopologyMapping") - root.addObject("RequiredPlugin", name="SofaGeneralTopology") - root.addObject("RequiredPlugin", name="SofaGeneralLoader") + root.addObject("RequiredPlugin", name="Sofa.Component") + root.addObject("RequiredPlugin", name="Sofa.GL.Component") ### these are just some things that stay still and move around # so you know the animation is actually happening diff --git a/examples/additional-examples/pyqt_example.py b/examples/additional-examples/pyqt_example.py index 3826a32f..91d7a59b 100644 --- a/examples/additional-examples/pyqt_example.py +++ b/examples/additional-examples/pyqt_example.py @@ -96,14 +96,9 @@ class SofaSim(): def __init__(self): # Register all the common component in the factory. SofaRuntime.PluginRepository.addFirstPath(os.path.join(sofa_directory, 'bin')) - SofaRuntime.importPlugin('SofaOpenglVisual') - SofaRuntime.importPlugin("SofaComponentAll") - SofaRuntime.importPlugin("SofaGeneralLoader") - SofaRuntime.importPlugin("SofaImplicitOdeSolver") - SofaRuntime.importPlugin("SofaLoader") - SofaRuntime.importPlugin("SofaSimpleFem") - SofaRuntime.importPlugin("SofaBoundaryCondition") - SofaRuntime.importPlugin("SofaMiscForceField") + SofaRuntime.importPlugin('Sofa.GL.Component') + SofaRuntime.importPlugin("Sofa.Component") + self.root = Sofa.Core.Node("Root") root = self.root root.gravity = [0, -1., 0] diff --git a/examples/emptyController.py b/examples/emptyController.py index f1bac44b..ef5709bd 100644 --- a/examples/emptyController.py +++ b/examples/emptyController.py @@ -96,7 +96,7 @@ def createScene(root): def main(): import SofaRuntime import Sofa.Gui - SofaRuntime.importPlugin("SofaOpenglVisual") + root=Sofa.Core.Node("root") createScene(root) diff --git a/examples/emptyDataEngine.py b/examples/emptyDataEngine.py index a08b17a6..dc3433ae 100644 --- a/examples/emptyDataEngine.py +++ b/examples/emptyDataEngine.py @@ -33,7 +33,7 @@ def createScene(root): def main(): import Sofa.Gui import SofaRuntime - SofaRuntime.importPlugin("SofaOpenglVisual") + root=Sofa.Core.Node("root") createScene(root) Sofa.Simulation.init(root) diff --git a/examples/example-forcefield.py b/examples/example-forcefield.py index f4a978fe..02bd000c 100644 --- a/examples/example-forcefield.py +++ b/examples/example-forcefield.py @@ -60,9 +60,6 @@ def createScene(root): def main(): import SofaRuntime import Sofa.Gui - SofaRuntime.importPlugin("SofaOpenglVisual") - SofaRuntime.importPlugin("Sofa.Component.StateContainer") - SofaRuntime.importPlugin("SofaImplicitOdeSolver") root=Sofa.Core.Node("root") createScene(root) diff --git a/examples/liver.py b/examples/liver.py index fd73ba25..aa696e6f 100644 --- a/examples/liver.py +++ b/examples/liver.py @@ -9,8 +9,6 @@ def main(): import SofaRuntime import Sofa.Gui - SofaRuntime.importPlugin("SofaOpenglVisual") - SofaRuntime.importPlugin("SofaImplicitOdeSolver") root = Sofa.Core.Node("root") createScene(root)