File tree Expand file tree Collapse file tree 9 files changed +16
-25
lines changed
Expand file tree Collapse file tree 9 files changed +16
-25
lines changed Original file line number Diff line number Diff line change 44def main ():
55 # Required import for python
66 import Sofa
7- import SofaRuntime
7+ import SofaImGui
88
99 #Create the root node
1010 root = Sofa .Core .Node ("root" )
@@ -16,8 +16,8 @@ def main():
1616 for iteration in range (10 ):
1717 Sofa .Simulation .animate (root , root .dt .value )
1818 else :
19+ # Required import to manage the GUI
1920 import Sofa .Gui
20- SofaRuntime .importPlugin ("SofaImGui" )
2121
2222 # Find out the supported GUIs
2323 print ("Supported GUIs are: " + Sofa .Gui .GUIManager .ListSupportedGUI ("," ))
Original file line number Diff line number Diff line change 44def main ():
55 # Required import for python
66 import Sofa
7- import SofaRuntime
87
98 # Make sure to load all SOFA libraries
109
@@ -19,7 +18,7 @@ def main():
1918 Sofa .Simulation .animate (root , root .dt .value )
2019 else :
2120 import Sofa .Gui
22- import SofaQt
21+ import SofaQt # specific import for Qt-based GUI
2322
2423 # Find out the supported GUIs
2524 print ("Supported GUIs are: " + Sofa .Gui .GUIManager .ListSupportedGUI ("," ))
Original file line number Diff line number Diff line change @@ -102,9 +102,8 @@ def createScene(root):
102102
103103
104104def main ():
105- import SofaRuntime
105+ import SofaImGui
106106 import Sofa .Gui
107- SofaRuntime .importPlugin ("SofaImGui" )
108107
109108 root = Sofa .Core .Node ("root" )
110109 createScene (root )
Original file line number Diff line number Diff line change @@ -31,9 +31,8 @@ def createScene(root):
3131
3232
3333def main ():
34+ import SofaImGui
3435 import Sofa .Gui
35- import SofaRuntime
36- SofaRuntime .importPlugin ("SofaImGui" )
3736
3837 root = Sofa .Core .Node ("root" )
3938 createScene (root )
Original file line number Diff line number Diff line change @@ -56,9 +56,8 @@ def createScene(root):
5656
5757
5858def main ():
59- import SofaRuntime
59+ import SofaImGui
6060 import Sofa .Gui
61- SofaRuntime .importPlugin ("SofaImGui" )
6261
6362 root = Sofa .Core .Node ("root" )
6463 createScene (root )
Original file line number Diff line number Diff line change @@ -58,9 +58,8 @@ def createScene(root):
5858
5959
6060def main ():
61- import SofaRuntime
61+ import SofaImGui
6262 import Sofa .Gui
63- SofaRuntime .importPlugin ("SofaImGui" )
6463
6564 root = Sofa .Core .Node ("root" )
6665 createScene (root )
Original file line number Diff line number Diff line change 1- # Required import for python
21import Sofa
32
43
76
87
98def main ():
10- import SofaRuntime
9+ # Required import for python
10+ import Sofa
1111 import Sofa .Gui
12+ import SofaImGui
13+
1214
1315 root = Sofa .Core .Node ("root" )
1416 createScene (root )
@@ -18,7 +20,6 @@ def main():
1820 for iteration in range (10 ):
1921 Sofa .Simulation .animate (root , root .dt .value )
2022 else :
21- SofaRuntime .importPlugin ("SofaImGui" )
2223 Sofa .Gui .GUIManager .Init ("myscene" , "imgui" )
2324 Sofa .Gui .GUIManager .createGUI (root , __file__ )
2425 Sofa .Gui .GUIManager .SetDimension (1080 , 1080 )
Original file line number Diff line number Diff line change 1- # Required import for python
2- import Sofa
3-
4-
51# Choose in your script to activate or not the GUI
62USE_GUI = True
73
8-
94def main ():
10- import SofaRuntime
11- import Sofa .Gui
5+ # Required import for python
6+ import Sofa
7+ import SofaImGui
128
139 root = Sofa .Core .Node ("root" )
1410 createScene (root )
@@ -18,7 +14,7 @@ def main():
1814 for iteration in range (10 ):
1915 Sofa .Simulation .animate (root , root .dt .value )
2016 else :
21- SofaRuntime . importPlugin ( "SofaImGui" )
17+ import Sofa . Gui
2218 Sofa .Gui .GUIManager .Init ("myscene" , "imgui" )
2319 Sofa .Gui .GUIManager .createGUI (root , __file__ )
2420 Sofa .Gui .GUIManager .SetDimension (1080 , 1080 )
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def createScene(root):
2929
3030
3131def main ():
32- import SofaRuntime
32+ import SofaImGui
3333 import Sofa .Gui
3434
3535 root = Sofa .Core .Node ("root" )
@@ -39,7 +39,6 @@ def main():
3939 # Find out the supported GUIs
4040 print ("Supported GUIs are: " + Sofa .Gui .GUIManager .ListSupportedGUI ("," ))
4141 # Launch the GUI (imgui is now by default, to use Qt please refer to the example "basic-useQtGui.py")
42- SofaRuntime .importPlugin ("SofaImGui" )
4342 Sofa .Gui .GUIManager .Init ("myscene" , "imgui" )
4443 Sofa .Gui .GUIManager .createGUI (root , __file__ )
4544 Sofa .Gui .GUIManager .SetDimension (1080 , 1080 )
You can’t perform that action at this time.
0 commit comments